private void Player_MarkerReached(object sender, TimelineMarkerReachedInfo args)
 {
     if (MarkerReached != null)
     {
         var mm = new ScriptMediaMarker(args.Marker);
         MarkerReached(this, new ScriptEventArgs <ScriptMediaMarker>(mm));
     }
 }
 private void Player_MarkerLeft(object player, CustomEventArgs <TimelineMediaMarker> args)
 {
     MarkerLeft.IfNotNull(i =>
     {
         var mm = new ScriptMediaMarker(args.Value);
         i(this, new ScriptEventArgs <ScriptMediaMarker>(mm));
     });
 }
 private void Player_MarkerReached(object sender, TimelineMarkerReachedInfo args)
 {
     if (MarkerReached != null)
     {
         var mm = new ScriptMediaMarker(args.Marker);
         MarkerReached(this, new ScriptEventArgs<ScriptMediaMarker>(mm));
     }
 }
 private void Player_MarkerLeft(object player, CustomEventArgs<TimelineMediaMarker> args)
 {
     MarkerLeft.IfNotNull(i =>
                              {
                                  var mm = new ScriptMediaMarker(args.Value);
                                  i(this, new ScriptEventArgs<ScriptMediaMarker>(mm));
                              });
 }
예제 #5
0
        /// <summary>
        /// Converts this scriptable Playlist into playlist that can be consumed by the SMFPlayer.
        /// </summary>
        /// <returns>A collection of playlist items.</returns>
        public ObservableCollection <PlaylistItem> ToPlaylist()
        {
            var p = new ObservableCollection <PlaylistItem>();

            for (int i = 0; i < GetPlaylistItemCount(); i++)
            {
                ScriptPlaylistItem sItem = GetPlaylistItem(i);

                var thumbSource = !sItem.ThumbSource.IsNullOrWhiteSpace()
                                        ? new Uri(sItem.ThumbSource)
                                        : null;

                var item = new PlaylistItem
                {
                    DeliveryMethod =
                        (DeliveryMethods)
                        Enum.Parse(typeof(DeliveryMethods), sItem.DeliveryMethod, true),
                    Description      = sItem.Description,
                    FileSize         = sItem.FileSize,
                    FrameRate        = sItem.FrameRate,
                    JumpToLive       = sItem.JumpToLive,
                    MediaSource      = new Uri(sItem.MediaSource),
                    ThumbSource      = thumbSource,
                    Title            = sItem.Title,
                    VideoHeight      = sItem.VideoHeight,
                    VideoStretchMode =
                        (Stretch)Enum.Parse(typeof(Stretch), sItem.VideoStretchMode, true),
                    VideoWidth     = sItem.VideoWidth,
                    CustomMetadata = sItem.CustomMetadata,
                    S3DProperties  = (sItem.ScriptS3DProperties == null) ? null : sItem.ScriptS3DProperties.ConvertToS3DProperties(),
                    BearerToken    = sItem.BearerToken /* we need this to provide AMS key auth support for license delivery */
                };

                for (int j = 0; j < sItem.MarkerCount; j++)
                {
                    ScriptMediaMarker smm = sItem.GetMarker(j);

                    if (!smm.Type.IsNullOrWhiteSpace() && smm.Type.Equals("timeline", StringComparison.OrdinalIgnoreCase))
                    {
                        item.TimelineMarkers.Add(new TimelineMediaMarker
                        {
                            AllowSeek = smm.AllowSeek,
                            Begin     = TimeSpan.FromSeconds(smm.Begin),
                            End       = TimeSpan.FromSeconds(smm.End),
                            Id        = smm.Id,
                            Content   = smm.Content
                        });
                    }
                }
                for (int j = 0; j < sItem.ChapterCount; j++)
                {
                    ScriptChapter sci = sItem.GetChapter(j);
                    item.Chapters.Add(new Chapter
                    {
                        Begin       = TimeSpan.FromSeconds(sci.Begin),
                        End         = TimeSpan.FromSeconds(sci.End),
                        Id          = sci.Id,
                        Content     = sci.Content,
                        Description = sci.Description,
                        Title       = sci.Title,
                        ThumbSource = new Uri(sci.ThumbSource),
                        Type        = "chapter"
                    });
                }
                p.Add(item);
            }
            return(p);
        }
 public void AddMarker(ScriptMediaMarker marker)
 {
     _markers.Add(marker);
 }
예제 #7
0
        public ScriptMediaMarker GetMarker(int index)
        {
            ScriptMediaMarker marker = _markers[index];

            return(marker);
        }
예제 #8
0
 public void AddMarker(ScriptMediaMarker marker)
 {
     _markers.Add(marker);
 }