Dear Support Team,
I am currently experiencing challenges with integrating livestream functionality on the Magic Leap 2. Below, I have outlined the specific methods I have attempted, along with brief descriptions of each approach. I would appreciate any guidance you could regarding playing a livestream in the Magic Leap 2.
- VideoPlayer Canvas/Quad/Plane
Description: Utilizing Unity's VideoPlayer component to display video content on various surfaces (Canvas, Quad, Plane) within the application.
Personal Experience: The best outcome I was able to achieve was to play videos in the unity player itself but never in the magic leap. Any file I used would not play in the ML2 and any stream regardless of format, encoding, and sample projects would not play in the video player.
- Using Google API for YouTube Livestreams
Description: Attempting to access and stream a compatible livestream from YouTube using the Google API.
Personal Experience: This was an attempt to get a link that the videoplayer component in the project would accpet but standard youtube streams would not work and the direct secure links accessed through their API would not work either.
- Accessing HLS Link of a Twitch Stream
Description: Trying to retrieve and stream an HLS link directly from a Twitch broadcast. GitHub - dudik/twitch-m3u8: Get the stream URL of a Twitch livestream or past broadcast (VOD).
Personal Experience: With both the github above and chatGPT I was able to access the HLS link to a twitch livestream in multiple ways but was unable to play the stream in unity.
- Streaming via VLC Player
Description: Using VLC to stream content from a camera, screen, or preexisting livestream to the device.
Personal Experience: I attempted to stream my camera, desktop, files, or preexisting livestreams with every combination of output and encoding and while I could see the video play locally in my browser I could never get the video to play in unity
- Using OBS (Open Broadcaster Software)
Description: Configuring OBS to stream content and integrating it with the Magic Leap device.
Personal Experience: [OBS was another attempt to find a link compatible with unity but did not have any success
- Custom HLS Stream with SRS and Docker
Description: Setting up a custom HLS stream using SRS (Simple Realtime Streaming) with Docker, and streaming in m3u8 format.
Reference: SRS Unity Documentation
Personal Experience: The entire process of setting up an HLS stream using SRS and docker was a success and I was able to stream the video in multiple formats and view it locally, across devices, and in every manner possible besides through the unity videoplayer, unity render streaming, websockets discussed below, or webRTC.
- Working Video from UF Server
Description: Successfully loading a video from a UF server with the video player, but facing issues with streaming functionality.
Personal Experience: This was the last attempt of focusing on the link to the stream since there are similar projects that pull a video and are able to play it but unfortunately when I tried to run the video or a stream in the ML2 the quad/plane/canvas/any method of viewing the video would not load.
-
Unity Render Streaming
Description: Attempting to use Unity's Render Streaming capabilities to facilitate video streaming.
Reference: Unity Render Streaming Documentation
Personal Experience: I followed every sample and could not get anything to play in the ML2 but had success in browser and across unity projects. -
WebSocket Sharp Tutorial
Description: Following the WebSocket Sharp tutorial to implement WebSocket communication for video streaming.
Reference: WebSocket Sharp GitHub
Personal Experience: Could not view anything in a running project on the ML2 or in the ML2’s browser. -
Unity WebRTC Integration
Description: Exploring the use of Unity WebRTC for real-time communication and video streaming through available tutorials.
References:
- Unity WebRTC Tutorial 1
- Unity WebRTC Tutorial 2
Personal Experience: Across unity projects I was able to send text but never video
- Additional WebRTC Projects
Description: Investigating further WebRTC projects relevant to Unity for potential streaming solutions.
References:
- GetStream WebRTC Projects
- Unity WebRTC Documentation
Personal Experience: Tried to complete the video streaming tutorial but was never able to get video to play in the magic leap
- Klak NDI Tutorial
Description: Attempting to use the Klak NDI tutorial for network device interface streaming within Unity.
Reference: Klak NDI GitHub
Personal Experience: I was able to send streams between two devices but never to the magic leap.
I appreciate your time and assistance in addressing these challenges. I look forward to your guidance on how to proceed. The end goal is to figure out a way to play any sort of livestream from anywhere on the Magic Leap 2 and have a QR code with Vuforia or AprilTag as a parent to the livestream so it can be tracked. We already have the working mechanisms/projects that have QR codes and AprilTags.
Thank you.
Best regards,
Andrew Dodds