2016-06-30 12 views
0

seek(second)メソッドを使用してビデオをスキップしています。シークタイムをjwplayerに設定する方法

function playTheVideo(seekTimeInSec){ 

    var playerInstance = jwplayer("myElement"); 
     playerInstance.setup({ 
     file: "https://storage.googleapis.com/webinar_video/abcdedbv.mp4" 
     }); 
     playerInstance.seek(seekTimeInSec); 
} 

playTheVideo(500); 

によって呼び出すことが、プレイヤーは500秒で始まる転送していないビデオからビデオを再生しています。私は開始0時から500秒後にビデオを再生したい。

答えて

0

シーク動作を実行する前に、プレイヤーが完全に準備ができていることを確認する必要があります。シークコールを「準備完了」イベントリスナーに含めてみてください:

function playTheVideo(seekTimeInSec){ 

    var playerInstance = jwplayer("myElement"); 
    playerInstance.setup({ 
     file: "https://storage.googleapis.com/webinar_video/abcdedbv.mp4" 
    }); 
    playerInstance.on('ready', function(){ 
     playerInstance.seek(seekTimeInSec); 
    });   
} 
関連する問題