flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject [30/50] [abbrv] git commit: [flex-utilities] [refs/heads/master] - update video code examples to get around OSMF bug
Date Sat, 23 Aug 2014 04:45:37 GMT
update video code examples to get around OSMF bug


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/6fd9d88e
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/6fd9d88e
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/6fd9d88e

Branch: refs/heads/master
Commit: 6fd9d88e84bd4e4063b4d308dd6331d05350c1cc
Parents: e0666de
Author: Justin Mclean <jmclean@apache.org>
Authored: Wed Aug 13 18:34:10 2014 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Wed Aug 13 18:34:10 2014 +1000

----------------------------------------------------------------------
 .../src/spark/components/VideoPlayer.mxml          | 11 +++++++++--
 .../src/spark/components/VideoPlayerExample.mxml   |  4 ++--
 .../src/spark/components/VideoPlayerModule.mxml    | 17 +++++++++++++++--
 .../src/spark/controls/VideoDisplayExample.mxml    | 15 ++++++++++++---
 .../src/spark/controls/VideoPlayerExample.mxml     | 13 +++++++++++--
 5 files changed, 49 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6fd9d88e/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayer.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayer.mxml b/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayer.mxml
index af39161..b4797ff 100644
--- a/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayer.mxml
+++ b/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayer.mxml
@@ -21,7 +21,8 @@
 				   xmlns:s="library://ns.adobe.com/flex/spark" 
 				   xmlns:mx="library://ns.adobe.com/flex/mx" 
 				   borderStyle="solid" 
-				   backgroundColor="#333333">
+				   backgroundColor="#333333"
+				   initialize="init(event)">
 	
 	<fx:Metadata>
 		[Event(name="complete", type="mx.events.VideoEvent")]
