Tuesday, March 24, 2009

Playing Video (AIR)

This is a sample application, which plays an .flv file using VideoDisplay component in flex.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:String id="urlStr">assets/Coldplay_1.flv</mx:String>
<mx:VideoDisplay id="vd" width="100%" height="100%">
<mx:click>
<![CDATA[
if(vd.playing)
{
vd.stop();
}
else
{
vd.play();
}
]]>
</mx:click>
</mx:VideoDisplay>
<mx:Button>
<mx:label>Start Play</mx:label>
<mx:click>
<![CDATA[
vd.source = urlStr;
]]>
</mx:click>
</mx:Button>
</mx:WindowedApplication>

No comments:

Post a Comment