Exemplo n.º 1
0
    // Callback function to handle events
    public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
    {
        switch (et)
        {
        case MediaPlayerEvent.EventType.ReadyToPlay:
            break;

        case MediaPlayerEvent.EventType.Started:
            break;

        case MediaPlayerEvent.EventType.FirstFrameReady:
            break;

        case MediaPlayerEvent.EventType.MetaDataReady:
            //GatherProperties();
            break;

        case MediaPlayerEvent.EventType.FinishedPlaying:

            Debug.Log("Video is finished");

            GameObject canvas = GameObject.Find(AppManager.nameOfMainCanvas);
            _appManager = canvas.GetComponent <AppManager> ();

            _appManager.currentPanelIndex = 0;
            _appManager.BasicOpenNextPanel();
            videoDisplay.gameObject.SetActive(false);
            _appManager.currentState = AppManager.UIState.UIStateMain;

            _appManager.waitTimestamp = Time.time + _appManager.restartWaitTime;             // reset timeout

            break;
        }

        //AddEvent(et);
    }