I order you to forgive yourself!
Here is my situation: I currently stream on Twitch as well as on Hitbox.
http://www.twitch.tv/apostoliquehttp://www.hitbox.tv/ApostoliqueI want a Javascript Function that I can insert into twitch from the browser's url to replace Twitch's video stream for Hitbox's embed one if that's possible.
Here is the Hitbox embed code:
<iframe width="100%" height="360" src="http://hitbox.tv/#!/embed/apostolique?autoplay=true" frameborder="0" allowfullscreen></iframe>
In the Twitch page, the above iframe needs to replace the div with the unique ID of #player.
An artist's depiction of an Extended Unit Death
javascript:$('.dynamic-player').html('<iframe width="100%" height="360" src="http://hitbox.tv/#!/embed/apostolique?autoplay=true" frameborder="0" allowfullscreen></iframe>');
I order you to forgive yourself!
Thanks! I'll be playing around with that to make it exactly how it should.
Edit: Slightly better version it would seem:
document.getElementById("player").outerHTML = '<iframe width="100%" height="360" src="http://hitbox.tv/#!/embed/apostolique?autoplay=true" frameborder="0" allowfullscreen></iframe>';
It seems like I only run those with the console though.
Edit 2: Even better:
javascript:document.getElementById("player").outerHTML = '<div class="wrapper" style="width:100%;height:100%;margin:0 auto;"> <div class="h_iframe" style="position:relative;"> <img class="ratio" src="http://placehold.it/16x9" style="display:block;width:100%;height:auto;"/> <iframe style="position:absolute;top:0;left:0;width:100%; height:100%;" width="100%" height="100%" src="http://hitbox.tv/#!/embed/apostolique?autoplay=true" frameborder="0" allowfullscreen></iframe> </div></div>';
With this last one, the Hitbox stream will perfectly replace the Twitch one almost seamlessly.
Edit 3: Now it works with the theater mode!
javascript:document.getElementById("player").outerHTML = '<div id="player"> <div class="wrapper" style="width:100%;height:100%;margin:0 auto;"> <div class="h_iframe" style="position:relative;"> <img class="ratio" src="http://placehold.it/16x9" style="display:block;width:100%;height:auto;"/> <iframe style="position:absolute;top:0;left:0;width:100%; height:100%;" width="100%" height="100%" src="http://hitbox.tv/#!/embed/apostolique?autoplay=true" frameborder="0" allowfullscreen></iframe> </div> </div></div>';
Post has been edited 4 time(s), last time on Apr 12 2015, 11:43 pm by Apos.