Accessing Chapters through Javascript API

Jun 21, 2011 at 9:43 AM

Hi guys and girls,

We are trying to get a list of chapters from a smooth streaming stream through the Javascript API.  I can't figure it out and I can't find anything when I ask the Google.  Anyone know how to do this?  

As an added bonus, we'd like to pick up on player events when chapters change.  Basically to load images related to a chapter as the stream runs.  Anyone know how to do this?



Jun 22, 2011 at 2:00 PM

Hi Johann,

Have a look at the chm help file available in the Documentation section. Look in the Microsoft.SilverlightMediaFramework.Core.Javascript Namespace and then JavascriptBridge class members. This list the methods, properties and events available throught the javascript api.

To get a list of chapters you will have to wait for the MediaOpened event which will pass a ScriptPlaylistItem object; you should then be able to call ChapterCount to get the number of chapters for this item and GetChapter(index) to get a ScriptChapter object which contains the information about each chapter.


The event which occurs when chapters change is MarkerReached.

Hope this helps,


Jun 23, 2011 at 7:04 AM

Hi Michael,


Thanks for the reply. This will help much.