![](https://secure.gravatar.com/avatar/62211977bf1bc530f4938871caba8f3b?rating=PG&size=50&default=https%3A%2F%2Fcdn.desk.com%2Fassets%2Funknown_user_50-8ad5644bbe6b1bd7454f2ea465f782bd.png)
Callback for on autostart not allowed
Hi there
There are more and more browsers which doesn't allow autostart. Is there something to check, if autostart is allowed or not? Lika a "onAutostartDisallowed" callback?
My current workaround is to check the players state on ready (for example, Chrome on Android doesn't fire any requests at all in the first place) ...
// on('ready')
window.setTimeout(function() {
if (jwplayer('id').getState() === 'idle') {
// Do something smart here
}
}, 0);
... and onAdImpression (for example, Safari 11 requesting the ad before pausing the autostarted stream)
// on('adImpression')
window.setTimeout(function() {
if (jwplayer('id').getState() !== 'playing') {
// do something smart here
}
}, 0);
Is there a better, cleaner way to do this? Or is there even a feature planed?
Thank you.
Cheers, Marc