Example #1
0
        /// <summary>
        /// Usually end of file but could be error.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void WaveOut_PlaybackStopped(object?sender, StoppedEventArgs e)
        {
            if (e.Exception != null)
            {
                LogMessage("ERR", e.Exception.Message);
            }

            PlaybackCompleted?.Invoke(this, new EventArgs());
        }
        public PlayerService()
        {
            _player = new Multimedia.Player();

            _player.PlaybackCompleted += (s, e) =>
            {
                PlaybackCompleted?.Invoke(this, e);
                State = PlayerState.Stopped;
            };
        }
Example #3
0
 private void RegisterPlaybackCompletedCallback()
 {
     _playbackCompletedCallback = _ =>
     {
         Log.Debug(PlayerLog.Tag, "completed callback");
         PlaybackCompleted?.Invoke(this, EventArgs.Empty);
     };
     NativePlayer.SetCompletedCb(Handle, _playbackCompletedCallback).
     ThrowIfFailed(this, "Failed to set PlaybackCompleted");
 }
    // Update is called once per frame
    void Update()
    {
        if (!m_loadedVideo)
        {
            if (m_tryingToLoad)
            {
                if (Player.IsLoading())
                {
                    return;
                }
                else
                {
                    m_tryingToLoad = false;
                }
            }
            else
            {
                m_loadedVideo = !Player.IsLoading();

                if (m_loadedVideo)
                {
                    Player.Play();
                    m_waitingPlay = true;
                }
            }
        }
        else
        {
            if (m_waitingPlay && Player.IsPlaying())
            {
                m_waitingPlay       = false;
                m_startedPlay       = true;
                m_waitingSetTexture = true;
            }

            var tex = Player.GetVideoTexture();

            if (m_waitingSetTexture && tex != null && Player.GetCurrentPosition() > 0.01)
            {
                //PlayerSurface.texture = tex;
                m_waitingSetTexture = false;

                ClipLoaded.Invoke();
            }
        }

        if (m_startedPlay && !Player.IsPlaying())
        {
            m_startedPlay = false;
            m_isPlaying   = false;

            PlaybackCompleted.Invoke();
        }
    }
 public PlayerService()
 {
     _videoView           = new VideoView(Forms.Context);
     _videoView.Prepared += (s, e) =>
     {
         State = PlayerState.Prepared;
     };
     _videoView.Completion += (s, e) =>
     {
         PlaybackCompleted?.Invoke(this, e);
         State = PlayerState.Stopped;
     };
 }
 /// <summary>
 /// Handles playback completion event from internal player (TizenFX API).
 /// Updates playback state and invokes own (class) playback completion event.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="eventArgs">Event arguments.</param>
 private void PlayerOnPlaybackCompleted(object sender, EventArgs eventArgs)
 {
     CheckPlayStateChange();
     PlaybackCompleted?.Invoke(this, new EventArgs());
 }
Example #7
0
 void SendPlaybackCompleted(object sender, EventArgs e)
 {
     PlaybackCompleted?.Invoke(this, EventArgs.Empty);
 }