• Skip to Search
  • Skip to Content
  • Skip to Side Navigation
Getting StartedSDK ReferenceGlossary
  • Home
  • Getting Started
  • SDK Reference
  • Portal
  • How-To
  • Troubleshooting
  • FAQs
  • Reference
  • Glossary
REST API
Web SDK
Android SDK
iOS SDK
Unity SDK
React Native SDK
EdgeAuth SDK
  • Overview
  • Quick Start
  • Usage

Quick Start

Step 1. Import Plugin

Open the Unity application and import the plugin as shown below.

import plugin

Step 2. Set Up Plugin

To set up the plugin and join a channel, create a C# script and call it VideoView.cs.

create script

Open the VideoView.cs script and paste the following code:

C#
1using PhenixRTS;
2using UnityEngine;
3
4public class VideoView : MonoBehaviour {
5 private Renderer rend;
6 private Phenix.JoinEvent callback;
7 private string uuid1 = "";
8
9 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);
16
17 JoinChannelOptions joinChannelOptions1 = new JoinChannelOptions.JoinChannelOptionsBuilder()
18 .WithRoomAlias("mobileChannel1")
19 .Build();
20
21 uuid1 = Phenix.JoinChannel(joinChannelOptions1);
22
23 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.

attach script

In the pop-up panel, select Scripts. Find and select the VideoView script that you created in the previous step.

find script

select script
Page Content
    Copyright 2023 © Phenix RTS
    Privacy Policy | Terms of Service
    v2023-01-31T21:25:10