RIT Flash Media Player 3.2 User Guide
June 2007
RIT Media Player Component ............................................................................... 3 Supported File Formats ..................................................................................... 3 Using the Component ........................................................................................ 3 Dynamic Creation .............................................................................................. 4 Media Player Methods ................................................................................... 4 Property Associations .................................................................................... 5 Setting Media Properties through ActionScript .................................................. 5 Player for the Web ................................................................................................ 6 Passing Parameters .......................................................................................... 6 Parameter String Associations....................................................................... 6 Format ........................................................................................................... 6 Fullscreen .......................................................................................................... 7 Appendix A: Component Parameters.................................................................... 8 Appendix B: Media Info XML .............................................................................. 10 Appendix C: SMIL for Flash Streaming ............................................................... 11 Appendix D: Caption Standards .......................................................................... 12 RIT .................................................................................................................. 12 RIT2 ................................................................................................................ 12 TT (Timed Text)............................................................................................... 13
2
RIT Media Player Component
The RIT Flash Media Player Component (RIT FMPC) is a Flash video player much like the FLVPlayback Component in Flash 8 with some added support for multiple formats, captions, and searching. The RIT FMPC is designed to be as flexible as possible providing many options for integration into Flash based content. This documents a few of the ways that the component could be implemented into a project.
Supported File Formats
FLV SWF (from Captivate)
Using the Component
Open components panel (Window > components)
Drag RIT Media Player on to the stage Set player attributes in the Parameters tab of the Properties panel (see Appendix A: Component Parameters for parameter descriptions)
NOTE: If RIT Media Player does not appear in the components panel copy the latest version of the component (SWC file) to the components folder and restart Flash.
3
Windows: Documents and Settings\username\Local Settings\Application Data\Macromedia\flash version\language\Configuration\Components Macintosh: HD/Applications/flash version/Configuration/Components
Dynamic Creation
The RIT Media Player can be created dynamically through ActionScript to fit into an existing Flash Application, or a new application with other dynamic content. Example:
var iniObj:Object = {mediaPathXML:”video/media.xml”, playerSkin:"skins/skin.swf", numCapLines:2, centerPlayer:true, dynamicSize:false, isSearchable:true, fullscreenable:false}; var player = this.attachMovie("RIT Media Player", "myPlayer", this.getNextHighestDepth(), initObj); player.setSize(360, 300);
NOTE: Because the component does not inherit from UIObject the createClassObject method cannot be used; instead attachMovie must be used.
Media Player Methods
setSize ( width:Number, height:Number ) Sets the size of the player passed on width and height parameters. getWidth ( ) Returns the width of the player. getHeight ( ) Returns the height of the player. getCurrentTime ( ) Returns the current playhead time of the media in seconds. externalSearch ( search:String ) Execute search, based on parameter, within the player. restorePlayback ( ) Removes onPress from player container and starts media playback. originally for web when returning from fullscreen video window
4
Property Associations
Property numCapLines (Number) defaultCapsOn (Boolean) centerPlayer (Boolean) charsPerLine (Number) dynamicSize (Boolean) fitToStage (Boolean) fullscreenable (Boolean) mediaPathXML (String) scrollCaps (Boolean) isSearchable (Boolean) playerSkin (Boolean) ticket (String) mediaArray (Array) Component Parameter Caption Lines Captions Default On Center On Stage Characters Per Line Dynamic Size Fit to Stage Fullscreen Option Path to Media XML Scroll Captions Searchable Skin Ticket not a component parameter, used to override the need for Path to Media XML
See Appendix A: Component Parameters for parameter definitions
Setting Media Properties through ActionScript
The component allows media information to be passed in directly from ActionScript rather than through the XML file specified by “Path to Media XML” parameter or the mediaPathXML property. This allows developers to create their own schema for loading media properties. Example:
var mediaArray:Array = new Array(); mediaArray["fileName"] = “video/video.flv”; mediaArray["mType"] = “flv”; mediaArray["mediaWidth"] = 320; mediaArray["mediaHeight"] = 240; mediaArray["mFPS"] = 15; mediaArray["capFile"] = “video_captions.xml”; mediaArray["timeBase"] = “sec”; mediaArray["capType"] = “rit”; var iniObj:Object = {mediaArray:mediaArray, numCapLines:2, isSearchable:true}; var player = this.attachMovie("RIT Media Player", "myPlayer", this.getNextHighestDepth(), initObj);
5
Player for the Web
The RIT Media Player allows a single SWF file (containing the component) to be very flexible. Leveraging the component parameters can allow a single file to be used any number of times throughout a site.
Passing Parameters
Rather than publishing a new SWF for each video, a FlashVar called paramString containing component parameters can be passed into the embedded SWF. The component then checks paramString for parameters when it is created.
Parameter String Associations
Parameter String cl dco cp cpl ds fts f mp sc s ps t fullscreen Component Parameter Caption Lines Captions Default On Center On Stage Captions Per Line Dynamic Size Fit to Stage Fullscreen Option Path to Media XML Scroll Captions Searchable Skin Ticket not a component parameter, but if set to '1' or 'true' the player becomes scalable and disables fullscreen button
See AppendixA: Component Parameters for parameter definitions
Format
The format of paramString must be a series of name=value pairs; however, rather than & the pairs must be separated by ¶ to prevent Flash from parsing the string and making each parameter its own root level variable. Example: