vast-player icon indicating copy to clipboard operation
vast-player copied to clipboard

NotAllowedError with autoplay on mobile devices

Open matejstrasek opened this issue 6 years ago • 4 comments

We are getting Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. when trying to autoplay on mobile devices.

Anyone knows a workaround for this?

matejstrasek avatar Jan 16 '19 07:01 matejstrasek

Can you provide some context? Which browser are you seeing this in? Which version of that browser?

minznerjosh avatar Jan 16 '19 19:01 minznerjosh

I'am getting the same error when trying to autoplay on Safari browser Version 12.0 (14606.1.36.1.9) and also the same error but with different message Uncaught (in promise) DOMException on Chrome browser Version 71.0.3578.98. The Firefox browser allows autoplay without any issues. If I do not implement autoplay and add user interaction like click on a button to play the video then everything works fine. There are a lot of solutions on stackoverflow how to solve Uncaught in promise issue but none of them helped me. Even when I mute the video I still get the same error with Uncaught.

kprokopchik avatar Jan 25 '19 07:01 kprokopchik

Same as @dhargo: Chrome 71.0.3578.98 and Safari 12.0.2.

Is the library calling manually *.play() somewhere? Could be devices don't like that maybe?

I ended up using pure html video tag instead and handling events we need.

matejstrasek avatar Jan 25 '19 08:01 matejstrasek

Looks like #19 will fix this.

minznerjosh avatar Jan 28 '19 18:01 minznerjosh