Example #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("videoThumb");

            if (imageAnimation != null)
            {
                imageAnimation.TryStart(MediaElementContainer);
            }

            Constants.MainPageRef.contentFrame.Navigated += ContentFrame_Navigated;
            SystemNavigationManager.GetForCurrentView().BackRequested += VideoPage_BackRequested;
            Constants.MainPageRef.Frame.Navigated += Frame_Navigated;

            //Set the focus to the video viewer
            viewer.Focus(FocusState.Programmatic);

            //Get the video data and play it
            StartVideo(Constants.activeVideoID);

            //Update likes/dislikes
            LikeDislikeControl.UpdateData();

            //Update comments
            if (CommentsOptionComboBox.SelectedIndex == 0)
            {
                UpdateComments(CommentThreadsResource.ListRequest.OrderEnum.Relevance);
            }
            else
            {
                UpdateComments(CommentThreadsResource.ListRequest.OrderEnum.Time);
            }
        }
Example #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("videoThumb");

            if (imageAnimation != null)
            {
                imageAnimation.TryStart(MediaElementContainer);
            }

            Constants.MainPageRef.contentFrame.Navigated += ContentFrame_Navigated;
            SystemNavigationManager.GetForCurrentView().BackRequested += VideoPage_BackRequested;

            //Get the video data and play it
            StartVideo(Constants.activeVideoID);

            //Update likes/dislikes
            LikeDislikeControl.UpdateData();
        }
Example #3
0
        private async void VideoPlayer_MediaEnded(MediaPlayer sender, object args)
        {
            Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            try
            {
                if ((bool)localSettings.Values["Autoplay"])
                {
                    Constants.activeVideoID = ((YoutubeItemDataType)RelatedVideosGridView.Items[0]).Id;

                    //Reload the page
                    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
                        //Get the video data and play it
                        StartVideo(Constants.activeVideoID);

                        //Update likes/dislikes
                        LikeDislikeControl.UpdateData();
                    });
                }
            }
            catch { }
        }