summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/media9/players
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-05-11 20:54:48 +0000
committerKarl Berry <karl@freefriends.org>2015-05-11 20:54:48 +0000
commit2f48bc401a4d735d9ccb93564430e563092a863d (patch)
tree81fac81b83ed73787d4fa8804a6d54b954340702 /Master/texmf-dist/source/latex/media9/players
parent6871fba7f230af109b503359d3d7fa700c9966a3 (diff)
media9 (11may15)
git-svn-id: svn://tug.org/texlive/trunk@37332 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/media9/players')
-rw-r--r--Master/texmf-dist/source/latex/media9/players/APlayer.mxml45
-rw-r--r--Master/texmf-dist/source/latex/media9/players/APlayer9.mxml45
-rw-r--r--Master/texmf-dist/source/latex/media9/players/SlideShow.mxml426
-rw-r--r--Master/texmf-dist/source/latex/media9/players/VPlayer.mxml81
-rw-r--r--Master/texmf-dist/source/latex/media9/players/VPlayer9.mxml62
5 files changed, 617 insertions, 42 deletions
diff --git a/Master/texmf-dist/source/latex/media9/players/APlayer.mxml b/Master/texmf-dist/source/latex/media9/players/APlayer.mxml
index 30ae5de9229..9be181f2f5d 100644
--- a/Master/texmf-dist/source/latex/media9/players/APlayer.mxml
+++ b/Master/texmf-dist/source/latex/media9/players/APlayer.mxml
@@ -4,7 +4,7 @@
<!-- a FlashPlayer-10 compatible component for playing -->
<!-- MP3 audio files and streams. -->
<!-- -->
-<!-- version 20140625 -->
+<!-- version 20150511 -->
<!-- -->
<!-- -->
<!-- The free Apache Flex 4 SDK is required to compile -->
@@ -42,7 +42,7 @@
preinitialize="initialise(FlexGlobals.topLevelApplication.parameters);"
applicationComplete="initSound();addEventListeners();
fadeTargets=new Array(playProgress, caption);"
- creationComplete="initCallBacks();"
+ creationComplete="initCallBacks();initContext();"
mouseDown="pause();setFocus();"
mouseUp="play();"
backgroundAlpha="0"
@@ -218,7 +218,6 @@
}
private function addEventListeners():void {
- this.setFocus();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
@@ -324,6 +323,46 @@
ExternalInterface.addCallback("muted", ismuted);
}
+ private function initContext():void {
+ this.contextMenu.hideBuiltInItems();
+
+ var itemPlayPause:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemPlayPause);
+ itemPlayPause.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{playPause();});
+
+ var itemRewind:ContextMenuItem = new ContextMenuItem("Rewind, [Home]");
+ this.contextMenu.customItems.push(itemRewind);
+ itemRewind.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{pause();playResumePos=(0);});
+
+ var itemGotoEnd:ContextMenuItem=new ContextMenuItem("Goto End, [End]");
+ this.contextMenu.customItems.push(itemGotoEnd);
+ itemGotoEnd.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{
+ if(playProgress.indeterminate) return;
+ pause();playResumePos=(snd.length);});
+
+ var itemMute:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemMute);
+ itemMute.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{mute();});
+
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Seek, [\u2190]/[\u2192]", true, false, true));
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Volume, [\u2191]/[\u2193]", false, false, true));
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Balance, [Ctrl]+[\u2190]/[\u2193]/[\u2192]",
+ false, false, true));
+
+ this.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,
+ function(e:ContextMenuEvent):void{
+ itemPlayPause.caption=(plyng ? "Pause" : "Play")+", [Space]";
+ itemMute.caption=(muted ? "Unmute" : "Mute")+", [m]";}
+ );
+ }
+
private function onSoundComplete(e:Event):void {
plyng = false;
playResumePos = 0;
diff --git a/Master/texmf-dist/source/latex/media9/players/APlayer9.mxml b/Master/texmf-dist/source/latex/media9/players/APlayer9.mxml
index 1a80f98c921..8c12fa943ab 100644
--- a/Master/texmf-dist/source/latex/media9/players/APlayer9.mxml
+++ b/Master/texmf-dist/source/latex/media9/players/APlayer9.mxml
@@ -4,7 +4,7 @@
<!-- a FlashPlayer-9 compatible component for playing -->
<!-- MP3 audio files and streams. -->
<!-- -->
-<!-- version 20140625 -->
+<!-- version 20150511 -->
<!-- -->
<!-- Copyright (C) 2012-today Alexander Grahn -->
<!-- -->
@@ -26,7 +26,7 @@
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
preinitialize="initialise(Application.application.parameters);"
applicationComplete="initSound();addEventListeners();"
- creationComplete="initCallBacks();"
+ creationComplete="initCallBacks();initContext();"
mouseDown="pause();setFocus();"
mouseUp="play();"
backgroundAlpha="0"
@@ -207,7 +207,6 @@
}
private function addEventListeners():void {
- this.setFocus();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
@@ -313,6 +312,46 @@
ExternalInterface.addCallback("muted", ismuted);
}
+ private function initContext():void {
+ this.contextMenu.hideBuiltInItems();
+
+ var itemPlayPause:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemPlayPause);
+ itemPlayPause.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{playPause();});
+
+ var itemRewind:ContextMenuItem = new ContextMenuItem("Rewind, [Home]");
+ this.contextMenu.customItems.push(itemRewind);
+ itemRewind.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{pause();playResumePos=(0);});
+
+ var itemGotoEnd:ContextMenuItem=new ContextMenuItem("Goto End, [End]");
+ this.contextMenu.customItems.push(itemGotoEnd);
+ itemGotoEnd.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{
+ if(playProgress.indeterminate) return;
+ pause();playResumePos=(snd.length);});
+
+ var itemMute:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemMute);
+ itemMute.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{mute();});
+
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Seek, [\u2190]/[\u2192]", true, false, true));
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Volume, [\u2191]/[\u2193]", false, false, true));
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Balance, [Ctrl]+[\u2190]/[\u2193]/[\u2192]",
+ false, false, true));
+
+ this.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,
+ function(e:ContextMenuEvent):void{
+ itemPlayPause.caption=(plyng ? "Pause" : "Play")+", [Space]";
+ itemMute.caption=(muted ? "Unmute" : "Mute")+", [m]";}
+ );
+ }
+
private function onSoundComplete(e:Event):void {
plyng = false;
playResumePos = 0;
diff --git a/Master/texmf-dist/source/latex/media9/players/SlideShow.mxml b/Master/texmf-dist/source/latex/media9/players/SlideShow.mxml
new file mode 100644
index 00000000000..6d7087bbc70
--- /dev/null
+++ b/Master/texmf-dist/source/latex/media9/players/SlideShow.mxml
@@ -0,0 +1,426 @@
+<?xml version="1.0"?>
+<!-- -->
+<!-- Apache Flex 4 source file of SlideShow.swf, -->
+<!-- a FlashPlayer-10 compatible component for -->
+<!-- JPEG/PNG/GIF slideshows. -->
+<!-- -->
+<!-- version 20150511 -->
+<!-- -->
+<!-- -->
+<!-- The free Apache Flex 4 SDK is required to compile -->
+<!-- this file. Get it from -->
+<!-- -->
+<!-- http://flex.apache.org/download-binaries.html -->
+<!-- -->
+<!-- and run -->
+<!-- -->
+<!-- mxmlc -static-link-runtime-shared-libraries SlideShow.mxml -->
+<!-- -->
+<!-- on the command line. -->
+<!-- -->
+<!-- -->
+<!-- Copyright (C) 2015-today Alexander Grahn -->
+<!-- -->
+<!-- This work may be distributed and/or modified under the -->
+<!-- conditions of the LaTeX Project Public License, either -->
+<!-- version 1.3 of this license or (at your option) any later -->
+<!-- version. -->
+<!-- -->
+<!-- The latest version of this license is in -->
+<!-- http://www.latex-project.org/lppl.txt -->
+<!-- and version 1.3 or later is part of all distributions of -->
+<!-- LaTeX version 2005/12/01 or later. -->
+<!-- -->
+<!-- This work has the LPPL maintenance status `maintained'. -->
+<!-- -->
+<!-- The current maintainer of this work is A. Grahn. -->
+<!-- -->
+<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"
+ preinitialize="initialise(FlexGlobals.topLevelApplication.parameters);"
+ applicationComplete="initApp();"
+ backgroundAlpha="0"
+>
+ <fx:Script>
+ <![CDATA[
+ import mx.managers.CursorManager;
+
+ private var slideshowXML:XML;
+ private var setXMLDone:Boolean;
+ private var isEnabled:Boolean=true;
+
+ private function setXML(s:String):void {
+ var loader:URLLoader = new URLLoader();
+ loader.addEventListener(Event.COMPLETE, onURLLoaderComplete);
+ loader.addEventListener(IOErrorEvent.IO_ERROR, onAnyError);
+ loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onAnyError);
+ isEnabled=false;
+ slideshowXML=null;
+ setXMLDone=false;
+ isIOError=true;
+ CursorManager.setBusyCursor();
+ timeoutTimer.start();
+ loader.load(new URLRequest(s));
+ }
+
+ private function onURLLoaderComplete(event:Event):void
+ {
+ CursorManager.removeBusyCursor();
+ isEnabled=true;
+ var loader:URLLoader = event.target as URLLoader;
+ if (loader != null)
+ {
+ slideshowXML = new XML(loader.data);
+ setXMLDone=true;
+ seek(0);
+ if(autoPlay) play();
+ }
+ }
+
+ import mx.core.FlexGlobals;
+ [Bindable] private var delay:Number=5;
+ [Bindable] private var autoPlay:Boolean=false;
+ private var xmlfile:String;
+
+ private function initialise(flashVars:Object):void {
+ xmlfile=flashVars.xml;
+ if(flashVars.delay){delay=flashVars.delay}
+ if(flashVars.autoPlay=='true'){autoPlay=true}
+ }
+
+ private var reloadTimer:Timer = null;
+ private var playTimer:Timer = null;
+ private var timeoutTimer:Timer;
+ private var curFile:String;
+
+ private var idx:Number=0;
+ [Bindable] private var src1:String;
+ [Bindable] private var src2:String;
+
+ private var rotations:Object;
+
+ private function rotate(n:Number=1):void {
+ if(Img1.visible){
+ n==0 ? Img1.rotation=0 : Img1.rotation+=90*Math.floor(n);
+ Img1.rotation%=360;
+ rotations[slideshowXML.Img[idx].URL.toString()]=Img1.rotation/90;
+ } else {
+ n==0 ? Img2.rotation=0 : Img2.rotation+=90*Math.floor(n);
+ Img2.rotation%=360;
+ rotations[slideshowXML.Img[idx].URL.toString()]=Img2.rotation/90;
+ }
+ }
+
+ private var forcedByUsr:Boolean;
+
+ private function setImgSrc():void {
+ if(reloadTimer && reloadTimer.hasEventListener(TimerEvent.TIMER)){
+ reloadTimer.removeEventListener(TimerEvent.TIMER, reloadImg);
+ reloadTimer=null;
+ }
+ if(setXMLDone && slideshowXML && (isEnabled||forcedByUsr)){
+ isEnabled=false;
+ forcedByUsr=false;
+ CursorManager.removeBusyCursor();
+ CursorManager.setBusyCursor();
+ timeoutTimer.start();
+ isIOError=true;
+ curFile=slideshowXML.Img[idx].URL.toString();
+ if(Img1.visible) {
+ src2=null; src2=curFile;
+ } else {
+ src1=null; src1=curFile;
+ }
+ }
+ if(slideshowXML.Img[idx].attribute('live')>0){
+ reloadTimer=new Timer(slideshowXML.Img[idx].attribute('live')*1000,1);
+ reloadTimer.addEventListener(TimerEvent.TIMER, reloadImg);
+ reloadTimer.start();
+ }
+ }
+
+ private var isReload:Boolean;
+ private function reloadImg(e:TimerEvent):void {
+ isReload=true; setImgSrc();
+ }
+
+ private var isPlaying:Boolean=false;
+
+ private function playPause():void {
+ if(isPlaying) pause(); else play();
+ }
+
+ private function play():void {
+ if(!isPlaying && slideshowXML.Img.length()>1) {
+ if(!playTimer){
+ playTimer=new Timer(delay*1000, 0);
+ playTimer.addEventListener(TimerEvent.TIMER, nextSlide);
+ }
+ isPlaying=true;
+ playTimer.start();
+ }
+ }
+
+ private function pause():void {
+ if(isPlaying) {
+ isPlaying=false;
+ playTimer.stop();
+ }
+ }
+
+ private function nextSlide(e:Event=null):void {
+ if(!isEnabled && !forcedByUsr) return;
+ if(isPlaying) playTimer.stop();
+ var evnt:MouseEvent = e as MouseEvent;
+ if(evnt && evnt.type=="mouseUp" && evnt.shiftKey) {
+ prevSlide();
+ } else {
+ idx++;
+ if(idx==slideshowXML.Img.length()) idx=0;
+ isReload=false;
+ setImgSrc();
+ }
+ }
+
+ private function prevSlide(e:MouseEvent=null):void {
+ if(!isEnabled && !forcedByUsr) return;
+ if(isPlaying) playTimer.stop();
+ idx--;
+ if(idx<0) idx=slideshowXML.Img.length()-1;
+ isReload=false;
+ setImgSrc();
+ }
+
+ private function seek(i:Number):void {
+ if(!isEnabled && !forcedByUsr) return;
+ if(isPlaying) playTimer.stop();
+ if(i<0 || i>=slideshowXML.Img.length())
+ idx=slideshowXML.Img.length()-1;
+ else
+ idx=Math.floor(i);
+ isReload=false;
+ setImgSrc();
+ }
+
+ private function onKeyDown(e:KeyboardEvent):void {
+ forcedByUsr=true;
+ switch(e.keyCode) {
+ case 32: //space bar
+ playPause();
+ break;
+ case 36: //home
+ if(isPlaying) pause();
+ seek(0);
+ break;
+ case 35: //end
+ if(isPlaying) pause();
+ seek(-1);
+ break;
+ case 37: //<--
+ prevSlide();
+ break;
+ case 39: //-->
+ nextSlide();
+ break;
+ case 82: //`r'
+ e.shiftKey ? rotate(-1) : rotate();
+ break;
+ }
+ }
+
+ private function slideNum():Number {return idx;}
+
+ private function numSlides():Number {return slideshowXML.Img.length();}
+
+ private function playing():Boolean {return isPlaying;}
+
+ private function initApp():void {
+ this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
+ ExternalInterface.addCallback("setXML", setXML);
+ ExternalInterface.addCallback("play",
+ function():void{forcedByUsr=true;play();});
+ ExternalInterface.addCallback("pause",
+ function():void{forcedByUsr=true;pause();});
+ ExternalInterface.addCallback("playPause",
+ function():void{forcedByUsr=true;playPause();});
+ ExternalInterface.addCallback("seek",
+ function(i:Number):void{forcedByUsr=true;seek(i);});
+ ExternalInterface.addCallback("slideNum", slideNum);
+ ExternalInterface.addCallback("numSlides", numSlides);
+ ExternalInterface.addCallback("playing", playing);
+ ExternalInterface.addCallback("rotate", rotate);
+
+ var itemNextSlide:ContextMenuItem =
+ new ContextMenuItem("Next Slide, [\u2192]");
+ this.contextMenu.customItems.push(itemNextSlide);
+ itemNextSlide.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{forcedByUsr=true;nextSlide();});
+
+ var itemPrevSlide:ContextMenuItem =
+ new ContextMenuItem("Previous Slide, [\u2190]");
+ this.contextMenu.customItems.push(itemPrevSlide);
+ itemPrevSlide.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{forcedByUsr=true;prevSlide();});
+
+ var itemPlayPause:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemPlayPause);
+ itemPlayPause.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{forcedByUsr=true;playPause();});
+
+ var itemFirstSlide:ContextMenuItem =
+ new ContextMenuItem("First Slide, [Home]");
+ this.contextMenu.customItems.push(itemFirstSlide);
+ itemFirstSlide.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{
+ forcedByUsr=true;if(isPlaying) pause();seek(0);});
+
+ var itemLastSlide:ContextMenuItem =
+ new ContextMenuItem("Last Slide, [End]");
+ this.contextMenu.customItems.push(itemLastSlide);
+ itemLastSlide.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{
+ forcedByUsr=true;if(isPlaying) pause();seek(-1);});
+
+ var itemRotRight:ContextMenuItem =
+ new ContextMenuItem("Rotate Right, [r]");
+ this.contextMenu.customItems.push(itemRotRight);
+ itemRotRight.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{forcedByUsr=true;rotate();});
+
+ var itemRotLeft:ContextMenuItem =
+ new ContextMenuItem("Rotate Left, [\u21e7]+[r]");
+ this.contextMenu.customItems.push(itemRotLeft);
+ itemRotLeft.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{forcedByUsr=true;rotate(-1);});
+
+ this.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,
+ function(e:ContextMenuEvent):void{
+ itemPlayPause.caption=(isPlaying ? "Pause" : "Play")+", [Space]";
+ itemPlayPause.visible=itemNextSlide.visible=itemPrevSlide.visible=
+ itemFirstSlide.visible=itemLastSlide.visible=false;
+ if(slideshowXML.Img.length()>1){
+ itemPlayPause.visible=itemNextSlide.visible=itemPrevSlide.visible=
+ itemFirstSlide.visible=itemLastSlide.visible=true;
+ }
+ });
+
+ rotations=new Object();
+ timeoutTimer=new Timer(30000, 1);
+ timeoutTimer.addEventListener(TimerEvent.TIMER, onAnyError);
+ curFile=xmlfile; setXML(xmlfile);
+ }
+
+ private var isIOError:Boolean;
+ private function onAnyError(e:Event):void {
+ if(e.type!=IOErrorEvent.IO_ERROR || setXMLDone==false){
+ isIOError=false;
+ setXMLDone=true;
+ if(Img1.visible){
+ src2=null; src2="/dev/null"
+ }else{
+ src1=null; src1="/dev/null"
+ }
+ caption.text=e.type+': '+curFile;
+ if(caption.text==TimerEvent.TIMER)
+ caption.text="timeout after 30 s: "+curFile;
+ CursorManager.removeBusyCursor();
+ }else{
+ if(isIOError) caption.text=e.type+': '+curFile;
+ onImgDone(e);
+ }
+ caption.visible=true;
+ if(reloadTimer && reloadTimer.hasEventListener(TimerEvent.TIMER)){
+ reloadTimer.removeEventListener(TimerEvent.TIMER, reloadImg);
+ reloadTimer=null; isReload=false;
+ }
+ }
+
+ private function onImgDone(e:Event):void {
+ timeoutTimer.reset();
+ if(e.target==Img1){
+ Img1.visible=true;Img2.visible=false;
+ } else {
+ Img2.visible=true;Img1.visible=false;
+ }
+ if(slideshowXML.Img.length()>1){
+ slideNo.text=String(idx+1)+"/"+slideshowXML.Img.length().toString();
+ slideNo.visible=slideNo.includeInLayout=true;
+ } else {
+ slideNo.visible=slideNo.includeInLayout=false;
+ }
+ var curRot:Number=0;
+ if (rotations.hasOwnProperty(slideshowXML.Img[idx].URL.toString()))
+ curRot=rotations[slideshowXML.Img[idx].URL.toString()];
+ else
+ curRot=Number(slideshowXML.Img[idx].attribute('rot90'));
+ rotate(0);
+ if(e.type==FlexEvent.READY) {
+ rotate(curRot);
+ if(slideshowXML.Img[idx].caption.toString()!=""){
+ caption.text=slideshowXML.Img[idx].caption.toString();
+ caption.visible=true;
+ } else {
+ caption.text="";
+ caption.visible=false;
+ }
+ if(!isReload) anim.play();
+ if(slideshowXML.Img[idx].attribute('live')>0)
+ cache.removeCacheEntry(slideshowXML.Img[idx].URL.toString());
+ }
+ CursorManager.removeBusyCursor();
+ isEnabled=true;
+ if(isPlaying && !playTimer.running) playTimer.start();
+ }
+ ]]>
+ </fx:Script>
+
+ <fx:Declarations>
+ <s:Animate id="anim" target="{grpCaption}">
+ <s:motionPaths>
+ <s:SimpleMotionPath property="bottom"
+ valueFrom="{-grpCaption.height}" valueTo="0"/>
+ </s:motionPaths>
+ </s:Animate>
+ <s:ContentCache id="cache"/>
+ </fx:Declarations>
+
+ <s:Image id="Img1" source="{src1}" visible="false"
+ width="100%" height="100%"
+ horizontalCenter="0" verticalCenter="0"
+ contentLoader="{cache}"
+ ready="onImgDone(event)"
+ ioError="onAnyError(event)"
+ securityError="onAnyError(event)"
+ smooth="true"
+ />
+
+ <s:Image id="Img2" source="{src2}" visible="true"
+ width="100%" height="100%"
+ horizontalCenter="0" verticalCenter="0"
+ contentLoader="{cache}"
+ ready="onImgDone(event)"
+ ioError="onAnyError(event)"
+ securityError="onAnyError(event)"
+ smooth="true"
+ />
+
+ <s:Group id="grpCaption" width="100%" bottom="{-grpCaption.height}">
+ <s:Label id="caption" left="0" bottom="0" visible="false"
+ paddingLeft="2" paddingBottom="2" paddingRight="2" paddingTop="4"
+ backgroundColor="0xdddddd" backgroundAlpha="0.7"
+ maxWidth="{grpCaption.width-slideNo.width}"
+ maxDisplayedLines="{-1}" lineBreak="toFit"
+ />
+ <s:Label id="slideNo" right="0" bottom="0" visible="false"
+ paddingLeft="2" paddingBottom="2" paddingRight="2" paddingTop="4"
+ backgroundColor="0xdddddd" backgroundAlpha="0.7"
+ />
+ </s:Group>
+
+ <s:Button alpha="0" width="100%" height="100%"
+ mouseUp="forcedByUsr=true;nextSlide(event);"
+ mouseOver="anim.play();"
+ mouseOut="if(anim.isPlaying) anim.reverse(); else anim.play(null,true);"
+ />
+</s:Application>
diff --git a/Master/texmf-dist/source/latex/media9/players/VPlayer.mxml b/Master/texmf-dist/source/latex/media9/players/VPlayer.mxml
index 7d73ce43b7d..d3ef5e17fad 100644
--- a/Master/texmf-dist/source/latex/media9/players/VPlayer.mxml
+++ b/Master/texmf-dist/source/latex/media9/players/VPlayer.mxml
@@ -4,7 +4,7 @@
<!-- a FlashPlayer-10 compatible component for playing -->
<!-- FLV and MP4/H.264 video files and streams. -->
<!-- -->
-<!-- version 20140625 -->
+<!-- version 20150511 -->
<!-- -->
<!-- -->
<!-- The free Apache Flex 4 SDK is required to compile -->
@@ -40,12 +40,12 @@
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
preinitialize="initialise(FlexGlobals.topLevelApplication.parameters);"
- creationComplete="init();"
+ applicationComplete="initApp();"
backgroundAlpha="0"
>
<fx:Script>
<![CDATA[
- [Bindable] private var scaleMode:String='stretch';
+ [Bindable] private var scaleMode:String='letterbox';
[Bindable] private var source:String;
[Bindable] private var autoPlay:Boolean=false;
[Bindable] private var autoRewind:Boolean=false;
@@ -249,8 +249,7 @@
return vidDisp.muted;
}
- private function init():void {
- this.setFocus();
+ private function initApp():void {
this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
@@ -267,37 +266,73 @@
ExternalInterface.addCallback("duration", duration);
ExternalInterface.addCallback("playing", playing);
ExternalInterface.addCallback("muted", muted);
+
+ var itemPlayPause:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemPlayPause);
+ itemPlayPause.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{playPause();});
+
+ var itemRewind:ContextMenuItem = new ContextMenuItem("Rewind, [Home]");
+ this.contextMenu.customItems.push(itemRewind);
+ itemRewind.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{vidDisp.pause();vidDisp.seek(0);});
+
+ var itemGotoEnd:ContextMenuItem = new ContextMenuItem("Goto End, [End]");
+ this.contextMenu.customItems.push(itemGotoEnd);
+ itemGotoEnd.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{vidDisp.pause();
+ vidDisp.seek(vidDisp.duration-0.1);});
+
+ var itemMute:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemMute);
+ itemMute.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{mute();});
+
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Seek, [\u2190]/[\u2192]", true, false, true));
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Volume, [\u2191]/[\u2193]", false, false, true));
+
+ this.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,
+ function(e:ContextMenuEvent):void{
+ itemPlayPause.caption=(vidDisp.playing ? "Pause" : "Play")+", [Space]";
+ itemMute.caption=(vidDisp.muted ? "Unmute" : "Mute")+", [m]";}
+ );
}
]]>
</fx:Script>
<fx:Declarations>
- <s:Fade id="fadeEffect" target="{playProgress}" alphaFrom="0.5" alphaTo="0" duration="2000"/>
+ <s:Fade id="fadeEffect" target="{playProgress}" alphaFrom="0.5" alphaTo="0"
+ duration="2000"/>
</fx:Declarations>
<s:VideoDisplay
- id="vidDisp"
- width="100%" height="100%" scaleMode="{scaleMode}"
- source="{source}" volume="{vol}"
- autoPlay="{autoPlay}" autoRewind="{autoRewind}" loop="{loop}"
- mouseDown="if(stepping){vidDisp.play();}else{vidDisp.pause();}this.setFocus();"
- mouseUp="if(vidComplete) vidDisp.seek(0);if(!stepping){vidDisp.play();}"
- mediaPlayerStateChange="onStateChange(event);"
- complete="vidComplete=true;"
- durationChange="vidDisp.seek(0);"
- currentTimeChange="onCurrentTimeChange(event);"
+ id="vidDisp"
+ width="100%" height="100%" scaleMode="{scaleMode}"
+ source="{source}" volume="{vol}"
+ autoPlay="{autoPlay}" autoRewind="{autoRewind}" loop="{loop}"
+ mediaPlayerStateChange="onStateChange(event);"
+ complete="vidComplete=true;"
+ durationChange="vidDisp.seek(0);"
+ currentTimeChange="onCurrentTimeChange(event);"
/>
<mx:ProgressBar width="100%" mode="polled" source="vidDisp"
- horizontalCenter="0" bottom="0" labelPlacement="center"
- id="loadingProgress" alpha="0.5"
- complete="loadingProgress.visible=false;"
- progress="onProgress(event)"
+ horizontalCenter="0" bottom="0" labelPlacement="center"
+ id="loadingProgress" alpha="0.5"
+ complete="loadingProgress.visible=false;"
+ progress="onProgress(event)"
/>
<mx:ProgressBar width="100%" mode="manual"
- horizontalCenter="0" bottom="0" labelPlacement="center"
- id="playProgress" alpha="0.5"
- visible="false"
+ horizontalCenter="0" bottom="0" labelPlacement="center"
+ id="playProgress" alpha="0.5"
+ visible="false"
+ />
+
+ <s:Button alpha="0" width="100%" height="100%"
+ mouseDown="if(stepping){vidDisp.play();}else{vidDisp.pause();}"
+ mouseUp="if(vidComplete) vidDisp.seek(0);if(!stepping){vidDisp.play();}"
/>
</s:Application>
diff --git a/Master/texmf-dist/source/latex/media9/players/VPlayer9.mxml b/Master/texmf-dist/source/latex/media9/players/VPlayer9.mxml
index 02c684ffe32..7d748112a95 100644
--- a/Master/texmf-dist/source/latex/media9/players/VPlayer9.mxml
+++ b/Master/texmf-dist/source/latex/media9/players/VPlayer9.mxml
@@ -4,7 +4,7 @@
<!-- a FlashPlayer-9 compatible component for playing -->
<!-- FLV and MP4/H.264 video files and streams. -->
<!-- -->
-<!-- version 20140625 -->
+<!-- version 20150511 -->
<!-- -->
<!-- Copyright (C) 2012-today Alexander Grahn -->
<!-- -->
@@ -25,7 +25,7 @@
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
preinitialize="initialise(Application.application.parameters);"
- creationComplete="init();"
+ applicationComplete="initApp();"
backgroundAlpha="0"
paddingTop="0" paddingBottom="0"
paddingLeft="0" paddingRight="0"
@@ -38,7 +38,7 @@
[Bindable] private var loop:Boolean=false;
[Bindable] private var vol:Number=0.75;
[Bindable] private var stepping:Boolean=false;
- [Bindable] private var letterbox:Boolean=false;
+ [Bindable] private var keepAspect:Boolean=true;
private var vidComplete:Boolean=false;
private var deltaSeek:Number;
private var playheadTime:Number;
@@ -52,11 +52,11 @@
import flash.external.*;
private function initialise(flashVars:Object):void {
source=flashVars.source;
- if(flashVars.autoPlay=='true'){autoPlay=true}
- if(flashVars.loop=='true'){loop=true}
- if(flashVars.volume){vol=Number(flashVars.volume)}
- if(flashVars.stepping){stepping=flashVars.stepping}
- if(flashVars.scaleMode=='letterbox'){letterbox=true}
+ if(flashVars.autoPlay=='true') autoPlay=true;
+ if(flashVars.loop=='true') loop=true;
+ if(flashVars.volume) vol=Number(flashVars.volume);
+ if(flashVars.stepping) stepping=flashVars.stepping;
+ if(flashVars.scaleMode && flashVars.scaleMode!='letterbox') keepAspect=false;
}
private function onProgress(event:ProgressEvent):void {
@@ -239,8 +239,7 @@
return muted;
}
- private function init():void {
- this.setFocus();
+ private function initApp():void {
this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
@@ -257,6 +256,39 @@
ExternalInterface.addCallback("duration", duration);
ExternalInterface.addCallback("playing", playing);
ExternalInterface.addCallback("muted", ismuted);
+
+ var itemPlayPause:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemPlayPause);
+ itemPlayPause.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{playPause();});
+
+ var itemRewind:ContextMenuItem = new ContextMenuItem("Rewind, [Home]");
+ this.contextMenu.customItems.push(itemRewind);
+ itemRewind.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{vidDisp.pause();seek(0);});
+
+ var itemGotoEnd:ContextMenuItem = new ContextMenuItem("Goto End, [End]");
+ this.contextMenu.customItems.push(itemGotoEnd);
+ itemGotoEnd.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{if(vidDisp.bytesTotal){
+ vidDisp.pause();
+ vidDisp.playheadTime=vidDisp.totalTime-0.1;}});
+
+ var itemMute:ContextMenuItem = new ContextMenuItem("N.N.");
+ this.contextMenu.customItems.push(itemMute);
+ itemMute.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
+ function(e:ContextMenuEvent):void{mute();});
+
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Seek, [\u2190]/[\u2192]", true, false, true));
+ this.contextMenu.customItems.push(
+ new ContextMenuItem("Volume, [\u2191]/[\u2193]", false, false, true));
+
+ this.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,
+ function(e:ContextMenuEvent):void{
+ itemPlayPause.caption=(vidDisp.playing ? "Pause" : "Play")+", [Space]";
+ itemMute.caption=(muted ? "Unmute" : "Mute")+", [m]";}
+ );
}
]]>
</mx:Script>
@@ -267,12 +299,10 @@
<mx:VideoDisplay
id="vidDisp"
- width="100%" height="100%" maintainAspectRatio="{letterbox}"
+ width="100%" height="100%" maintainAspectRatio="{keepAspect}"
backgroundAlpha="0" borderThickness="0"
source="{source}" volume="{vol}"
autoPlay="{autoPlay}" autoRewind="{loop}"
- mouseDown="if(stepping){vidDisp.play();}else{vidDisp.pause();}this.setFocus();"
- mouseUp="if(vidComplete) vidDisp.playheadTime=0;if(!stepping){vidDisp.play();}"
stateChange="onStateChange(event);"
complete="vidComplete=true;"
rewind="vidDisp.play();"
@@ -291,4 +321,10 @@
id="playProgress" alpha="0.5"
visible="false"
/>
+
+ <mx:Button alpha="0" width="100%" height="100%" cornerRadius="0"
+ paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0"
+ mouseDown="if(stepping){vidDisp.play();}else{vidDisp.pause();}"
+ mouseUp="if(vidComplete) vidDisp.playheadTime=0;if(!stepping){vidDisp.play();}"
+ />
</mx:Application>