content/tourdeflex/spark/controls/VideoDisplayExample.mxml (33 lines of code) (raw):

<?xml version="1.0" encoding="utf-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <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" initialize="init(event)"> <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:Declarations> <s:Panel title="Video Display Sample" width="100%" height="100%"> <s:layout> <s:VerticalLayout paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10"/> </s:layout> <s:RichText width="75%" color="0xffffff" textAlign="center" textFlow="{TextConverter.importToFlow(TitleText, TextConverter.TEXT_FIELD_HTML_FORMAT)}" horizontalCenter="0" verticalCenter="0" /> <s:VideoDisplay id="myVid" width="66%" height="66%" source="./spark/controls/assets/FlexInstaller.mp4" autoPlay="false"/> <s:HGroup> <s:Button label="Play" color="0x00000" click="myVid.play()"/> <s:Button label="Pause" color="0x00000" click="myVid.pause()"/> <s:Button label="Stop" color="0x00000" click="myVid.stop()"/> </s:HGroup> </s:Panel> </s:Application>