I’m very new to javascript and i was trying to access the width and height values of an Iframe to modify them depending on the window Size. For some reasons it didn’t work and all solutions went nowhere.
Then i thought “hey there’s also a direct javascript implementation”.
Setting the Width and Height of the player on load is child play but when it comes to dynamically resize it depending on window size i hit a wall. because in the Embed Dev Post there is no such access. So i was wondering if that access actually exist Or if it’s just not implemented.
That would be something like
var w = window.innerWidth;
var h = window.innerHeight;
var options = {
width: w,
height: h,
channel: “monstercat”
};
twitch = new Twitch.Player(“SamplePlayerDivID”, options);
That first part works perfectly
And then in the onresize event i would like to have something like
twitch.setWidth (w);
twitch.setHeight(h);