이전 목록 다음
채택완료

html5 커스텀 비디오 문제

2020-04-24 (금) 13:15:50 2,613

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

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

http://minho.dothome.co.kr/video/

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

스크립트 코드 중에

Copy
function updateProgress() {

seek.value = Math.floor(video.currentTime);

progressBar.value = Math.floor(video.currentTime);

var bufferedEnd = video.buffered.end(video.buffered.length - 1);

var duration =  video.duration;

if (duration > 0) {

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

}

var duration =  video.duration;

  if (duration > 0) {

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

}

}

 

// updateSeekTooltip uses the position of the mouse on the progress bar to

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

// the progress bar is clicked at that point

function updateSeekTooltip(event) {

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

seek.setAttribute('data-seek', skipTo)

var t = formatTime(skipTo);

seekTooltip.textContent = `${t.minutes}:${t.seconds}`;

var rect = video.getBoundingClientRect();

seekTooltip.style.left = `${event.pageX - rect.left}px`;

}

 

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

// is clicked

function skipAhead(event) {

  var skipTo = event.target.dataset.seek;

  video.currentTime = skipTo;

  progressBar.value = skipTo;

  seek.value = skipTo;

}

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

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

|

답변 1개

채택된 답변
+20 포인트
2020-04-24 (금) 13:21:39

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

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