Playing Video On Button Click
MXML Code
<?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="initApp()">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	<fx:Script>
		<![CDATA[
			
			[Bindable]
			private var playBtnVisible:Boolean = true;
			
			private function initApp():void{
				Security.allowDomain("*");
				stopStreaming();
			}

			private function stopStreaming():void{
				sampVid.stop();
			}
			
			private function startStreaming():void{
				playBtnVisible = false;
				sampVid.play();
			}
		]]>
	</fx:Script>
	
	<s:VideoDisplay id="sampVid" x="10" y="17" source="http://www.innovativephp.com/uploads/flex_video/video.mp4" 
		width="822" height="475"/>
	<s:Button id="playBtn" click="startStreaming()" x="362" y="243" width="113" height="61" visible="{playBtnVisible}"
			  label="PLAY" fontSize="28" fontWeight="bold"/>
</s:Application>

Like InnovativePHP On Facebook Follow Me On Twitter Add Me On Google Plus Circles Subscribe To RSS Feed Get Updates Delivered To Your Inbox

Follow Me On Twitter

Advertise Here

Follow Us On Facebook