コード例 #1
0
        public void PlayFileFromPlayList(PlaylistModel plm)
        {
            InitPlayerView();
            MediaControlExtension.SetFileexpVisiblity(VideoElement.PlayListView as UIElement,
                                                      Visibility.Visible);

            MediaControllerVM.Current.Playlist.PlayFromAList(plm);
            (IShell as Window).WindowState = WindowState.Minimized;
        }
コード例 #2
0
        //public Style StyleChanger
        //{
        //    get { return stylechanger; }
        //    private set
        //    {
        //        stylechanger = value;
        //        this.RaisePropertyChanged(() => this.StyleChanger);
        //    }
        //}
        //public void SetStyleOnWindowState(WindowState state)
        //{
        //    if (state == WindowState.Normal)
        //    {
        //        StyleChanger = (Style)Application.Current.Resources["maxbtn"];
        //        MaxbtnTooltip = "Maximize";
        //    }
        //    else
        //    {
        //        StyleChanger = (Style)Application.Current.Resources["normbtn"];
        //        MaxbtnTooltip = "Restore Down";
        //    }
        //}

        internal void Loaded()
        {
            IVideoElement.PlayListView.OnPlaylistClose       += Plv_OnPlaylistClose;
            IVideoElement.IVideoPlayer.ScreenSettingsChanged += IVideoPlayer_ScreenSettingsChanged;
            MediaControlExtension.SetFileexpVisiblity(IVideoElement.PlayListView as UIElement, System.Windows.Visibility.Collapsed);
            // FocusManager.SetFocusedElement(IVideoElement as DependencyObject,Mouse.Captured);

            SystemEvents.PowerModeChanged += this.SystemEvents_PowerModeChanged;
        }
コード例 #3
0
        public void AddFiletoPlayList(object obj)
        {
            InitPlayerView();
            MediaControlExtension.SetFileexpVisiblity(VideoElement.PlayListView as UIElement,
                                                      Visibility.Visible);

            VideoFolderChild vfc = (VideoFolderChild)obj;

            MediaControllerVM.Current.Playlist.Add(vfc);
        }
コード例 #4
0
 void Plv_OnPlaylistClose(object sender, EventArgs e)
 {
     if (MediaControlExtension.GetFileexpVisiblity(IVideoElement.PlayListView as UIElement) == System.Windows.Visibility.Visible)
     {
         MediaControlExtension.SetFileexpVisiblity(IVideoElement.PlayListView as UIElement, System.Windows.Visibility.Collapsed);
     }
     else
     {
         MediaControlExtension.SetFileexpVisiblity(IVideoElement.PlayListView as UIElement, System.Windows.Visibility.Visible);
     }
 }
コード例 #5
0
        public void VisibilityAnimation()
        {
            MediaControlExtension.SetIsMouseOverMediaElement(IMediaController.MediaController as UIElement, null);
            (IVideoElement as Window).Cursor = Cursors.Arrow;
            if (Isloaded && ScreenSetting == SCREENSETTINGS.Normal && !IsFullScreenMode)
            {
                //MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, true);
            }

            this.MousemoveTimer.Start();
        }
コード例 #6
0
 private void WindowsTab_MouseLeave(object sender, MouseEventArgs e)
 {
     MediaControlExtension.SetIsMouseOverMediaElement(ISubtitleMediaController.MediaController as UIElement, true);
     if (!IsFullScreenMode)
     {
         MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, true);
     }
     else
     {
         MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, false);
     }
     this.MousemoveTimer.Start();
 }
コード例 #7
0
 public void NormalScreenSettings()
 {
     // if (screensetting == SCREENSETTINGS.Normal) return;
     MediaControlExtension.SetCanAnimateControl(ISubtitleMediaController.MediaController, false);
     MediaControllerVM.CanAnimate = false;
     // IVideoPlayer.CanvasEnvironment.Children.Remove(IVideoPlayer.MediaController);
     //IVideoPlayer.MediaController.Margin = new Thickness(0,0,0,0);
     // VideoPlayerView.ControlHolder.Children.Add(IVideoPlayer.MediaController);
     ResetVisibilityAnimation();
     // VideoPlayerView.SubviewBox.Margin = new Thickness(3, 0, 3, 37);
     screensetting         = SCREENSETTINGS.Normal;
     MinimizeMediaCtrlText = "Minimize MediaControl";
 }
