Vimeo 비디오가 포함 된 페이지를 가져와 비디오를 언로드하고 비디오 재생이 끝나면 다른 페이지로 리디렉션하려면 어떻게해야합니까?

앤드류

리디렉션 부분을 알아 냈지만 (아래 참조) 문제는 포함 된 비디오가있는 페이지로 돌아 가면 즉시 리디렉션 페이지로 이동한다는 것입니다. 따라서 리디렉션이 발생하기 전에 비디오를 언로드하거나 비디오의 시작 부분으로 재설정 할 수 있다면이 문제를 해결할 수 있다고 생각합니다.

생각?

<div class="video"><iframe src="https://player.vimeo.com/video/253989945?byline=false&playsinline=0&portrait=false&title=false" frameborder="0" allow="autoplay; fullscreen" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
<script src="https://player.vimeo.com/api/player.js"></script>
<script>
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
player.getEnded().then(function(ended) {
  // `ended` indicates whether the video has ended
   window.location.replace("http://www.google.com/");
});
</script>

알렉스 드 샤 베스

이벤트 리스너를 사용해야 할 때 getter를 사용하면 안됩니다. 또한 비디오가 종료되었는지 확인하기 위해 조건부를 사용하지 않았습니다.

이와 같은 것이이 목적을 달성해야합니다.

var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);

player.on('ended', function() {
    console.log('ended')
    window.location.replace("https://www.google.com/");
})

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

Related 관련 기사

뜨겁다태그

보관