<script src= "http://player.twitch.tv/js/embed/v1.js"></script>
<div id="SamplePlayerDivID"></div>
<script type="text/javascript">
var options = {
width: 854,
height: 480,
channel: "dallas",
};
var player = new Twitch.Player("SamplePlayerDivID", options);
player.setChannel("esl_csgo");
</script>
I have this code which in theory should create a twitch player, and immediately change it to the channel esl_csgo. For some reason it doesn’t work, any help?
Thanks for replying Barry. I understand I can just set the channel in the settings, but I’m only using this script to test how updating the channel player works since when I use the script in the future I’m going to be constantly changing the channel. I don’t think the player being ready is the issue, since I tested it with changing the channel on right arrow key down and I gave it ample time and it still didn’t work. I’m not getting anything in console. Any ideas?