Magic Leap WebView HLS Streaming Support

Unity Editor version: 2022.3.39f1
ML2 OS version: 1.11.0
Unity SDK version: 2.6.0
Host OS: (Windows/MacOS) Windows 11

Hi,

I’m currently developing a feature to stream a HLS video via WebView on Magic Leap.

I’m using Vuplex as the WebView, I’ve tried written a custom HLS video player, and tested other public HLS player on the web. I’ve tested in Unity editor and on other Android base AR/VR devices and they all worked out, but when running the solution on Magic Leap 2 the HLS stream won’t load.

Does WebView on Magic Leap not support HLS streaming or does it only support a certain version of hls.js in the WebView JavaScript?

I’m not familiar with the Vuplex WebView player but we do use the standard Android Media player API which does support HLS streaming. If you want to double check whether it is a Magic Leap 2 issue or a general x86_64 issue you could build a standard Unity x86_64 Android App with the Vuplex player without the Magic Leap dependencies and try to run the APK on the Magic Leap 2. It will render as a 2d Android app.

If you want a definitive answer and suspect it might be the plugin itself. You can then also use the Emulator on Android Studio and create an x86_64 virtual Android device. You will just need to make sure that the virtual device is configured for Android 10 and x86_64 without Google Play services. Then you can try running the same 2D app in the emulator and see if the issue persists.

If issue persists in the emulator you can reach out to the Asset developer and notify them of the bug. However if you find that the issue is limited to the Magic Leap 2 then it might be an issue with our hardware. In which case we would not be able to fix the issue.

Hey thanks for the update!

I did some more testing with a general x86_64 build. It works out fine on an emulator (API 29 w/o Google Play) in Android Studio, but it doesn’t work on Magic Leap.

After some debugging in the Chromium browser view I found out the in app webview only supports vp8/vp9/opus codecs on Magic Leap, not the ones that we need for streaming (mp4a/h.264). Do you know if there’s a specific setting/flag I need to set to enable these codecs? Thanks.

Hi there, I got an update from Vuplex’s side.

They mentioned that the Vuplex 3D WebView for Android uses the Android System WebView, which is a built-in component of the operating system, as its browser engine. So I was wondering if it’s possible to enable support for the proprietary video codecs in the Android System Webview on Magic Leap 2.

Hi @pcheng, thank you for providing all of that information. I talked to our multimedia team and unfortunately this feature is unavailable. Were able to reproduce this bug which seems to be specific to x86_64. I know the Android Media player supports this type of playback but there is an open bug that the stream will always stream in the lowest quality (due to this same core platform bug).