gree / unity-webview

zlib License
2.23k stars 684 forks source link

WebView working for stream on iOS but not Android #889

Open ndrugby opened 1 year ago

ndrugby commented 1 year ago

I have an HTML5 page that displays a live stream from a red5pro server. When I load the HTML5 page into Webview, it displays the live feed without issue. However, when I load it into Android, all I get is a black screen.

KojiNakamaru commented 1 year ago

If red5pro requires http instead of https connections, you need to define UNITYWEBVIEW_ANDROID_USES_CLEARTEXT_TRAFFIC to allow them. Please check the following:

https://github.com/gree/unity-webview/tree/b3d726157eecb0504d2edc316d09ccb8a1f25b56#usescleartexttraffic

ndrugby commented 1 year ago

Thank you for the response, but it's quite the opposite. I had to change to HTTPS to access the stream and iOS worked but not Android. Neither worked before I had done that.

KojiNakamaru commented 1 year ago

Hmm, then you might need camera/audio permissions:

https://github.com/gree/unity-webview/tree/b3d726157eecb0504d2edc316d09ccb8a1f25b56#cameraaudio-permissionfeature

You could also identify the cause by utilizing adb logcat and/or remote debugging (cf. https://github.com/gree/unity-webview/issues/780#issuecomment-1044633633 ).

ndrugby commented 1 year ago

I’m working on debugging. But this what I see on Android (now that I switched back to HTTP and set the app to allow clear text)

D3E74926-72C9-4986-B432-77C7B1214B27

KojiNakamaru commented 1 year ago

If you cannot find any clue by adb logcat and/or remote debugging, it might be better to contact red5pro. They might forbid webview; at least they seem not to support webview judging from https://github.com/red5pro/streaming-android/issues/120 .