嵌入式YouTube播放视频的速度太快,没有声音

时间:2012-11-13 14:07:04

标签: javascript audio mp4 television

我正在尝试在基于Javascript的应用中为三星智能电视实现YT播放器。 问题是我想要使用的视频播放没有声音和快速。你们当中有人知道为什么吗?

这里是我正在使用的代码(视频以.mp4格式http://www.youtube.com/watch?v=l4uSJ-LpkwY编码):

var player=false; 

function onYouTubePlayerReady(playerId) {
                   player = document.getElementById(playerId);

                   Player.init();
//                 Player.setWindow();
}               

var Player = {};

Player.init = function(){

    this.playVideo("l4uSJ-LpkwY");
    this.setWindow();

}
Player.setWindow = function(){

        document.getElementById('ytplayer').style.width = "450px";
        document.getElementById('ytplayer').style.height = "450px";     
        document.getElementById('ytplayer').setSize(450,450);


}

Player.setFull = function(){

        document.getElementById('ytplayer').style.width = "960px";
        document.getElementById('ytplayer').style.height = "540px";     
        document.getElementById('ytplayer').setSize(960,540);


}

Player.onStateChange = function(state){

}

Player.playVideo = function(url){
    player.loadVideoById(url);
}

Player.stopVideo = function(){
    player.stopVideo();
}

Player.pauseVideo = function(){
    player.pauseVideo();
}

祝你好运, JérémyD。

0 个答案:

没有答案