|
@@ -13,6 +13,7 @@ using UnityEngine.Networking;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.UIElements;
|
|
using UnityEngine.UIElements;
|
|
using Button = UnityEngine.UI.Button;
|
|
using Button = UnityEngine.UI.Button;
|
|
|
|
+using UnityAsync;
|
|
|
|
|
|
public class ObsPlayerPanel : MonoBehaviour
|
|
public class ObsPlayerPanel : MonoBehaviour
|
|
{
|
|
{
|
|
@@ -131,11 +132,16 @@ public class ObsPlayerPanel : MonoBehaviour
|
|
_targetName = _data.targetName;
|
|
_targetName = _data.targetName;
|
|
|
|
|
|
string playUrl = await HttpHelper._Instance.GetObsUrl(_data.deviceId, _data.channelId);
|
|
string playUrl = await HttpHelper._Instance.GetObsUrl(_data.deviceId, _data.channelId);
|
|
-
|
|
|
|
|
|
+ obsPlayer.GetComponent<DisplayUGUI>().color = Color.clear;
|
|
obsPlayer.OpenMedia(MediaPathType.AbsolutePathOrURL,playUrl, true);
|
|
obsPlayer.OpenMedia(MediaPathType.AbsolutePathOrURL,playUrl, true);
|
|
obsPlayer.Play();
|
|
obsPlayer.Play();
|
|
currentChannelId = _data.channelId;
|
|
currentChannelId = _data.channelId;
|
|
currentDeviceId = _data.deviceId;
|
|
currentDeviceId = _data.deviceId;
|
|
|
|
+ await new UnityAsync.WaitUntil(() =>
|
|
|
|
+ {
|
|
|
|
+ return obsPlayer.MediaOpened;
|
|
|
|
+ });
|
|
|
|
+ obsPlayer.GetComponent<DisplayUGUI>().color = Color.white;
|
|
}
|
|
}
|
|
|
|
|
|
private void OnDirButtonDown(ObsCtrlType type)
|
|
private void OnDirButtonDown(ObsCtrlType type)
|