테스트 사이트 - 개발 중인 베타 버전입니다

html5 커스텀 비디오 문제 채택완료

뒷고기잘구움 5년 전 조회 2,451

안녕하세요 우선 그누보드 관련 문제 아니고 소스 문제인데 죄송합니다ㅠ

 

지금 커스텀 비디오플레이어를 만들고 있는데..

http://minho.dothome.co.kr/video/" target="_blank">http://minho.dothome.co.kr/video/

원래는 영상이 딱 1분 컷으로 나오는데 여기서는 1분 1초로 나와서 골머리를 썩고 있는데 뭐가 문제인지 모르겠네요.. 

 

스크립트 코드 중에

</strong></p>

<p>function updateProgress() {</p>

<p>seek.value = Math.floor(video.currentTime);</p>

<p>progressBar.value = Math.floor(video.currentTime);</p>

<p>var bufferedEnd = video.buffered.end(video.buffered.length - 1);</p>

<p>var duration =  video.duration;</p>

<p>if (duration > 0) {</p>

<p>document.getElementById('buffered-amount').style.width = ((bufferedEnd / duration)*100) + "%";</p>

<p>}</p>

<p>var duration =  video.duration;</p>

<p>  if (duration > 0) {</p>

<p>document.getElementById('progress-amount').style.width = ((video.currentTime / duration)*100) + "%";</p>

<p>}</p>

<p>}</p>

<p> </p>

<p>// updateSeekTooltip uses the position of the mouse on the progress bar to</p>

<p>// roughly work out what point in the video the user will skip to if</p>

<p>// the progress bar is clicked at that point</p>

<p>function updateSeekTooltip(event) {</p>

<p>var skipTo = Math.round((event.offsetX / event.target.clientWidth) * parseInt(event.target.getAttribute('max'), 10));</p>

<p>seek.setAttribute('data-seek', skipTo)</p>

<p>var t = formatTime(skipTo);</p>

<p>seekTooltip.textContent = `${t.minutes}:${t.seconds}`;</p>

<p>var rect = video.getBoundingClientRect();</p>

<p>seekTooltip.style.left = `${event.pageX - rect.left}px`;</p>

<p>}</p>

<p> </p>

<p>// skipAhead jumps to a different point in the video when the progress bar</p>

<p>// is clicked</p>

<p>function skipAhead(event) {</p>

<p>  var skipTo = event.target.dataset.seek;</p>

<p>  video.currentTime = skipTo;</p>

<p>  progressBar.value = skipTo;</p>

<p>  seek.value = skipTo;</p>

<p>}</p>

<p><strong>

이 부분이 있는데 제가 추측할 때는여기서 잘못된것 같습니다.. 뭐가 문제인걸까요..ㅠ

정말 죄송하지만 부탁드립니다...

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

제작의뢰로 가보셔서 직접 보면서 작업해야할듯합니다; 1초값이 어디서 나오는지;

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인