Esempio n. 1
0
 private void VideoPlayer_PlayerStateChanged(object sender, Octane.Xamarin.Forms.VideoPlayer.Events.VideoPlayerStateChangedEventArgs e)
 {
     if (e.CurrentState == PlayerState.Playing)
     {
         viewModel.IsRunning = false;
     }
 }
 void VideoPlayer_PlayerStateChanged(System.Object sender, Octane.Xamarin.Forms.VideoPlayer.Events.VideoPlayerStateChangedEventArgs e)
 {
     if (e.CurrentState == Octane.Xamarin.Forms.VideoPlayer.Constants.PlayerState.Playing)
     {
         PlayBtn.IsVisible = false;
     }
     else
     {
         PlayBtn.IsVisible = true;
     }
 }
Esempio n. 3
0
        async void MyVideoPlayer_PlayerStateChanged(object sender, Octane.Xamarin.Forms.VideoPlayer.Events.VideoPlayerStateChangedEventArgs e)
        {
            if (e.CurrentState == Octane.Xamarin.Forms.VideoPlayer.Constants.PlayerState.Prepared)
            {
                MyVideoPlayer.Play();
            }

            if (e.CurrentState == Octane.Xamarin.Forms.VideoPlayer.Constants.PlayerState.Playing)
            {
                //HACK delay required for some reason. Need more time
                await System.Threading.Tasks.Task.Delay(TimeSpan.FromMilliseconds(100));

                MyVideoPlayer.Seek(StartTime);
            }
        }
Esempio n. 4
0
        //private void Current_StateChanged(object sender, StateChangedEventArgs e)
        //{
        //    var z = sender;

        //    Device.BeginInvokeOnMainThread(() =>
        //    {
        //        act.IsRunning = false;
        //        videoplayer.IsVisible = true;
        //    });

        //}

        private void videoplayer_PlayerStateChanged(object sender, Octane.Xamarin.Forms.VideoPlayer.Events.VideoPlayerStateChangedEventArgs e)
        {
            switch (e.CurrentState)
            {
            case PlayerState.Prepared:
                act.IsRunning = false;
                break;

            case PlayerState.Completed:
                // Go back to the previous page once the video completes.
                break;

            case PlayerState.Error:
                DisplayAlert("Error Playing Video", "We're sorry but something is wrong with this video.", "OK");
                break;
            }
        }