added light (buttonless) version of player

This commit is contained in:
Roman Arutyunyan 2013-11-20 11:15:35 +04:00
parent 748192877a
commit 87ee276489
2 changed files with 56 additions and 0 deletions

View file

@ -0,0 +1,56 @@
<?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="500" minHeight="350" creationComplete="init()">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.core.FlexGlobals;
import flash.display.StageDisplayState;
import mx.managers.SystemManager;
private var streamer:String;
private var file:String;
private function fullscreenListener(event:MouseEvent):void {
try {
switch (stage.displayState) {
case StageDisplayState.FULL_SCREEN:
stage.displayState = StageDisplayState.NORMAL;
break;
default:
stage.displayState = StageDisplayState.FULL_SCREEN;
break;
}
} catch (err:SecurityError) {
Alert.show('Fullsceen error: ' + err);
}
}
private function init():void {
videoDisplay.mx_internal::videoPlayer.bufferTime = 1;
streamer = FlexGlobals.topLevelApplication.parameters.streamer;
if(streamer == null) {
Alert.show('Missing flashvars: streamer');
return;
}
file = FlexGlobals.topLevelApplication.parameters.file;
if(file == null) {
Alert.show('Missing flashvars: file');
return;
}
videoDisplay.addEventListener(MouseEvent.DOUBLE_CLICK, fullscreenListener);
videoDisplay.source = streamer + "/" + file;
videoDisplay.play();
}
]]>
</fx:Script>
<s:BorderContainer x="0" y="0" width="100%" height="100%">
<s:VideoDisplay doubleClickEnabled="true" width="100%" height="100%" id="videoDisplay"></s:VideoDisplay>
</s:BorderContainer>
</s:Application>

Binary file not shown.