2011-12-08 6 views
2

Vimeo에서 popcorn.js를 사용하고 있습니다. 프로그래밍 방식으로 Vimeo 비디오를 재생하고 싶습니다만, Vimeo 비디오에서 기본 play() 메서드를 사용할 수 없습니다.Vimeo 비디오에서 popcorn.js play()가 작동하지 않습니다.

popcorn.js.org의 예제 코드가 저에게 적합하지 않습니다. 비디오가 "즉시 재생"되지 않습니다.

document.addEventListener("DOMContentLoaded", function() { 

    var example = Popcorn.vimeo(
    '#video', 
    'http://player.vimeo.com/video/25107077'); 

    // add a footnote at 2 seconds, and remove it at 6 seconds 
    example.footnote({ 
     start: 2, 
     end: 6, 
     text: "Pop!", 
     target: "footnotediv" 
    }); 

    // play the video right away 
    example.play(); 

    }, false); 

답변

1

example.play()을 적절한 청취자로 이동하십시오. 작동해야 함 :

example.listen('canplaythrough', function() { 
    example.play(); 
}); 
관련 문제