WAI
Status Update
Comments
me...@gmail.com <me...@gmail.com> #2
Information redacted by Android Beta Feedback.
na...@google.com <na...@google.com> #3
It's possible that the Youtube embed is using a web API that's not supported on WebView.
to...@google.com <to...@google.com> #4
WebView does not implement the Chromecast APIs; they're not part of any web standard. If you want to cast from your Android app you will need to use the Android SDK to cast from your Java code.
Description
Version used: Chrome/91.0.4472.120
Devices/Android versions reproduced on: Android 11 / Google Pixel 2
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
I'm trying to load youtube (or similar sites) in a WebView.
However, the cast option isn't visible when playing a video
When I checked on the Android Chrome Browser, the cast option is available.
Explorations
Some answers on stackoverflow mention, enabling setPluginState.
However this has been deprecated since KitKat (reference)
Also the following code prints failure: "No Cast Extensions Found"
window['__onGCastApiAvailable'] = function(isAvailable, errorInfo) {
if (isAvailable) {
console.log('Success')
} else {
console.log('Error ' + errorInfo)
}
};
Is this expected behaviour or do I need to enable some config on WebView to get the cast working?