-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't play 4k content on Xbox using WebView2 #7141
Labels
status: archived
Archived and locked; will not be updated
type: bug
Something isn't working correctly
Milestone
Comments
@joeyparrish Do you have an estimate of when the fix will be released? 🤔 |
Whenever @avelad or I do the cherry-picks and push one... it doesn't take long, but I'm a bit preoccupied with an internal project right now. |
avelad
pushed a commit
that referenced
this issue
Aug 19, 2024
avelad
pushed a commit
that referenced
this issue
Aug 19, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
status: archived
Archived and locked; will not be updated
type: bug
Something isn't working correctly
Have you read the FAQ and checked for duplicate open issues?
Yes
If the problem is related to FairPlay, have you read the tutorial?
N/A
What version of Shaka Player are you using?
4.10.9
Can you reproduce the issue with our latest release version?
Yes
Can you reproduce the issue with the latest code from
main
?Yes
Are you using the demo app or your own custom app?
Both
If custom app, can you reproduce the issue using our demo app?
Yes
What browser and OS are you using?
We use a WebView2 (Edge Chromium) inside a UWP on Xbox. "Xbox One" is manually added to the user-agent. If not manually added, the user-agent is the same as Edge Chromium on Windows.
For embedded devices (smart TVs, etc.), what model and firmware version are you using?
N/A
What are the manifest and license server URIs?
We found the problem while trying to play our own content, but we were able to reproduce with Sintel.
https://storage.googleapis.com/shaka-demo-assets/sintel-mp4-only/dash.mpd
What configuration are you using? What is the output of
player.getConfiguration()
?What did you do?
Start a content that is available in 4k.
What did you expect to happen?
In our app: the content should automatically play in the best available quality, 4k here.
In Shaka's demo app: we should be able to select 4k as the playback resolution.
What actually happened?
In our app: The content is playing in 1080p. A warning in the console reads "Xbox: Error detecting screen size, default screen size 1920x1080."
In Shaka's demo app: We can't select 4k as the playback resolution. A warning in the console reads "Xbox: Error detecting screen size, default screen size 1920x1080."
Before upgrading our app from using a WebView to using a WebView2, the 4k playback was working without any problem.
As we set manually add "Xbox One" in the user-agent,
detectMaxHardwareResolution()
knows that we are on an Xbox and try to callWindows.Media.Protection.ProtectionCapabilities()
andWindows.Media.Protection.ProtectionCapabilityResult
, which is working inside a regular WebView. That said, Microsoft change the way to call the native Windows APIs inside a WebView2. We need to manually add a special project calledWinRTAdapter
in our solution and to call the Windows APIs from the JavaScript side, we need to callchrome.webview.hostObjects.sync.Windows
instead ofWindows
. TheWinRTAdapter
should be configured to exposeWindows.Media.Protection.ProtectionCapabilities()
andWindows.Media.Protection.ProtectionCapabilityResult
More details here : https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/winrt-from-js.The quick fix would be to first check if
Windows
is defined before try to call the Windows APIs, if it's not defined, try to defineconst Windows = chrome.webview.hostObjects.sync.Windows;
and then, proceed normally. If it fails, it will default 1080p as it already does. By doing this, the maximum resolution detection will work well inside a WebView and a WebView2 (if the dev added "Xbox One" to the user-agent and added the WinRTAdapter project).Are you planning send a PR to fix it?
Yes
The text was updated successfully, but these errors were encountered: