Microsoft.Toolkit.Win32
Microsoft.Toolkit.Win32 copied to clipboard
Win32WebViewHost replaces application's Audio Session ownership
I'm submitting a...
- Bug report (I searched for similar issues and did not find one)
Current behavior
System sound mixer shows Win32WebViewHost process as the owner instead of the application containing the WebView control. IAudioSessionEnumerator.
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.
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.
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.
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: )
Reported to Edge team. #17469179
Note: the string "Win32WebViewHost" has been replaced with "Desktop App Web Viewer"
@joshholmes FYI
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?
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