StreamText.Net, Inc. Customer Portal Language
 
HomeKnowledge BaseWeb Video with CaptionsHow to provide captions on demand for Windows Media Player
Information
Article ID11
Created On3/17/2009
Modified3/18/2009
Share With Others
How to provide captions on demand for Windows Media Player
Windows media player uses a time coded file format called SAMI to provide synchronized captions with a media file.  There are several options for displaying the captions and they vary in their complexity.  Each of the options is outlined below with examples.

Direct link to media file with SAMI file "attached"
The easiest option is to include a link to the SAMI file when linking to the media file.  All that is required for this approach is to have the media file and the sami file accessible from a web server for download.  Here is a sample HTML anchor tag that will launch a Windows Media file and attach a SAMI file to it.  The user only has to turn on closed captions and they will see the closed captions on the bottom of the screen.

<a href="http://www.streamtext.net/IHaveADream.wmv?sami=http://www.streamtext.net/IHaveADream.smi">I Have A Dream</a>

The closed captions are availble in Windows Media player by selecting the following menu option "Play / Lyrics, Captions, and Subtitles / On if Available".  This option only has to be once and it'll remain on after that.

Player embedded in web page with captions in alternate area of page
<!-- An embedded Windows Media Player object with SAMI closed captioning -->
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="WMP1" width="180" height="186" style="margin:6; border:3 inset white;">
    <param name="URL" value="http://www.streamtext.net/IHaveADream.wmv">
    <param name="SAMIFileName" value="http://www.streamtext.net/IHaveADream.smi">
    <param name="captioningID" value="cc">
    <param name="SAMIStyle" value="Black Print">
    <param name="AutoStart" value="false">
    <param name="AutoRewind" value="true">
    <param name="EnableContextMenu" value="false">
</object>

<!-- A <div> window for the SAMI captioning, 'id=cc' is specified for 'captioningID' parameter -->
<div id="cc" style="margin-top:3px; width:290px; height:90px; background: white; border:2px inset silver;">
</div>