void playToManager_SourceSelected(PlayToManager sender, PlayToSourceSelectedEventArgs args) { var handler = _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { SetControlerState(false, true); }); }
private void StartPlayToManager() { lock (_syncLock) { if (_manager != null) { return; } try { _manager = new PlayToManager( _logger, _sessionManager, _libraryManager, _userManager, _dlnaManager, _appHost, _imageProcessor, _deviceDiscovery, _httpClientFactory, _userDataManager, _localization, _mediaSourceManager, _mediaEncoder); _manager.Start(); } catch (Exception ex) { _logger.LogError(ex, "Error starting PlayTo manager"); } } }
private void StartPlayToManager() { lock (_syncLock) { try { _manager = new PlayToManager(_logger, _config, _sessionManager, _httpClient, _itemRepo, _libraryManager, _userManager, _dlnaManager, _appHost, _dtoService, _imageProcessor, _ssdpHandler); _manager.Start(); } catch (Exception ex) { _logger.ErrorException("Error starting PlayTo manager", ex); } } }
private void StartPlayToManager() { lock (_syncLock) { try { _manager = new PlayToManager(_logger, _sessionManager, _libraryManager, _userManager, _dlnaManager, _appHost, _imageProcessor, _deviceDiscovery, _httpClient, _config, _userDataManager, _localization, _mediaSourceManager); _manager.Start(); } catch (Exception ex) { _logger.ErrorException("Error starting PlayTo manager", ex); } } }
private void OnSourceRequsted(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); Execute.OnUIThread(async() => { if (CurrentFile != null) { var source = await CreateSourceAsync(); if (source == null) { args.SourceRequest.DisplayErrorString(Strings.PlayToInvalidMediaType); } else { args.SourceRequest.SetSource(source); CurrentConnection = source.Connection; } } else { args.SourceRequest.DisplayErrorString(Strings.PlayToNoFile); } deferral.Complete(); }); }
protected override void OnNavigatedFrom(NavigationEventArgs e) { var playToManager = PlayToManager.GetForCurrentView(); playToManager.SourceRequested -= OnPlayToSourceRequested; //playToManager.SourceSelected -= OnPlayToSourceSelected; }
//private void SpinAndWait(bool bNewVal) //{ // this.gBody.Visibility = bNewVal ? Windows.UI.Xaml.Visibility.Collapsed : Windows.UI.Xaml.Visibility.Visible; // this.gProgress.Visibility = bNewVal ? Windows.UI.Xaml.Visibility.Visible : Windows.UI.Xaml.Visibility.Collapsed; // this.prProgress.IsActive = bNewVal; //} protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); DataTransferManager.GetForCurrentView().DataRequested += FilmDetails_DataRequested; this.AllowSearch(false); PlayToManager.GetForCurrentView().SourceRequested += PlayToManagerOnSourceRequested; if (!bLoaded) { SelectedFilm = e.Parameter as FilmInfo; //App.Films[iFilm]; this.piPoster.Source = new BitmapImage(SelectedFilm.PosterImage); if (!Config.ShowCleanBackground) { if (SelectedFilm.BackdropUrl != null) { this.LayoutRoot.Background = new ImageBrush() { ImageSource = new BitmapImage(SelectedFilm.BackdropUrl), Opacity = 0.2, Stretch = Stretch.UniformToFill }; } else { string uri = (SelectedFilm.PosterImage.AbsoluteUri); if (uri.Contains("w500")) { uri = uri.Replace("w500", "original"); this.gBody.Background = new ImageBrush() { ImageSource = new BitmapImage(new Uri(uri)), Opacity = 0.2, Stretch = Stretch.UniformToFill }; } } } try { await LoadFilmDetails(); this.dtHideAppBar.Interval = TimeSpan.FromSeconds(10); this.dtHideAppBar.Tick += dtHideAppBar_Tick; this.filmDetailsAppBar.IsOpen = true; this.dtHideAppBar.Start(); } catch { } bLoaded = true; } }
public PlayToPage() { this.InitializeComponent(); ptm = PlayToManager.GetForCurrentView(); ptm.SourceRequested += SourceRequested; this.Loaded += PlayToPage_Loaded; }
protected override void OnNavigatedFrom(NavigationEventArgs e) { DataTransferManager.GetForCurrentView().DataRequested -= FilmDetails_DataRequested; PlayToManager.GetForCurrentView().SourceRequested -= PlayToManagerOnSourceRequested; base.OnNavigatedFrom(e); }
private void playToManager_SourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); var handler = dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { args.SourceRequest.SetSource(ImageSource.PlayToSource); deferral.Complete(); }); }
private void OnSourceSelected(PlayToManager sender, PlayToSourceSelectedEventArgs args) { Execute.OnUIThread(() => { SourceName = args.FriendlyName; SourceIcon = new BitmapImage(); SourceIcon.SetSource(args.Icon); }); }
public PlayToPage() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += this.NavigationHelper_LoadState; this.navigationHelper.SaveState += this.NavigationHelper_SaveState; ptm = PlayToManager.GetForCurrentView(); }
private void InitPlayToManager() { dispatcher = Window.Current.CoreWindow.Dispatcher; if (playtoManager == null) { playtoManager = PlayToManager.GetForCurrentView(); playtoManager.SourceRequested += OnPlayToSourceRequested; playtoManager.SourceSelected += OnPlayToSourceSelected; } }
private async void PlayToManagerOnSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { args.SourceRequest.SetSource(this.mpTrailer.PlayToSource); deferral.Complete(); }); }
private async void OnPlayToSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs e) { await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { PlayToSourceDeferral deferral = e.SourceRequest.GetDeferral(); PlayToSourceRequest sr = e.SourceRequest; sr.SetSource(videoMediaElement.PlayToSource); deferral.Complete(); }); }
private async void OnSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { args.SourceRequest.SetSource(MediaDetails.PlayToSource); deferral.Complete(); }); }
protected override void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); var transferManager = DataTransferManager.GetForCurrentView(); var playToManager = PlayToManager.GetForCurrentView(); var printManager = PrintManager.GetForCurrentView(); transferManager.DataRequested -= OnDataRequested; playToManager.SourceRequested -= OnSourceRequested; printManager.PrintTaskRequested -= OnPrintRequested; }
/// <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(); }
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); }
//add cod to on navigated to function protected override void OnNavigatedTo(NavigationEventArgs e) { //add imags thatyou want to show in your slide show selecionarPalavra(); playlistTimer = new DispatcherTimer(); //Set the Time span jis me Images chnge hngay like yha 3 Sec bd Image chng hga playlistTimer.Interval = new TimeSpan(0, 0, 3); playlistTimer.Tick += playlistTimer_Tick; playToManager = PlayToManager.GetForCurrentView(); playToManager.SourceRequested += playToManager_SourceRequested; //right click to bitmapimage and reslove ImageSource.Source = new BitmapImage(new Uri("ms-appx:///UserControl/" + Images[count])); }
protected override async void OnInitialize() { base.OnInitialize(); #if DEBUG var settings = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///resources/store/simulator.xml")); await CurrentApp.ReloadSimulatorAsync(settings); #endif playToManager = PlayToManager.GetForCurrentView(); playToManager.SourceRequested += OnSourceRequsted; playToManager.SourceSelected += OnSourceSelected; eventAggregator.Subscribe(this); }
private void DisposePlayToManager() { lock (_syncLock) { if (_manager != null) { try { _manager.Dispose(); } catch (Exception ex) { _logger.ErrorException("Error disposing PlayTo manager", ex); } _manager = null; } } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); currentResult = (SearchResult)e.Parameter; DataContext = currentResult; BodyWebView.NavigateToString(currentResult.BodyDocument); var transferManager = DataTransferManager.GetForCurrentView(); var playToManager = PlayToManager.GetForCurrentView(); var printManager = PrintManager.GetForCurrentView(); transferManager.DataRequested += OnDataRequested; playToManager.SourceRequested += OnSourceRequested; printManager.PrintTaskRequested += OnPrintRequested; }
private void DisposePlayToManager() { lock (_syncLock) { if (_manager != null) { try { _logger.LogInformation("Disposing PlayToManager"); _manager.Dispose(); } catch (Exception ex) { _logger.LogError(ex, "Error disposing PlayTo manager"); } _manager = null; } } }
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 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); } }
private void OnPlayToSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { //args.SourceRequest.DisplayErrorString("Test error string"); var deferral = args.SourceRequest.GetDeferral(); // This request will come in on a non-UI thread, so it will need to be marshalled over. // Since doing that is an an async operation, a deferral will be required. Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { _currentPlayToImage = (Image)SelectedImageContainer.Content; if (_currentPlayToImage == null) { args.SourceRequest.DisplayErrorString("There is no image selected to be streamed."); } else { args.SourceRequest.SetSource(_currentPlayToImage.PlayToSource); } deferral.Complete(); }); }
private void OnPlayToSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { // This request will come in on a non-UI thread, // so it will need to be marshalled over. // Since doing that is an async operation, // a deferral will be required. var deferral = args.SourceRequest.GetDeferral(); Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (MediaElement.PlayToSource == null) { var errorMessage = "There is no video selected to be streamed."; args.SourceRequest.DisplayErrorString(errorMessage); } else { args.SourceRequest.SetSource(MediaElement.PlayToSource); } deferral.Complete(); }); }
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(); }
public void ShowPlayToUI() { PlayToManager.ShowPlayToUI(); }