Beispiel #1
0
    void OnApplicationPause(bool pause)
    {
        mAppPaused = pause;

        if (!mIsInited)
        {
            return;
        }

        if (pause)
        {
            // Handle pause event natively
            mVideoPlayer.OnPause();

            // Store the playback position for later
            mSeekPosition = mVideoPlayer.GetCurrentPosition();

            // Deinit the video
            mVideoPlayer.Deinit();

            // Reset initialization parameters
            mIsInited   = false;
            mIsPrepared = false;

            // Set the current state to Not Ready
            SetNotReady();
        }
    }
Beispiel #2
0
    void OnApplicationPause(bool pause)
    {
        mAppPaused = pause;

        if (!mIsInited)
        {
            return;
        }

        if (pause)
        {
            // Handle pause event natively
            mVideoPlayer.OnPause();

            // Store the playback position for later
            mSeekPosition = mVideoPlayer.GetCurrentPosition();

            // Deinit the video
            mVideoPlayer.Deinit();

            // Reset initialization parameters
            mIsInited      = false;
            mInitInProgess = false;

            // Set the current state to Not Ready
            HandleStateChange(VideoPlayerHelper.MediaState.NOT_READY);
            mCurrentState = VideoPlayerHelper.MediaState.NOT_READY;
        }
    }
    void UpdateVideoInfo()
    {
        progressSlider.maxValue = (int)mVideoPlayer.GetLength();
        progressSlider.value    = (int)mVideoPlayer.GetCurrentPosition();
        progressText.text       = "进度:" + progressSlider.value + " / " + progressSlider.maxValue;
        string msg = "缓冲百分比 ==> " + mVideoPlayer.GetCurrentBufferingPercentage();

        pushMsg(msg);
    }