Page Content
Quick Start
Step 1. Import Plugin
Open the Unity application and import the plugin as shown below.
Step 2. Set Up Plugin
To set up the plugin and join a channel, create a C# script and call it VideoView.cs
.
Open the VideoView.cs
script and paste the following code:
C#
1using PhenixRTS;2using UnityEngine;34public class VideoView : MonoBehaviour {5 private Renderer rend;6 private Phenix.JoinEvent callback;7 private string uuid1 = "";89 private void Awake ()10 {11 ChannelExpressOptions channelExpressOptions = new ChannelExpressOptions.ChannelExpressOptionsBuilder()12 .WithBackendUri("https://demo-integration.phenixrts.com/pcast")13 .Build();14 Debug.Log("channelExpressOptions: " + channelExpressOptions.ToString());15 Phenix.Init(channelExpressOptions);1617 JoinChannelOptions joinChannelOptions1 = new JoinChannelOptions.JoinChannelOptionsBuilder()18 .WithRoomAlias("mobileChannel1")19 .Build();2021 uuid1 = Phenix.JoinChannel(joinChannelOptions1);2223 rend = GetComponent<Renderer>();24 rend.material.mainTexture = Phenix.GetTexture(uuid1);25 }26}
Step 3. Attach Script to Component
Next, create or select a game object (e.g.. Cube, Sphere, Plane, Quad) on which you want to display the video. Add the object to the Scene. When the object is selected, open the Inspector panel, scroll to the bottom, and click the Add Component button.
In the pop-up panel, select Scripts. Find and select the VideoView
script that you created in the previous step.
v2023-04-25T01:16:09.000Z