internal PlayListDocumentIcon(Document doc) { InitializeComponent(); Document = doc; // Depending on document type this control will be used and displayed slightly differently switch (doc.Type) { case DocumentType.PlayList: PlaylistButton.Visibility = Visibility.Visible; CreatePlaylistButton.Visibility = Visibility.Collapsed; break; case DocumentType.Sound: // Display image of sound files break; case DocumentType.Video: // Same VideoIcon image but instead of V we have video name text; Or better we have some screenshots about that video, e.g.created by user during watching the movie, though I don't believe screenshot can help make VW very clean-looking break; } MediaControls.Setup(VirtualWorkspaceWindow.CurrentWindow.GetVlcPlayerHandler(), doc); // Manual Binding Document.PropertyChanged += Document_PropertyChanged; Document_PropertyChanged(null, null); MediaControls.PropertyChanged += MediaControls_PropertyChanged; PlayingDocument = MediaControls.PlayingDocument; NotifyPropertyChanged("DisplayName"); NotifyPropertyChanged("DisplayText"); }
public void Next() { if (MediaControls.Next != null) { MediaControls.Next.Invoke(); } else { MediaControls.SeekForward(); } }
public EntertainmentThemePage() { this.InitializeComponent(); MediaControls.SetBehavior(ReplayButton, player.CreateMediaControlBehavior <ReplayButtonBehavior>()); MediaControls.SetBehavior(CaptionSelectionButton, player.CreateMediaControlBehavior <CaptionSelectionButtonBehavior>()); MediaControls.SetBehavior(AudioSelectionButton, player.CreateMediaControlBehavior <AudioSelectionButtonBehavior>()); // register the control panel so it participates in view state changes player.Initialized += player_Initialized; }
public RecordingPage() { this.InitializeComponent(); _timer = new DispatcherTimer(); _clock = new DispatcherTimer(); _timer.Interval = new TimeSpan(0, 0, 5); _timer.Tick += UpdateRealTimeDataAsync; _clock.Tick += UpdateClock; _mediaControls = new MediaControls(); _status = RecordingStatus.NotStarted; _session = new Session(); FaceData = new ObservableCollection <AudienceFrame>(); InitializeGraphs(); }
public EntertainmentAppPage() { this.InitializeComponent(); MediaControls.SetBehavior(ReplayButton, player.CreateMediaControlBehavior <ReplayButtonBehavior>()); MediaControls.SetBehavior(CaptionSelectionButton, player.CreateMediaControlBehavior <CaptionSelectionButtonBehavior>()); MediaControls.SetBehavior(AudioSelectionButton, player.CreateMediaControlBehavior <AudioSelectionButtonBehavior>()); ReplayButton.Loaded += StartLayoutUpdates; ReplayButton.Unloaded += StopLayoutUpdates; CaptionSelectionButton.Loaded += StartLayoutUpdates; CaptionSelectionButton.Unloaded += StopLayoutUpdates; AudioSelectionButton.Loaded += StartLayoutUpdates; AudioSelectionButton.Unloaded += StopLayoutUpdates; // register the control panel so it participates in view state changes player.Initialized += player_Initialized; }
internal void Update(MULTITUDE.Class.DocumentTypes.Document target) { // Switch interface elements depending on document type switch (target.Type) { case Class.DocumentTypes.DocumentType.PlayList: UpdateInterfaceVisibility((target as Playlist).GetCurrentMedia().Type); break; case Class.DocumentTypes.DocumentType.Sound: case Class.DocumentTypes.DocumentType.Video: UpdateInterfaceVisibility(target.Type); break; default: throw new InvalidOperationException("Unsupported document type in Media Player."); } // Setup playback MediaControls.Setup(vlcPlayer, target, true); }
/// <summary> /// This is kind of a hack to work around the issue in Silverlight where you don't know when /// all the controls have been loaded in a page (so you can *then* make a call to the server). /// All the XAML pages are parsed when the application is loaded to extract the expanz controls, /// and here we'll register them *before* they are actually loaded so that requests can be made /// to the server, and then these entries will be updated with the actual control references /// when the controls are actually loaded. /// </summary> internal void RegisterUnloadedControls(List <ExpanzControlDetails> expanzControls) { var controlsToRegister = expanzControls.Where(x => x.IsDataControl); foreach (ExpanzControlDetails controlDetails in controlsToRegister) { if (controlDetails.DataId != null && !DataControls.ContainsKey(controlDetails.DataId)) { DataControls.Add(controlDetails.DataId, controlDetails); // Add temporary dummy entry } } controlsToRegister = expanzControls.Where(x => x.IsMediaControl); foreach (ExpanzControlDetails controlDetails in controlsToRegister) { if (controlDetails.DataId != null && !DataControls.ContainsKey(controlDetails.DataId)) { MediaControls.Add(controlDetails.DataId, controlDetails); // Add temporary dummy entry } } }
private void ShowLoadingIndicator() { MediaElement.Stop(); MediaElement.Source = null; MediaElement.Visibility = Visibility.Collapsed; ImageElement.Visibility = Visibility.Collapsed; MediaControls.Visibility = Visibility.Collapsed; MediaControls.SetControlVisibilities(Visibility.Collapsed); ViewModel.ErrorMessage = null; LoadingIndicator.Visibility = Visibility.Collapsed; var uri = ((MediaViewerBlockViewModel)DataContext).Uri; if (Services.ImageViewerService.IsMp4(uri?.ToString())) { MediaElement.Source = uri; LoadingIndicator.Visibility = Visibility.Visible; } else { ImageElement.Visibility = Visibility.Visible; MediaControls.Visibility = Visibility.Visible; } }
public AppleAudioPlayer() { MediaControls = new MediaControls(); Configuration = new PlayerConfig(); }