CommunityToolkit / Microsoft.Toolkit.Win32

ARCHIVE - This repository contained XAML Islands wrapper controls and tooling for XAML Islands with WinUI 2, see readme for more info about XAML Islands with WinUI 3 and the WindowsAppSDK.
https://aka.ms/windowsappsdk
Other
383 stars 89 forks source link

[Feature] - Configure video / audio autoplay policy in UWP WebView #245

Open danielcondemarin opened 4 years ago

danielcondemarin commented 4 years ago

Describe the problem this feature would solve

When using a WebView in my voice driven UWP app, HTML <video autoplay /> sometimes does not work. The following error is returned when calling HTMLMediaElement.play() method : AbortError

After reading through https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/browser-features/autoplay-policies this could be because there was no previous user gesture made. The problem is in voice driven apps, a "gesture" is not a "click" or a "tap", is a user spoken command.

Describe the solution

I will like to be able to allow autoplay without requiring user-gestures like clicks, taps first. Same to what electronjs already provides via autoplay policy.

Describe alternatives you've considered

Faking a click event in the document, but no luck there so far :/

Similar issues:

https://github.com/bbc/VideoContext/issues/66 https://github.com/whatwg/html/issues/505

ghost commented 4 years ago

Thanks for submitting a new feature request! I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future!

Kyaa-dost commented 4 years ago

@pagoe-msft ⬆️