mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-09 06:01:08 +02:00
added light (buttonless) version of player
This commit is contained in:
parent
748192877a
commit
87ee276489
56
test/rtmp-publisher/RtmpPlayerLight.mxml
Normal file
56
test/rtmp-publisher/RtmpPlayerLight.mxml
Normal 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>
|
BIN
test/rtmp-publisher/RtmpPlayerLight.swf
Normal file
BIN
test/rtmp-publisher/RtmpPlayerLight.swf
Normal file
Binary file not shown.
Loading…
Reference in a new issue