Create Marker through Javascript API

Nov 22, 2011 at 3:57 PM

Is it possible to create new media marker through the Javascript API?  The only method I see is CreateMarker which returns a blank ScriptMediaMarker. I want to be able to create them through javascript and set them on the player.

Feb 21, 2012 at 4:08 PM

I´d achieved it with:

var slCtl = null;
function pluginLoaded(sender, args) { slCtl = sender.getHost().Content; createNewPlaylistItem(); } function createNewPlaylistItem() { var NewPlaylistItem = slCtl.Player.CreatePlaylistItem('http://smf.vertigo.com/videos/wildlife.wmv', '', 'Title', 'Description'); NewPlaylistItem.DeliveryMethod = 'ProgressiveDownload'; var marker1 = slCtl.Player.CreateMarker(); var marker2 = slCtl.Player.CreateMarker(); marker1.Id = "1"; marker1.Begin = 0; marker1.End = 5; marker1.Content = "Marker 1"; marker1.Type = "timeline" marker2.Id = "2"; marker2.Begin = 10; marker2.End = 15; marker2.Content = "Marker 2"; marker2.Type = "timeline" NewPlaylistItem.AddMarker(marker1); NewPlaylistItem.AddMarker(marker2); var NewPlaylist = slCtl.Player.CreatePlaylist(); NewPlaylist.AddPlaylistItem(NewPlaylistItem); slCtl.Player.SetPlaylist(NewPlaylist); }