Custom TimelineMediaMarker

Feb 21, 2012 at 11:10 AM
Edited Feb 21, 2012 at 11:12 AM

Hi, does anyone have seen a valid sample for creating a custom TimelineMediaMarker and change it´s appereance.

 

I also tried to add markers in code but it doesn't work,

public MainPage()
        {
            InitializeComponent();
           
            TimelineMediaMarker timelineMediaMarker = new TimelineMediaMarker()
            {
                Begin = TimeSpan.FromSeconds(10),
                End = TimeSpan.FromSeconds(10),
                Content = string.Format("{0}s Marker", 10),
                AllowSeek = true
            };

            Player.TimelineMarkers = new MediaMarkerCollection<TimelineMediaMarker>();
            Player.TimelineMarkers.Add(timelineMediaMarker);        
        }

Thanks in advance for any help!

Feb 21, 2012 at 4:08 PM

We achieve to add the markers in c# code with the following code:

 

public class CustomPlayer : SMFPlayer
    {

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.TimelineMarkers = new MediaMarkerCollection<TimelineMediaMarker>();
            this.TimelineMarkers.Add(new TimelineMediaMarker()
            {
                Begin = new TimeSpan(0),
                End = new TimeSpan(5),
                Id = "1",
                Type = "timeline",
                Content = "Marker 1"
            });

            this.TimelineMarkers.Add(new TimelineMediaMarkerSystem()
            {
                Begin = new TimeSpan(0, 0, 2, 0, 0),
                End = new TimeSpan(0, 0, 2, 0, 0),
                Id = "2",
                Type = "timeline",
                Content = "Marker 2"
            });

        }

    }