public void Play()
{
if(m_bStop == true)
{
Call_Play(0);
m_bStop = false;
}
if(m_CurrentState == MEDIAPLAYER_STATE.PAUSED )
{
Call_RePlay();
}
else if( m_CurrentState == MEDIAPLAYER_STATE.READY || m_CurrentState == MEDIAPLAYER_STATE.STOPPED || m_CurrentState == MEDIAPLAYER_STATE.END)
{
Call_Play(0);
}
}
void Start() { mLoadBtn.onClick.AddListener(new UnityEngine.Events.UnityAction(() => { player.Load("EasyMovieTexture.mp4"); })); mPlayBtn.onClick.AddListener(new UnityEngine.Events.UnityAction(() => { if (player.GetCurrentState() == MediaPlayerCtrl.MEDIAPLAYER_STATE.PLAYING) { player.Stop(); mPlayBtn.GetComponentInChildren <Text>().text = "Play"; } else if (player.GetCurrentState() == MediaPlayerCtrl.MEDIAPLAYER_STATE.PAUSED) { player.Play(); mPlayBtn.GetComponentInChildren <Text>().text = "Pause"; } })); mQuitBtn.onClick.AddListener(new UnityEngine.Events.UnityAction(() => { player.UnLoad(); })); player.OnEnd += OnEnd; player.OnReady += OnReady; player.OnVideoFirstFrameReady += OnFirstFrameReady; }