using System; using System.IO; using System.Collections.Generic; using Agora.Rtc; using Agora.Util; using UnityEngine; using UnityEngine.Serialization; using UnityEngine.UI; using Logger = Agora.Util.Logger; namespace Agora_RTC_Plugin.API_Example.Examples.Advanced.StartLocalVideoTranscoder { public class StartLocalVideoTranscoder : MonoBehaviour { [FormerlySerializedAs("appIdInput")] [SerializeField] private AppIdInput _appIdInput; [Header("_____________Basic Configuration_____________")] [FormerlySerializedAs("APP_ID")] [SerializeField] private string _appID = ""; [FormerlySerializedAs("TOKEN")] [SerializeField] private string _token = ""; [FormerlySerializedAs("CHANNEL_NAME")] [SerializeField] private string _channelName = ""; public Text LogText; internal Logger Log; internal IRtcEngine RtcEngine = null; internal IMediaPlayer MediaPlayer = null; internal List RemoteUserUids = new List(); public Toggle ToggleRecord; public Toggle TogglePrimartCamera; public Toggle ToggleSecondaryCamera; public Toggle TogglePng; public Toggle ToggleJpg; public Toggle ToggleGif; public Toggle ToggleRemote; public Toggle ToggleScreenShare; public Toggle ToggleMediaPlay; private void Start() { LoadAssetData(); if (CheckAppId()) { SetUpUI(); InitEngine(); InitMediaPlayer(); JoinChannel(); } } // Update is called once per frame private void Update() { PermissionHelper.RequestMicrophontPermission(); PermissionHelper.RequestCameraPermission(); } //Show data in AgoraBasicProfile [ContextMenu("ShowAgoraBasicProfileData")] private void LoadAssetData() { if (_appIdInput == null) return; _appID = _appIdInput.appID; _token = _appIdInput.token; _channelName = _appIdInput.channelName; } private void SetUpUI() { var ui = this.transform.Find("UI"); var btn = ui.Find("StartButton").GetComponent