Inheritance: IPlayToManager
        public PlayToPage()
        {
            this.InitializeComponent();
            ptm = PlayToManager.GetForCurrentView();
            ptm.SourceRequested += SourceRequested;

            this.Loaded += PlayToPage_Loaded;
        }
 void playToManager_SourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args)
 {
     var deferral = args.SourceRequest.GetDeferral();
     var handler = dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
         {
             args.SourceRequest.SetSource(VideoSource.PlayToSource);
             deferral.Complete();
         });
 }
 async private void SourceRequested(Windows.Media.PlayTo.PlayToManager sender, Windows.Media.PlayTo.PlayToSourceRequestedEventArgs e)
 {
     var deferral = e.SourceRequest.GetDeferral();
     await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         e.SourceRequest.SetSource(player.PlayToSource);
         deferral.Complete();
     });
 }
Example #4
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            dispatcher = Window.Current.CoreWindow.Dispatcher;

            playlistTimer = new DispatcherTimer();
            playlistTimer.Interval = new TimeSpan(0, 0, 10);
            playlistTimer.Tick += playlistTimer_Tick;

            playToManager = PlayToManager.GetForCurrentView();
            playToManager.SourceRequested += playToManager_SourceRequested;
            playListPlayNext();
        }
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            _searchPane = SearchPane.GetForCurrentView();
            _searchPane.QuerySubmitted += QuerySubmitted;
            _searchPane.SuggestionsRequested += SuggestionsRequested;

            _dataTransfer = DataTransferManager.GetForCurrentView();
            _dataTransfer.DataRequested += DataRequested;

            _playToManager = PlayToManager.GetForCurrentView();
            _playToManager.SourceRequested += SourceRequested;

            _settingsPane = SettingsPane.GetForCurrentView();
            _settingsPane.CommandsRequested += CommandsRequested;
        }
Example #6
0
        public PlayPage()
        {
            this.InitializeComponent();

            _dispatcher = Window.Current.CoreWindow.Dispatcher;
            _playToManager = PlayToManager.GetForCurrentView();
            _displayRequest = new DisplayRequest();
            _coreCursor = Window.Current.CoreWindow.PointerCursor;
            _timerOfDAC = ThreadPoolTimer.CreatePeriodicTimer(_timerOfDAC_Tick, TimeSpan.FromSeconds(1));

            _timer = new DispatcherTimer();
            _timer.Tick += _timer_Tick;
            _timer.Interval = TimeSpan.FromSeconds(1);

            _timerOfControler = new DispatcherTimer();
            _timerOfControler.Tick += _timerOfControler_Tick;
            _timerOfControler.Interval = TimeSpan.FromSeconds(3);

            xMediaPlayer.BufferingProgressChanged += xMediaPlayer_BufferingProgressChanged;
            xMediaPlayer.CurrentStateChanged += xMediaPlayer_CurrentStateChanged;
            xMediaPlayer.MediaEnded += xMediaPlayer_MediaEnded;
            xMediaPlayer.MediaFailed += xMediaPlayer_MediaFailed;
            xMediaPlayer.MediaOpened += xMediaPlayer_MediaOpened;

            xPlayerControler.Seeking += xPlayerControler_Seeking;
            xPlayerControler.Seeked += xPlayerControler_Seeked;
            xPlayerControler.VolumeChanged += xPlayerControler_VolumeChanged;
            xPlayerControler.MediaElementStatusChanged += xPlayerControler_MediaElementStatusChanged;
            xPlayerControler.NextProgramSelected += xPlayerControler_NextProgramSelected;
            xPlayerControler.PreviousProgramSelected += xPlayerControler_PreviousProgramSelected;
            xPlayerControler.BitrateChanged += xPlayerControler_BitrateChanged;

            var volume = DataStoreUtils.GetLocalSettingValue(Utils.Constants.VolumeSettingKey);
            if (volume != null)
            {
                var value = (double)volume;
                xMediaPlayer.Volume = value;
                xPlayerControler.SetVolumeValue(value);
            }
        }
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            dispatcher = Window.Current.CoreWindow.Dispatcher;
            manager = PlayToManager.GetForCurrentView();
            manager.SourceRequested += manager_SourceRequested;

            receiver = new PlayToReceiver();
            receiver.PlayRequested += receiver_PlayRequested;
            receiver.PauseRequested += receiver_PauseRequested;
            receiver.StopRequested += receiver_StopRequested;
            receiver.MuteChangeRequested += receiver_MuteChangeRequested;
            receiver.VolumeChangeRequested += receiver_VolumeChangeRequested;
            receiver.TimeUpdateRequested += receiver_TimeUpdateRequested;
            receiver.CurrentTimeChangeRequested += receiver_CurrentTimeChangeRequested;
            receiver.SourceChangeRequested += receiver_SourceChangeRequested;
            receiver.PlaybackRateChangeRequested += receiver_PlaybackRateChangeRequested;
            receiver.SupportsAudio = true;
            receiver.SupportsVideo = true;
            receiver.SupportsImage = true;

            receiver.FriendlyName = "Day #22 - PlayTo";

            await receiver.StartAsync();
        }
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     dispatcher = Window.Current.CoreWindow.Dispatcher;
     playToManager = PlayToManager.GetForCurrentView();
     playToManager.SourceRequested += playToManager_SourceRequested;
 }
Example #9
0
 void playToManager_SourceSelected(PlayToManager sender, PlayToSourceSelectedEventArgs args)
 {
     var handler = _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         SetControlerState(false, true);
     });
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _dispatcher = Window.Current.CoreWindow.Dispatcher;
            _playToManager = PlayToManager.GetForCurrentView();
            _playToManager.SourceRequested += playToManager_SourceRequested;

            if(_displayRequest == null)
                _displayRequest = new DisplayRequest();

            _displayRequest.RequestActive();

            base.OnNavigatedTo(e);
        }
Example #11
0
 void manager_SourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args)
 {
     var deferral = args.SourceRequest.GetDeferral();
     var handler = dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         if (MusicBox.Visibility == Visibility.Visible)
         {
             args.SourceRequest.SetSource(MusicSource.PlayToSource);
         }
         else if (VideoBox.Visibility == Visibility.Visible)
         {
             args.SourceRequest.SetSource(VideoSource.PlayToSource);
         }
         else if (PhotoSource.Visibility == Visibility.Visible)
         {
             args.SourceRequest.SetSource(PhotoSource.PlayToSource);
         }
         deferral.Complete();
     });
 }
 public PlayToPage()
 {
     this.InitializeComponent();
     this.navigationHelper = new NavigationHelper(this);
     ptm = PlayToManager.GetForCurrentView();
 }
 public PlayToManagerEvents(PlayToManager This)
 {
     this.This = This;
 }
 public PlayToPage()
 {
     this.InitializeComponent();
     ptm = PlayToManager.GetForCurrentView();
 }