Bug 216887 - Low Power mode is disabling video autoplay
Summary: Low Power mode is disabling video autoplay
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: Safari 14
Hardware: iPhone / iPad iOS 13
: P1 Blocker
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-23 10:19 PDT by Sean Aye
Modified: 2022-12-14 04:02 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Aye 2020-09-23 10:19:34 PDT
Video elements which are set to autoplay either via the autoplay attribute or through javascript will throw an error when an iOS device is in low power mode. 

`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.`

This issue is not present if the device is in 'normal' mode, not low power mode.

I am using webkit through Capacitor on iOS
Comment 1 Alexey Proskuryakov 2020-09-23 11:26:55 PDT
While I do not know for a fact if this is expected, this sounds like desirable behavior. Could you please clarify if this poses a problem?
Comment 2 Sean Aye 2020-09-23 11:33:56 PDT
(In reply to Alexey Proskuryakov from comment #1)
> While I do not know for a fact if this is expected, this sounds like
> desirable behavior. Could you please clarify if this poses a problem?

Thanks for the fast reply.

This poses a problem for our app. We are creating a video streaming hybrid app where users scroll through many videos which autoplay when scrolled into view. 

It is poor user experience if the user has to manually click play on each video, especially since it wouldn't be explicitly clear that the reason videos do not autoplay is due to 'low power mode'.

I can see the argument for this being intended 'default' behaviour but there should be some way of changing it since it breaks the experience of certain apps.
Comment 3 Radar WebKit Bug Importer 2020-09-30 10:20:14 PDT
<rdar://problem/69797328>
Comment 4 Sean Aye 2020-09-30 10:27:34 PDT
This also causes issues with capturing video thumbnails. Users also can upload videos and we show a thumbnail preview of the video before upload. 

AFAIK the only way to show this thumbnail from a File is to play the video in a hidden video element then capture an image via `canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height)`.

This method for video thumbnail capture only works if the file can be played programmatically via javascript. Therefore video thumbnails cannot be captured if a device is on low power mode
Comment 5 Alessandro Rigobello 2021-01-28 04:04:28 PST
Same problem here
Comment 6 Will Morgan 2021-10-01 10:16:33 PDT
Having followed all the other guidance such as set playsinline, muted, etc, this is a bit of a curveball.

I believe we're seeing this affecting our app, despite us playing the video as a result of a user gesture.