Everyday
memo
버그 개선사항 및 What I learnd ...
const capture = () => {
const canvas = document.createElement('canvas');
canvas.width = 160;
canvas.height = 90;
const ctx = canvas.getContext('2d');
ctx.drawImage(secondVideo.current, 0, 0, canvas.width, canvas.height);
setSnapShot(canvas.toDataURL());
};
const handleFullScreen = () => {
if (!document.fullscreenElement) {
refPlayerWrapper.current.requestFullscreen();
} else {
document.exitFullscreen();
}
};
비디오 이벤트리스너
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play_event
이벤트리스너 - pointer~ vs mouse~
document.addEventListener('pointermove', handleScrubbing);
document.addEventListener('pointerup', handleScrubEnd);
The support for touch devices will also “magically” improve. Although, we may need to add touch-action: none in some places in CSS. We’ll cover it below in the section about pointercancel.
포인터 이벤트는 다양한 Pointing Devices 를 다룰 수 있는 현대적인 방법
pointing devices(mouse, pen/stylus, touchscreen)
https://javascript.info/pointer-events
프로그래스바 퍼센트 구하기
const getProgressbarRect = () =>
refProgressbar.current.getBoundingClientRect();
const getProgressPercent = (e.pageX, rect) =>
Math.min(Math.max(0, e.pageX - rect.left), rect.width) / rect.width;
20 to 24
Monday/ Wednesday/ Thursday (Clarisse랑 날짜 조정하기)
Wednesday/ Saturday
19 to 20
Free time