I am trying to implement the YT player in a Javascript based app for Samsung smart TV. The problem is that the video I want to use plays without sound and to fast. Is any of you hae an idea why??
Here the code I am using (the video was encoded in .mp4 format 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();
}
Best regards, Jérémy D.