Some question about player.md

  1. I create html file in my local computer with this code. But auto_play false doesn’t work. I want to set off auto play because on SGS 4 there is some issue with this.(GetPTLAFormat: Invalid format) link fLink to issue

Thanks

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script>
      $(function () {
        window.onPlayerLoad = function () {
          var player = $("#twitch_embed_player")[0];
          player.playVideo();
          player.mute();
        };
        swfobject.embedSWF("http://www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf", "twitch_embed_player", "640", "400", "11", null,
          { "initCallback":"onPlayerLoad",
            "embed":1,
            "channel":"whitera",
            "auto_play":"false"},
          { "allowScriptAccess":"always",
            "allowFullScreen":"true"});
      });
    </script>
  </head>
  <body>
    <div id="twitch_embed_player">
    </div>
  </body>
</html>

I also noticed auto_play=false was not working properly. As a work around you can call the pauseVideo() method after loading.

$(function () {
    window.onPlayerLoad = function () {
        var player = $("#twitch_embed_player")[0];
        player.pauseVideo();
    };
    swfobject.embedSWF("//www-cdn.jtvnw.net/swflibs/TwitchPlayer.swf", "twitch_embed_player", "640", "400", "11", null, {
        "initCallback": "onPlayerLoad",
        "embed": 1,
        "auto_play": "false",
        "channel": "lirik",
    }, {
        "allowScriptAccess": "always",
        "allowFullScreen": "true"
    });
});

and an example.

1 Like

Also if use full link to swf player, it doesn’t work

 http://www-cdn.jtvnw.net/swflibs/TwitchPlayer.r7d24e78c225594ec8b8b8baf3bc9b802ae9c6051.swf?channel=taketv&auto_play=false