Esempio n. 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                NavigationHelper.OnNavigatedTo(this);

                SubscribeModelEvents();
                _sensor.OrientationChanged += Sensor_OrientationChanged;

                if (VideoPageViewHelper.IsLandscapeOrientation(Orientation))
                {
                    SetVisibilityControls(Visibility.Collapsed);
                }
                else
                {
                    SetVisibilityControls(Visibility.Visible);
                }

                var viewModel = DataContext as PlaylistVideoPageViewModel;
                if (viewModel == null)
                {
                    return;
                }

                if (viewModel.NavigationPanelViewModel == null)
                {
                    return;
                }

                var binding = new Binding {
                    Source = viewModel, Path = new PropertyPath("VideoViewModel.VideoUri")
                };
                player.SetBinding(LiteTubePlayer.SourceProperty, binding);

                if (e.NavigationMode == NavigationMode.Back && viewModel.VideoViewModel.IsLive)
                {
                    player = null;
                    RestorePlayer();
                    player?.Load();
                }

                if (!viewModel.NavigationPanelViewModel.IsAuthorized)
                {
                    return;
                }

                if (_currentApplicationBar.Buttons.Contains(_favoritesApplicationBarButton))
                {
                    return;
                }
                _currentApplicationBar.Buttons.Add(_favoritesApplicationBarButton);
            }
            catch (Exception)
            {
                ;
            }
        }
Esempio n. 2
0
        private void CopyVideoUrl_Click(object sender, EventArgs eventArgs)
        {
            var viewModel = DataContext as PlaylistVideoPageViewModel;

            if (viewModel == null)
            {
                return;
            }

            VideoPageViewHelper.CopyVideoUrl(viewModel.VideoViewModel);
        }
Esempio n. 3
0
        private void AddToFavorites_Click(object sender, EventArgs e)
        {
            var viewModel = DataContext as PlaylistVideoPageViewModel;

            if (viewModel == null)
            {
                return;
            }

            VideoPageViewHelper.AddToFavorites(viewModel.VideoViewModel);
        }
Esempio n. 4
0
        private void Send_Click(object sender, EventArgs e)
        {
            var viewModel = DataContext as PlaylistVideoPageViewModel;

            if (viewModel == null)
            {
                return;
            }

            VideoPageViewHelper.SendComment(viewModel.VideoViewModel);
        }
Esempio n. 5
0
        private void ChangeOrientation(PageOrientation orientation)
        {
            if (VideoPageViewHelper.IsLandscapeOrientation(orientation))
            {
                SetPlayerFullScreenState();
                SetVisibilityControls(Visibility.Collapsed);
                return;
            }

            SetPlayerNormalState();
            SetVisibilityControls(Visibility.Visible);
        }
Esempio n. 6
0
 private void CopyVideoUrl_Click(object sender, EventArgs eventArgs)
 {
     VideoPageViewHelper.CopyVideoUrl(DataContext as VideoPageViewModel);
 }
Esempio n. 7
0
 private void AddToPlaylist_Click(object sender, EventArgs e)
 {
     VideoPageViewHelper.AddToPlaylist(DataContext as VideoPageViewModel);
 }
Esempio n. 8
0
 private void AddToFavorites_Click(object sender, EventArgs e)
 {
     VideoPageViewHelper.AddToFavorites(DataContext as VideoPageViewModel);
 }
Esempio n. 9
0
 private void Send_Click(object sender, EventArgs e)
 {
     VideoPageViewHelper.SendComment(DataContext as VideoPageViewModel);
 }
Esempio n. 10
0
 private void PlayerIsFullScreenChanged(object sender, RoutedPropertyChangedEventArgs <bool> e)
 {
     _isFullScreen = player.IsFullScreen;
     VideoPageViewHelper.PlayerIsFullScreenChanged(this, player);
 }
Esempio n. 11
0
 private void Sensor_OrientationChanged(SimpleOrientationSensor sender, SimpleOrientationSensorOrientationChangedEventArgs args)
 {
     VideoPageViewHelper.SensorOrientationChanged(this, args);
 }