Bug 184845 - [GTK] Disable video autoplay
Summary: [GTK] Disable video autoplay
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-20 15:38 PDT by Michael Catanzaro
Modified: 2019-05-17 00:47 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.51 KB, patch)
2018-04-20 15:39 PDT, Michael Catanzaro
cgarcia: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2018-04-20 15:38:31 PDT
Ever since we added gstreamer-libav to the GNOME runtime last month, I've become increasing frustrated by autoplay videos.

This patch seems to work for cnn.com. Haven't managed to test youtube due to all the assertion failures.

I'm not sure where the best place to do this is. I'm specifically trying to avoid adding API.
Comment 1 Michael Catanzaro 2018-04-20 15:39:03 PDT
Created attachment 338472 [details]
Patch
Comment 2 Build Bot 2018-04-20 15:41:24 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Michael Catanzaro 2018-05-16 09:47:31 PDT
Comment on attachment 338472 [details]
Patch

I don't see any suggestions for how to do this better, so r?
Comment 4 Carlos Garcia Campos 2018-05-16 22:49:49 PDT
Why not adding new API for this (and other policies)? I'm fine with changing the default behavior, but that doesn't mean it fits for all use cases. An embedded with no input will want for sure auto play videos. Apple ports even have autoplay quirks, so I'm afraid this is not so easy.
Comment 5 Michael Catanzaro 2018-05-17 08:22:22 PDT
(In reply to Carlos Garcia Campos from comment #4)
> Why not adding new API for this (and other policies)?

I just don't have time to investigate new API right now, sorry.

We'll want to do something general that allows us to expose other members of WebsitePoliciesData in the future. WebkitWebsitePolicies, perhaps.
Comment 6 Carlos Garcia Campos 2018-05-17 23:43:13 PDT
Comment on attachment 338472 [details]
Patch

r- then, this is changing the behavior without a way for the user to opt in/out, it might break embedded systems where there isn't input to start video with a user gesture.
Comment 7 Philippe Normand 2019-05-17 00:47:58 PDT
An API wrapping WebsitePoliciesData sounds like the way to go?