コード例 #8
0
 private void ResetVisibilityAnimation()
 {
     //if((IVideoElement as Window).Dispatcher.)//if () return;
     this.MousemoveTimer.Stop();
     MediaControlExtension.SetIsMouseOverMediaElement(IMediaController.MediaController as UIElement, null);
     (IVideoElement as Window).Cursor = Cursors.Arrow;
     if (Isloaded && ScreenSetting == SCREENSETTINGS.Normal && !IsFullScreenMode)
     {
         // IVideoElement.WindowsTab.Visibility = Visibility.Visible;
         //MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, true);
     }
     //else { MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, false); }
 }
コード例 #9
0
 public void NormalScreenSettings()
 {
     MediaControlExtension.SetCanAnimateControl((IMediaController.MediaController as UserControl), false);
     MediaControllerViewModel.CanAnimate = false;
     screensetting         = SCREENSETTINGS.Normal;
     MinimizeMediaCtrlText = "Minimize MediaControl";
     if (IVideoElement != null)
     {
         (IVideoElement as MetroWindow).UseNoneWindowStyle      = false;
         (IVideoElement as MetroWindow).ShowTitleBar            = true;
         (IVideoElement as MetroWindow).IgnoreTaskbarOnMaximize = false;
     }
 }
コード例 #10
0
 public void FullScreenSettings()
 {
     if (screensetting == SCREENSETTINGS.Fullscreen)
     {
         return;
     }
     // VideoPlayerView.ControlHolder.Children.Remove(IVideoPlayer.MediaController);
     MediaControllerVM.CanAnimate = true;
     //IVideoPlayer.MediaController.Margin = new Thickness(5, 32, 10, 0);
     MediaControlExtension.SetCanAnimateControl(ISubtitleMediaController.MediaController, true);
     //IVideoPlayer.CanvasEnvironment.Children.Add(IVideoPlayer.MediaController);
     // VideoPlayerView.SubviewBox.Margin = new Thickness(3, 0, 3, 88);
     screensetting         = SCREENSETTINGS.Fullscreen;
     MinimizeMediaCtrlText = "Restore MediaControl";
 }
コード例 #11
0
        internal void Loaded()
        {
            //remember to fix dis
            IVideoElement.PlayListView.OnPlaylistClose += Plv_OnPlaylistClose;
            IVideoElement.IVideoPlayerController.ScreenSettingsChanged += IVideoPlayer_ScreenSettingsChanged;
            MediaControlExtension.SetFileexpVisiblity(IVideoElement.PlayListView as UIElement,
                                                      System.Windows.Visibility.Collapsed);

            //FocusManager.SetFocusedElement(IVideoElement as DependencyObject,Mouse.Captured);

            SystemEvents.PowerModeChanged += this.SystemEvents_PowerModeChanged;
            FilePlayerManager.MediaControllerViewModel.SubtitleChanged += MediaControllerInstance_SubtitleChanged;
            MediaPlayerService.OnMediaOpened  += new EventHandler(MediaPlayer_MediaOpened);
            (IVideoElement as Window).Closing += new System.ComponentModel.CancelEventHandler(VideoElementViewModel_Closing);
        }
コード例 #12
0
 public void FullScreenSettings()
 {
     if (screensetting == SCREENSETTINGS.Fullscreen)
     {
         return;
     }
     MediaControllerViewModel.CanAnimate = true;
     MediaControlExtension.SetCanAnimateControl((IMediaController.MediaController as UserControl), true);
     screensetting         = SCREENSETTINGS.Fullscreen;
     MinimizeMediaCtrlText = "Restore MediaControl";
     if (IVideoElement != null)
     {
         (IVideoElement as MetroWindow).UseNoneWindowStyle      = true;
         (IVideoElement as MetroWindow).IgnoreTaskbarOnMaximize = true;
     }
 }
