justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 381 forks source link

Embed Videos doesn't support HTTPS #622

Closed pc035860 closed 7 years ago

pc035860 commented 7 years ago

Either

    <iframe 
        src="https://player.twitch.tv/?video={VIDEO}" 
        height="720" 
        width="1280" 
        frameborder="0" 
        scrolling="no"
        allowfullscreen="true">
    </iframe>

nor

<script src="https://player.twitch.tv/js/embed/v1.js"></script>
<div id="{PLAYER_DIV_ID}"></div>
<script type="text/javascript">
    var options = {
        width: 854,
        height: 480,
        channel: "{CHANNEL}", 
        //video: "{VIDEO_ID}"       
    };
    var player = new Twitch.Player("{PLAYER_DIV_ID}", options);
    player.setVolume(0.5);
    player.addEventListener(Twitch.Player.PAUSE, () => { console.log('Player is paused!'); });
</script>

doesn't support embed on HTTPS sites after recent player change (it seems to work last week).

Insecure requests are being blocked by browser. Even VODs on Twitch site can't be played due to the blocking. e.g. https://www.twitch.tv/rikhh/v/91921506

twitch_vod_blocked

Tested browsers: (all incognito mode) Opera 40.0.2308.62 on Windows 10.1 Chrome 53.0.2785.116 m (64-bit) on Windows 10.1

scottrabin commented 7 years ago

hi @pc035860 - I'm not able to reproduce your issue locally. Can you share a link or a fiddle that demonstrates your issue?

pc035860 commented 7 years ago

Here's the fiddle https://jsfiddle.net/830xqy8g/

Some of the errors in my console: (browser: Opera 40.0.2308.62 on Windows 10.1)

embed_error_01

embed_error_02

pc035860 commented 7 years ago

Update: Switching off the HTML5 player from the option will fix the issue. Lots of Twitch viewers who want to watch VODs seem to encounter the same issue.

DallasNChains commented 7 years ago

This should be fixed! If you see any errors with it, let me know!