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

Win32WebViewHost replaces application's Audio Session ownership #39

Open vhanla opened 6 years ago

vhanla commented 6 years ago

I'm submitting a...

Current behavior

System sound mixer shows Win32WebViewHost process as the owner instead of the application containing the WebView control. IAudioSessionEnumerator. win32webviewhost

It also affects WebNotifications, because clicking on the notification, it will open an empty window with title "Win32WebViewHost" instead of focusing the application containing that webview. webnotification

Expected behavior

Application's process listed in IAusioSessionEnumerator, i.e. in the system's audio mixer dialog window instead of Win32WebViewHost.

Also WebNotification showing the proper application's name as well the callback to bring the application to the foreground.

Minimal reproduction of the problem with instructions

Navigate to any website that emits sound, YouTube, etc. Open the Volume Mixer (right click the volume icon in systray -> select Volume Mixer). There will be listed Win32WebViewHost instead of our application name, if more than one application, using WebView, there will be listed as many as applications using webview + sound are running. win32webviewhost

And about web notification callback action: Navigate to Google Play Music webapp. Turn in settings the web notifications and refresh, accept the permission request. It will show the notification. Click the notification. It will open a windows titled Win32WebViewHost and will close after a second or less. win32webviewhostapp

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] Insider Build (build number: 17134)

App min and target version:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x] Insider Build (17134)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [x] 2017 (version: 15.7.1)
- [ ] 2017 Preview (version: )
rjmurillo commented 6 years ago

Reported to Edge team. #17469179

rjmurillo commented 6 years ago

Note: the string "Win32WebViewHost" has been replaced with "Desktop App Web Viewer"

rjmurillo commented 6 years ago

@joshholmes FYI

vhanla commented 5 years ago

Is there any way to catch the event when clicked on notification popup to focus my application instead of launching the Desktop App Web Viewer?

verelpode commented 5 years ago

This audio session ownership issue is also a problem in our environment. Ideally Win32WebViewHost shouldn't appear in the system sound mixer window, but if that's too difficult to fix, then we would consider it solved enough for our purposes if WebView supported at least an audio volume property that allows us to get and set the volume of WebView, like this:

class WebView
{
    ...
    public double AudioVolume { get; set; }
    // Optional:   public bool IsAudioVolumeMuted { get; set; }
    ...
}

For more info on the volume topic, please look at https://github.com/MicrosoftEdge/WebViewFeedback/issues/41