using System.Collections; using System.Collections.Generic; using UnityEngine; public class VideoPlayBtn : MonoBehaviour { public GameObject Icon; public bool m_IsPlaying; public AVProVideoPlayer m_Video; public string spid = null; public string videoid = null; private void Start() { if (m_Video == null) m_Video = GetComponent(); } public void PlayVideo() { if (m_Video == null) m_Video = GetComponent(); TemplateVideo.temQueue = new Queue(); TemplateVideo.isPlaying = false; GameManager.Instance.avplayer = null; Debug.Log("m_IsPlaying: " + m_IsPlaying); if (m_Video == null) return; Debug.Log(m_Video.GetUrl()); if (!m_IsPlaying) { // FengMian.gameObject.SetActive(false); m_Video.Play(); Icon.SetActive(false); } else { m_Video.Pause(); Icon.SetActive(true); } m_IsPlaying = !m_IsPlaying; if (spid != null&& m_Video!=null&& !UserInfo.Instance.is20) MQTTClient.Instance.sendActiveVideo(spid, videoid, m_IsPlaying, -1); } public void PlayVideoAuto() { if (m_Video == null) m_Video = GetComponent(); TemplateVideo.isPlayLock = true; Debug.Log("m_IsPlaying: " + m_IsPlaying); if (m_Video == null) return; Debug.Log(m_Video.GetUrl()); if (!m_IsPlaying) { // FengMian.gameObject.SetActive(false); m_Video.Play(); Icon.SetActive(false); } else { m_Video.Pause(); Icon.SetActive(true); } m_IsPlaying = !m_IsPlaying; if (spid != null && m_Video != null && !UserInfo.Instance.is20) MQTTClient.Instance.sendActiveVideo(spid, videoid, m_IsPlaying, -1); } }