How to run the ML WebRTC sample in Magic Leap 1

Sadao Tokuyama
知っ徳!納徳! Magic Leap

--

Introduction

WebRTC function is available in Lumin OS 0.98.20 and Lumin SDK 0.25 released on Thursday, February 18, 2021. please refer to the following for more information about WebRTC.

In Magic Leap Unity Package 0.25, there is a WebRTC sample. This section explains how to use the sample, from setting up the environment to how it works.

What you need

Unity Editor 2020.2.x

Lumin SDK 0.25

Unity Template 0.25

Python

Magic Leap 1 (Lumin OS 0.98.20)

Conditions

The Magic Leap 1 and the PC (signaling server) must be on the same network.

Preparation

Launch Unity Hub and add Unity Template 0.25 to the list. Then open the Unity Template 0.25 that you added.

Set the path to Lumin SDK 0.25 in External Tools.
Set up the development certificate.

Add MagicLeap/WebRTC/Scenes/WebRTC.scene and run Build And Run.

WebRTC screen installed on Magic Leap 1.

Start the signaling server.

Double-click Assets/MagicLeap/WebRTC/ExampleSetip/Server/server.py to start it.

The signaling server has been started.

ML WebRTC Test : Browser Client connects to Signaling Server

Open Assets/MagicLeap/WebRTC/ExampleSetip/Browser/index.html in your browser。

ML WebRTC Test: Enter the IP address of the signaling server (the PC you set up) in the Host field of the Browser Client, and then click the Connect button.

If the connection is successful, the camera image on the PC will be displayed. If the camera and microphone are not connected to the PC, a NotFoundError will be raised.

Connect to the signaling server from Magic Leap 1

Press the Trigger while selecting the Connect to server button.

After entering the IP address of the signaling server (the PC you set up), select Enter at the end and press Trigger.

WebRTC between Magic Leap 1 and a browser

On the left is the streaming video from the browser’s webcam, and on the right is the streaming video from the Magic Leap 1’s camera.

You can also send text information to each other.

This is a video demonstration of WebRTC.

When streaming video including MR content, you need to change the Video Source to MLMRCamera and connect to the server.

Reference

https://developer.magicleap.com/en-us/learn/guides/unity-webrtc-guide

--

--