Tuesday, January 24, 2017

Recheck video clip embeds!

Updates to Twitch Video Embed Coding, requires recheck of video embed pages since previous embed code will no longer work.

If you are a long time Twitch broadcaster and have been embedding video clips to a blog or a website its time to recheck all those pages. The <object> flash embed will not work anymore and you have to use the new video clip embed code.

Here is what the old Flash video embed code looks like:


Click on image to enlarge


You will need to switch it out to the new code found here:
https://dev.twitch.tv/docs/v5/guides/embed-video/


Here is the snip that I'm currently using for embedding video clips to my blog.

<script src= "http://player.twitch.tv/js/embed/v1.js"></script>
<div id="{PLAYER_DIV_ID}"></div>
<script type="text/javascript">
    var options = {
        width: 570,
        height: 350,
        video: "{v47183494}"
    };
    var player = new Twitch.Player("{PLAYER_DIV_ID}", options);
    player.setVolume(0.5);
</script>

If you want to use this code you will have to change the width, height sizes and in the video: section the clip ID # which I made bold. In order to find your clip ID number, go on Twitch and use their search functionality.

Here is a screenshot of me looking up the clip ID from the video in the old embed screenshot above. Take note of the old embed code for flashvars it shows title=, use that information there to search for the clip id numbers.


Click on image to enlarge

Once you find it on the search panel, click on it and you should see the clip id in your URL path. From my example it shows "twitch.tv/daopa/v/47183494". Replace all the numbers, switch out the old code for this new code and your good to go!

Tip: New Embed Video code includes a auto play feature which will start up another video as soon as the one listed is over. This is why you see on the video of Twitch.tv so many past broadcast showing up. The default next auto play video is last broadcast video the streamers have done. I personally hope they switch this to highlights instead of past broadcasts by default.
No comments:
Post a Comment