03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Flash Video Exporter utility (version 1.1 or greater) embeds a video's duration, creation<br />

date, data rates, <strong>and</strong> other information into the video file itself. Different video encoders<br />

embed different sets of metadata.<br />

This h<strong>and</strong>ler is triggered after a call to the NetStream.play() method, but before the video<br />

playhead has advanced.<br />

In many cases the duration value embedded in FLV metadata approximates the actual<br />

duration but is not exact. In other words it will not always match the value of the<br />

NetStream.time property when the playhead is at the end of the video stream.<br />

Availability<br />

ActionScript 1.0; Flash Player 7<br />

Parameters<br />

infoObject:Object - An object containing one property for each metadata item.<br />

Example<br />

The code in this example starts by creating new NetConnection <strong>and</strong> NetStream objects. Then<br />

it defines the onMetaData() h<strong>and</strong>ler for the NetStream object. The h<strong>and</strong>ler cycles through<br />

each named property in the infoObject object <strong>and</strong> prints the property's name <strong>and</strong> value.<br />

var nc:NetConnection = new NetConnection();<br />

nc.connect(null);<br />

var ns:NetStream = new NetStream(nc);<br />

ns.onMetaData = function(infoObject:Object) {<br />

for (var propName:String in infoObject) {<br />

trace(propName + " = " + infoObject[propName]);<br />

}<br />

};<br />

ns.play("http://www.helpexamples.com/flash/video/water.flv");<br />

This causes the following information to be displayed:<br />

canSeekToEnd = true<br />

videocodecid = 4<br />

framerate = 15<br />

videodatarate = 400<br />

height = 215<br />

width = 320<br />

duration = 7.347<br />

The list of properties will vary depending on the software that was used to encode the FLV<br />

file.<br />

NetStream 509

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!