我正在尝试在三星智能电视的基于 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émy D.