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(); } }
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 OnDestroy() { // Deinit the video mVideoPlayer.Deinit(); }