Search code examples
youtubeyoutube-apisamsung-smart-tv

Samsung Smart TV YouTube JavaScript Player API


i was developed and launched an app for Samsung Smart TV on(2011 TV) (SDK 2.5) and everything is ok.

and made it by YouTube JavaScript Player API v2 Now i'm trying to convert it to (2012 TV) (SDK 3.5)by use YouTube JavaScript Player API v3

im just change the version value from [apiplayer?version=2&enablejsapi=1 ] to==>[apiplayer?version=3&enablejsapi=1 ]

but nothing shown on tv or emulator just show a youtube word but no video

this is my youtube create function

function createYoutube() {
if (Main.onLine && !youtubeCreated)
{
  youtubeCreated = true;
  var html = "<object type='application/x-shockwave-flash' id='playerObject' style='width:507px; height:285.1px;'> "+
            "<param name='movie' value='http://youtube.googleapis.com/apiplayer?version=3&enablejsapi=1'></param>"+
            "<param name='allowScriptAccess' value='always'></param>"+
            "<param name='wmode' value='transparent'></param> "+
            "</object>";
  var player = document.getElementById("player")
  widgetAPI.putInnerHTML(player,html);
}

function onYouTubePlayerReady()
{

    YouTubePlayer = document.getElementById('playerObject');
    YouTubePlayer.addEventListener('onStateChange','onPlayerStateChange');
    YouTubePlayer.addEventListener('onError', 'onPlayerError');


    refreshPlayer();
}

i tried use http://www.youtube.com/apiplayer?enablejsapi=1&version=3 but nothing changed .


Solution

  • version=2 implies that the ActionScript 2 runtime will be used. (This version has been deprecated for a few years now and will be shut down soon.) version=3 implies that the ActionScript 3 runtime will be used. It might be that your platform doesn't support the ActionScript 3 runtime, in which case you'd need to follow up with Samsung.