summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/media9/players/APlayer.mxml
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/media9/players/APlayer.mxml')
-rw-r--r--Master/texmf-dist/source/latex/media9/players/APlayer.mxml45
1 files changed, 42 insertions, 3 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;