@@ -31,15 +32,21 @@
 	<fx:Script>
 		<![CDATA[
 			import mx.events.ItemClickEvent;
+			import mx.events.FlexEvent;
 			import mx.events.VideoEvent;
 			
 			import org.osmf.events.MediaPlayerStateChangeEvent;
 			import org.osmf.events.TimeEvent;
+			import org.osmf.utils.OSMFSettings;
 			
 			[Bindable] public var videoWidth:int = 240;
 			[Bindable] public var videoHeight:int = 180;
 			[Bindable] public var source:String; 
 			
+			protected function init(event:FlexEvent):void {
+				OSMFSettings.enableStageVideo = false;
+			}	
+			
 			private function buttonBarClick(event:ItemClickEvent):void
 			{
 				switch (event.index)
@@ -75,7 +82,7 @@
 					mediaPlayerStateChange="dispatchEvent(event)"/>
 	
 	<mx:ProgressBar id="progressBar" mode="manual" minimum="0" maximum="{videoDisplay.duration}"

-					label="" top="{videoHeight + 8 }" left="4" right="4"/>
+					label="" top="{videoHeight + 8}" left="4" right="4"/>
 	
 	<mx:ButtonBar id="bb" itemClick="buttonBarClick(event)" top="{videoHeight + 20}" bottom="4"

 				  horizontalCenter="0" toolTipField="toolTip">

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6fd9d88e/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerExample.mxml
index 5b56811..17b7efb 100644
--- a/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerExample.mxml
+++ b/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerExample.mxml
@@ -19,7 +19,7 @@
 -->
 <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" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx"
 			   xmlns:local="*"
 			   skinClass="TDFGradientBackgroundSkin">
 	
@@ -38,7 +38,7 @@
 							  paddingTop="10" paddingBottom="10"/>
 		</s:layout>
 		
-		<local:VideoPlayer source="video1.flv"
+		<local:VideoPlayer source="assets/FlexInstaller.mp4"
 						   complete="log.text += 'complete\n'"
 						   mediaPlayerStateChange="log.text += event.state.toString() + '\n'"/>
 		

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6fd9d88e/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerModule.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerModule.mxml b/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerModule.mxml
index 2f2fb89..6ec18a7 100644
--- a/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerModule.mxml
+++ b/TourDeFlex/TourDeFlex3/src/spark/components/VideoPlayerModule.mxml
@@ -22,9 +22,22 @@
 		   xmlns:mx="library://ns.adobe.com/flex/mx"  
 		   xmlns="*"
 		   layout="horizontal" 
-		   paddingTop="8">
+		   paddingTop="8"
+		   initialize="init(event)">
 	
-	<VideoPlayer source="objects/HOWTO/Components/video1.flv"
+	<fx:Script>
+		<![CDATA[
+			import mx.events.FlexEvent;
+			
+			import org.osmf.utils.OSMFSettings;
+			
+			protected function init(event:FlexEvent):void {
+				OSMFSettings.enableStageVideo = false;
+			}	
+		]]>
+	</fx:Script>	
+	
+	<VideoPlayer source="assets/FlexInstaller.mp4"
 				 complete="log.text += 'complete\n'"
 				 mediaPlayerStateChange="log.text += event.state + '\n'"/>
 	

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6fd9d88e/TourDeFlex/TourDeFlex3/src/spark/controls/VideoDisplayExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/VideoDisplayExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/VideoDisplayExample.mxml
index f3bfc98..91a9212 100644
--- a/TourDeFlex/TourDeFlex3/src/spark/controls/VideoDisplayExample.mxml
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/VideoDisplayExample.mxml
@@ -20,7 +20,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" 
-			   skinClass="TDFGradientBackgroundSkin">
+			   skinClass="TDFGradientBackgroundSkin"
+			   initialize="init(event)">
 	
 	<s:layout>
 		<s:HorizontalLayout horizontalAlign="center" />
@@ -29,11 +30,19 @@
 	<fx:Script>
 		<![CDATA[
 			import flashx.textLayout.conversion.TextConverter;
+			
+			import mx.events.FlexEvent;
+			
+			import org.osmf.utils.OSMFSettings;
+			
+			protected function init(event:FlexEvent):void {
+				OSMFSettings.enableStageVideo = false;
+			}	
 		]]>
 	</fx:Script>
 	
 	<fx:Declarations>
-		<fx:String id="TitleText"><![CDATA["<b>VideoDisplay Control:</b><br
/>Use the buttons to control the video."]]></fx:String>
+		<fx:String id="TitleText"><![CDATA[<b>VideoDisplay Control:</b><br
/>Use the buttons to control the video.]]></fx:String>
 	</fx:Declarations>
 	
 	<s:VGroup width="600" horizontalAlign="center" paddingTop="10">
@@ -42,7 +51,7 @@
 					textFlow="{TextConverter.importToFlow(TitleText, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
 					horizontalCenter="0" verticalCenter="0" />
 		
-		<s:VideoDisplay id="myVid" height="146" width="220" source="assets/sample_vid.flv" autoPlay="false"/>
+		<s:VideoDisplay id="myVid" height="146" width="220" source="assets/FlexInstaller.mp4"
autoPlay="false"/>
 		
 		<s:HGroup>
 			<s:Button label="Play" color="0x00000" click="myVid.play();"/>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6fd9d88e/TourDeFlex/TourDeFlex3/src/spark/controls/VideoPlayerExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/VideoPlayerExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/VideoPlayerExample.mxml
index 5f64a2a..963cc2b 100644
--- a/TourDeFlex/TourDeFlex3/src/spark/controls/VideoPlayerExample.mxml
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/VideoPlayerExample.mxml
@@ -20,13 +20,22 @@
 <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"
-			   viewSourceURL="srcview/index.html">
+			   initialize="init(event)">
 	
 	<fx:Script>
 		<![CDATA[
+			import flashx.textLayout.conversion.TextConverter;
+			
 			import mx.events.ItemClickEvent;
+			import mx.events.FlexEvent;
 			import mx.collections.ArrayCollection;
 			
+			import org.osmf.utils.OSMFSettings;
+			
+			protected function init(event:FlexEvent):void {
+				OSMFSettings.enableStageVideo = false;
+			}	
+			
 			private function playPauseChange(event:Event):void 
 			{
 				videoPlayer.playPauseButton.enabled = checkPlay.selected;
@@ -59,7 +68,7 @@ users seek through video; a volume bar; a timer; and a button to toggle
in and o
 			</s:HGroup>
 			<s:VideoPlayer id="videoPlayer" 
 						   horizontalCenter="-2" y="50"
-						   source="assets/sample_vid.flv"
+						   source="assets/FlexInstaller.mp4"
 						   autoPlay="false"
 						   autoRewind="{checkRewind.selected}"/>	
 			</s:VGroup>


Mime
View raw message