2011-07-21 11 views

答えて

1
var ytplayer; 

function onYouTubePlayerReady(playerId) { 
    ytplayer = document.getElementById("myytplayer"); 
    checkBuffer(); 
} 

function checkBuffer(){ 
    if(ytplayer.getVideoBytesLoaded() == ytplayer.getVideoBytesTotal()){ 
     alert('Buffer Complete!'); 
    }else{ 
     var t = setTimeout(function(){ 
      Editor.split(); 
     },1000); 
    } 
} 
+3

これは、ビデオ全体がバッファリングを完了したときに機能します。私はBartoszが、ビデオがプレーヤーの演奏を開始するのに十分なバッファリングをしていたかどうかをチェックする方法を考えました。 – Joren

+0

正確に。彼は「YouTubeのバッファリングの仕上げ」を求めました。前に何かを始める必要がある場合は、必要に応じて "ytplayer.getVideoBytesLoaded()== ytplayer.getVideoBytesTotal()"ロジックを変更してください。 –

関連する問題