void MediaElement_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { if (MarkerReached != null) { MarkerReached(this, new Microsoft.PlayerFramework.TimelineMarkerRoutedEventArgs { Marker = e.Marker }); } }
void MediaElement_MarkerReached(object sender, System.Windows.Media.TimelineMarkerRoutedEventArgs e) { if (MarkerReached != null) { MarkerReached(this, new TimelineMarkerRoutedEventArgs() { Marker = e.Marker }); } }
// MarkerReachedのキック時 // movie1到達で一時停止,movie2到達で再生 private void movie_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { //if (!MediaData.IsSlowPlay) //{ if (e.Marker.Text != "disabled") { foreach (var value in MediaData.movieList) { if (value.currentPlayer.movie != movie) { if (value.currentPlayer.movie.CurrentState == MediaElementState.Playing) { PauseMedia(sender, e); } else if (value.currentPlayer.movie.CurrentState == MediaElementState.Paused) { value.currentPlayer.PlayMedia(sender, e); } } } } }
void MediaElement_MarkerReached(object sender, System.Windows.Media.TimelineMarkerRoutedEventArgs e)
private void media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { double time = e.Marker.Time.TotalSeconds; double seconds = this.media.NaturalDuration.TimeSpan.TotalSeconds; if ((int)seconds <= 0) { return; } double marker = (time * this.timelineSlider.Maximum / seconds); if (status > marker) { return; } else { status = marker; } this.timelineSlider.Value = marker; nowTime.Text = time.ToString(); totalTime.Text = (Math.Round(seconds,0)).ToString(); }
void MediaElement_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { if (MarkerReached != null) { MarkerReached(this, new Microsoft.PlayerFramework.TimelineMarkerRoutedEventArgs { Marker = e.Marker }); } }
void MediaPlayer_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { // TODO: Subtitles // THESE DON'T GET FIRED BY THE MSS. // NEED TO ALTER THE PlaylistMgr TO FIRE THESE! if (e.Marker.Text.StartsWith("/")) return; //Hack for UK Parliament script events // Clean up the caption text string cleanMarker = System.Windows.Browser.HttpUtility.HtmlEncode( e.Marker.Text ).Replace("\n","<br/>").Replace("\r","").Replace("'", "’"); System.Windows.Browser.HtmlPage.Window.Eval("showTextCaption('" + cleanMarker + "');"); }
private void myPlayer_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { subs.Text = e.Marker.Text.ToString().Replace("|", "\n"); //MessageBox.Show(e.Marker.Text); }
void media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { SendEvent("loadEmbeddedCaptions", "{\"language\":\"" + e.Marker.Type + "\", \"ttml\":\"" + HttpUtility.HtmlEncode(Uri.EscapeUriString(e.Marker.Text)) + "\"}"); }
/// <summary> /// Event handler for the marker reached event from the media element. /// </summary> /// <param name="sender">Source of this event.</param> /// <param name="e">Event args.</param> void OnMediaElementMarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { Debug.WriteLine("OnMediaElementMarkerReached:" + TimeSpanStringConverter.ConvertToString(e.Marker.Time, ConverterModes.TenthSecond) + "->" + e.Marker.Text + "<-"); Debug.WriteLine("MarkerType:" + e.Marker.Type.ToString()); //Test if this a "Marker" vs a "Caption" if ((m_listBoxChapters != null) && e.Marker.Type.Equals(MarkerType)) { // compute current chapter index from playback position m_currentChapterIndex = ChapterIndexFromPosition(e.Marker.Time); } // Display marker or caption text in the caption area String type = e.Marker.Type.ToUpper(CultureInfo.InvariantCulture); if (type.Equals(CaptionType)) { SetCaptionText(e.Marker.Text); } if (MarkerReached != null) { MarkerReached(sender, e); } }
private void me_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { tb.Text = e.Marker.Text; }
// Private Methods (3) private void Player_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { // The current phrase has completed. _player.Pause(); // Let subscribers know that the current phrase has finished playing. if(FinishedPlaying != null) { FinishedPlaying(this, new EventArgs()); } }
private void MediaElement_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { string logMessage = string.Format(SmoothStreamingResources.TimelineMarkerReached, e.Marker.Time, e.Marker.Type, e.Marker.Text); SendLogEntry(KnownLogEntryTypes.SmoothStreamingMediaElementMarkerReached, message: logMessage); var mediaMarker = new MediaMarker { Type = e.Marker.Type, Begin = e.Marker.Time, End = e.Marker.Time, Content = e.Marker.Text }; NotifyMarkerReached(mediaMarker); }
void MediaPlayer_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { if (!CurrentPlaylist.EnableCaptions) return; foreach (var ctrl in ControlSets) { try { ctrl.CaptionFired(e.Marker); } catch (Exception ex) { drop(ex); } } }
void _media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { OnMarkerReached(e.Marker); if (string.Compare(e.Marker.Type, "marker", StringComparison.InvariantCultureIgnoreCase) <= 0) { if (_activeMarker != null) { _activeMarker.Animate.Stop(); } Marker marker; _markers.TryGetValue(e.Marker.Time, out marker); if (marker != null) { _activeMarker = marker; marker.Animate.Begin(); } } }
void element_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { if (MarkerReached != null) { MarkerReached(sender, e); } }
private void MediaPlayer_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { if (e.Marker.Type == "EndTimeCode") { MediaPlayer.Pause(); SeekToMediaPosition(CurrentNode.StartTimeCodeProvided ? CurrentNode.StartTime : TimeSpan.Parse("00:00:00")); MediaPlayer_CurrentStateChanged(sender, new RoutedEventArgs()); MainUI.PlayControl.StopState(); } var markerEvent = new Event { Name = "TimelineMarkerEvent", EventArgs = new List<EventArg> { {new EventArg() { Name="Text", Value=e.Marker.Text}}, {new EventArg() { Name="Time", Value=e.Marker.Time.TotalSeconds.ToString(CultureInfo.InvariantCulture)}}, {new EventArg() { Name="Type", Value=e.Marker.Type}} } }; MainUI.Controller.SendEvent(markerEvent); //CurrentNode.PlayingTime = new TimeSpan(); }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// timelinemarkerroutedeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this TimelineMarkerRoutedEventHandler timelinemarkerroutedeventhandler, Object sender, TimelineMarkerRoutedEventArgs e, AsyncCallback callback) { if(timelinemarkerroutedeventhandler == null) throw new ArgumentNullException("timelinemarkerroutedeventhandler"); return timelinemarkerroutedeventhandler.BeginInvoke(sender, e, callback, null); }
private static void music_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e) { Action<TimelineMarker> ma = MarkerReachedAction; if (ma != null) ma(e.Marker); }