p id="player">a >Get Flash/a> to see this player./p> script type="text/javascript"> var so = new SWFObject('mediaplayer.swf','player','400','400','7'); so.addParam("allowfullscreen","true"); so.addVariable("file","test.flv"); so.addVariable("displayheight","300"); so.write('player'); /script>
*** "start"元素只被XSPF的播放列表格式支持。該元素用來設(shè)置流媒體文件(HTTP or RTMP)的開始位置,單位為秒。
**** XSPF列表格式中的"location"元素中如果不包含常見的擴展名(如 "mp3" or "flv"),可以使用"meta"元素指定文件格式。(如 meta rel='"type">mp3/meta> ).在使用RSS和ATOM的情況下,文件格式被自動的根據(jù)mimetype來識別。
RTMP streams, the additional "id" flashvar has to be sent as well. Example: "file=rtmp://my.streaming.server/mypath" and "id=video_one".
// Set the flashvars (booleans and numbers should also be quoted) var width = "320"; var height = "240"; var file = "my_video.flv"; var autostart = "true"; // Start the player var mpl = new com.jeroenwijering.players.MediaPlayer(this.player); Additionally, I have made the controller a public object, so you can control the mediaplayer with the sendEvent() function from anywhere in your flash site (the schematic above has a list of all sendEvent() options). Let's continue the small script above: