コード例 #1
0
ファイル: VideoView.cs プロジェクト: mbadrez98/InPublishing
        public void Play()
        {
            try
            {
                if (_videoView != null)
                {
                    this.Show();

                    _videoView.SeekTo(0);
                    _videoView.Start();
                    //_videoView.RequestFocus();

                    if (OnStart != null)
                    {
                        OnStart();
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("VideoView(Play)", ex.Message);
            }
        }
コード例 #2
0
ファイル: AudioView.cs プロジェクト: mbadrez98/InPublishing
 public void Stop()
 {
     try
     {
         if (_audioView != null)
         {
             _audioView.Pause();
             _audioView.SeekTo(0);
         }
     }
     catch (Exception ex)
     {
         Log.Error("AudioView(Stop)", ex.Message);
     }
 }
コード例 #3
0
        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs args)
        {
            base.OnElementPropertyChanged(sender, args);

            if (args.PropertyName == VideoPlayer.AreTransportControlsEnabledProperty.PropertyName)
            {
                SetAreTransportControlsEnabled();
            }
            else if (args.PropertyName == VideoPlayer.SourceProperty.PropertyName)
            {
                SetSource();
            }
            else if (args.PropertyName == VideoPlayer.PositionProperty.PropertyName)
            {
                if (Math.Abs(videoView.CurrentPosition - Element.Position.TotalMilliseconds) > 1000)
                {
                    videoView.SeekTo((int)Element.Position.TotalMilliseconds);
                }
            }
        }