summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml')
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml46
1 files changed, 42 insertions, 4 deletions
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
index 6a405c30145..02c684ffe32 100644
--- a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
+++ b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
@@ -4,7 +4,7 @@
<!-- a FlashPlayer-9 compatible component for playing -->
<!-- FLV and MP4/H.264 video files and streams. -->
<!-- -->
-<!-- version 20131114 -->
+<!-- version 20140625 -->
<!-- -->
<!-- Copyright (C) 2012-today Alexander Grahn -->
<!-- -->
@@ -46,6 +46,8 @@
private var keyPressed:Boolean=false;
private var muted:Boolean=false;
private var lastVolume:Number;
+ private var pauseAtPos:Number = -1;
+ private var toBePaused:Boolean = false;
import flash.external.*;
private function initialise(flashVars:Object):void {
@@ -143,11 +145,26 @@
if(stepping&&vidDisp.playing){vidDisp.pause();}
}
- private function play():void {
- if(vidComplete){vidDisp.playheadTime=0;}vidDisp.play();
+ private function onPlayheadUpdate(e:Event):void {
+ if(vidDisp.playing&&pauseAtPos>=0&&vidDisp.playheadTime<pauseAtPos)
+ toBePaused=true;
+ if(
+ vidDisp.playing&&pauseAtPos>=0&&
+ vidDisp.playheadTime>=pauseAtPos&&toBePaused
+ ){
+ pause();
+ pauseAtPos=-1;
+ toBePaused=false;
+ }
+ }
+
+ private function play(p:Number=-1):void {
+ if(p>=0) seek(p);
+ if(vidComplete){seek(0);}vidDisp.play();
}
- private function pause():void {
+ private function pause(p:Number=-1):void {
+ if(p>=0){pauseAtPos=p;return;}
vidDisp.pause();
}
@@ -206,6 +223,22 @@
return fmtd;
}
+ private function currentTime():Number {
+ return vidDisp.playheadTime;
+ }
+
+ private function playing():Boolean {
+ return vidDisp.playing;
+ }
+
+ private function duration():Number {
+ return vidDisp.totalTime;
+ }
+
+ private function ismuted():Boolean {
+ return muted;
+ }
+
private function init():void {
this.setFocus();
this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
@@ -220,6 +253,10 @@
ExternalInterface.addCallback("mute", mute);
ExternalInterface.addCallback("setSource", setSource);
ExternalInterface.addCallback("stepping", step);
+ ExternalInterface.addCallback("currentTime", currentTime);
+ ExternalInterface.addCallback("duration", duration);
+ ExternalInterface.addCallback("playing", playing);
+ ExternalInterface.addCallback("muted", ismuted);
}
]]>
</mx:Script>
@@ -239,6 +276,7 @@
stateChange="onStateChange(event);"
complete="vidComplete=true;"
rewind="vidDisp.play();"
+ playheadUpdate="onPlayheadUpdate(event);"
/>
<mx:ProgressBar width="100%" mode="polled" source="vidDisp"