Auto-accepting Mature stream for non-interactive embed

I am utilizing the non-interactive embed which is designed on my page to be non-interactive (i.e. it streams to a display with no PC controls attached). However mature streams require user interaction in order to play.

Currently I’m having to blacklist all streamers marking their channels as mature when I request a filtered list of streams from the API to get around this issue, but am wondering if there is any possible solution to enable playing mature videos without requiring user interaction so I will no longer need to block them anymore.

In theory when you change channels you can wait a second and then look for the right UI element and trigger a click on it using jQuery or similar. I’ve done this on a “office TV” project.

But I’d never do it on something more public, since most of the time, the mature flag could mean “GTAV” or it could mean “caster swears”.

If you do put a work around in, just be careful how you use it.

Using JQuery to trigger the button will not work, as Cross-Origin policies would prevent the jQuery Trigger event from working.

I ran into this as well while attempting to make an Amazon FireTV WebApp for our own channel. We have “Mature Content Warning” enabled, and the Embed does not have support for the FireTV remote control, preventing any sort of control. In addition, the FireTV does not support Deep Links between apps (even WebApp to Native Apps) so we cannot simply redirect a WebApp user to the Twitch FireTV app and auto-load our channel.

I would hope that these types of features appear in the Embed, FireTV Twitch App and FireTV as a whole, but Im not holding my breath.

The only other NON-OPTION would be pulling video via the M3u8 playlists, but that is against Twitch ToS, and as stated, is not an option what so ever.

Weird works fine in my application :expressionless:

This was my experience with desktop Chrome and the FireTV web app tester, both gave Cross-Origin policy errors and blocked the Trigger feature. What system did your test work in?

Flat desktop chrome

Code example:

<script src="https://player.twitch.tv/js/embed/v1.js"></script>
<script>
var pl = new Twitch.Player('somediv', {
    channel: 'twitch'
});
pl.setVolume(0.5);

setTimeout(function() {
    jQuery('#mature-link').trigger('click');
}, 5000);
</script>

Weird. Using that specific example above in Chrome (logged out of twitch so it doesn’t remember my preferences and DOES show the Mature Link button), the jQuery(‘#mature-link’) code returns an empty jQuery object, as if it cant even find the button.

Entering jQuery(‘#mature-link’) in the DevTools console also returns an empty object

HOWEVER, after selecting the button in the browser window, getting the contextual menu and selecting “inspect element”, the code DOES work. The problem is, I cant do that programmatically. Its as if the element doesnt exist (since it is in an iframe) until I force the dev tools to see it.

Ah thats coz inspector is no longer in “top” it’s “in the iframe”

image

I’m trying to retest mine, just fun to find a stream that I don’t have painted cookies for.

You could adjust the jQuery to target the iframe but weird mine works and your doesn’t :expressionless: Both my outer site and the Twitch API are over SSL could be that clutches furiously at straws

Retested. Yeah it’s broke.

Wonder how I tested it working before… shrug

Seems my way is broken and/or I tested it badly when I built this last week…

Should be able to do it with installing a chrome plugin on the $targetComputer and then relaying control messages to said chromePlugin, if the chromePlugin is told to load on *.twitch.tv.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.