コード例 #13
0
        private void ResetVisibilityAnimation()
        {
            //(IVideoElement as Window).Dispatcher.Invoke(new Action(() =>
            //{
            if (!MediaControllerVM.IsPlaying)
            {
                return;
            }
            this.MousemoveTimer.Stop();
            MediaControlExtension.SetIsMouseOverMediaElement(ISubtitleMediaController.MediaController as UIElement, null);
            (IVideoElement as Window).Cursor = Cursors.Arrow;
            if (Isloaded && ScreenSetting == SCREENSETTINGS.Normal && !IsFullScreenMode)
            {
                // IVideoElement.WindowsTab.Visibility = Visibility.Visible;
                MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, true);
            }
            //else { MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, false); }


            //}), null);
        }
コード例 #14
0
        void MousemoveTimer_Tick(object sender, EventArgs e)
        {
            if (!MediaControllerVM.IsPlaying)
            {
                this.MousemoveTimer.Stop();
                return;
            }
            if (!MediaControllerVM.IsMouseControlOver)
            {
                (IVideoElement as Window).Cursor = Cursors.None;
                //if (!MediaControllerVM.Current.IsFullScreenMode)
                //{
                //IVideoElement.WindowsTab.Visibility = Visibility.Collapsed;
                MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, false);
                //}

                MediaControlExtension.SetIsMouseOverMediaElement(ISubtitleMediaController.MediaController as UIElement, false);
                this.MousemoveTimer.Stop();
            }
            else if (MediaControllerVM.IsMouseControlOver)
            {
                this.MousemoveTimer.Stop();
            }
            else
            {
                (IVideoElement as Window).Cursor = Cursors.None;

                if (!IsFullScreenMode)
                {
                    //IVideoElement.WindowsTab.Visibility = Visibility.Collapsed;
                    MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, false);
                }
                else
                {
                    MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, true);
                }
                this.MousemoveTimer.Stop();
            }
        }
コード例 #15
0
        void MousemoveTimer_Tick(object sender, EventArgs e)
        {
            if (MediaControllerViewModel == null)
            {
                MousemoveTimer.Stop(); return;
            }
            if (!MediaControllerViewModel.IsPlaying)
            {
                this.MousemoveTimer.Stop();
                return;
            }
            if (!MediaControllerViewModel.IsMouseControlOver)
            {
                (IVideoElement as Window).Cursor = Cursors.None;
                // MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, false);
                MediaControlExtension.SetIsMouseOverMediaElement(IMediaController.MediaController as UIElement, false);
                this.MousemoveTimer.Stop();
            }
            else if (MediaControllerViewModel.IsMouseControlOver)
            {
                this.MousemoveTimer.Stop();
            }
            else
            {
                (IVideoElement as Window).Cursor = Cursors.None;

                if (!IsFullScreenMode)
                {
                    // MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, false);
                }
                else
                {
                    //MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, true);
                }
                this.MousemoveTimer.Stop();
            }
        }
コード例 #16
0
 private void WindowsTab_MouseEnter(object sender, MouseEventArgs e)
 {
     this.MousemoveTimer.Stop();
     MediaControlExtension.SetIsMouseOverMediaElement(ISubtitleMediaController.MediaController as UIElement, null);
     MediaControlExtension.SetAnimateWindowsTab(IVideoElement.WindowsTab as UIElement, true);
 }
コード例 #17
0
 private void Mediacontrol_MouseEnter(object sender, MouseEventArgs e)
 {
     this.MousemoveTimer.Stop();
     MediaControlExtension.SetIsMouseOverMediaElement(ISubtitleMediaController.MediaController as UIElement, null);
 }