Home Tutorial Flex Flex4 Components VideoDisplay in Flex4

 
 

Share on Google+Share on Google+
VideoDisplay in Flex4
Posted on: May 19, 2010 at 12:00 AM
Advertisement
The VideoDisplay control is used in both the MX and Spark components. You can use the MX VideoDisplay control for live streaming video.

VideoDisplay Control in Flex4:

The VideoDisplay control is used in both the MX and Spark components. You can use the MX VideoDisplay control for live streaming video.You can use  a local camera using the attachCamera() method for live streaming. You can use VideoDisplay control for showing a video message from the MD of your company, songs streaming, live match streaming etc. Flex supports only .flv file format with this control. You can use the pause(), play() method with this control and set the maintainAspectRatio for display the video. The tag of this control is <mx:VideoDisplay>.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600"

creationComplete="videodisplay.pause();">

<s:Panel title="VideoDisplay Control Example" width="280" height="327">

<mx:VBox x="14" y="10">

<mx:VideoDisplay id="videodisplay"

source="/tutorialfiles/flex4/US_Aircraft_Carrier_Landing.flv"

height="250"

width="250"/>

<mx:HBox>

<mx:Button label="Pause" click="videodisplay.pause();"/>

<mx:Button label="Play" click="videodisplay.play();"/>

</mx:HBox>

</mx:VBox>

</s:Panel>

</s:Application>

In this example you can see how we can use a VideoDisplay control in Flex4.

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisement

Related Tags for VideoDisplay in Flex4:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: May 19, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com