diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-11 20:54:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-11 20:54:48 +0000 |
commit | 2f48bc401a4d735d9ccb93564430e563092a863d (patch) | |
tree | 81fac81b83ed73787d4fa8804a6d54b954340702 /Master/texmf-dist/source/latex/media9/players/APlayer9.mxml | |
parent | 6871fba7f230af109b503359d3d7fa700c9966a3 (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/APlayer9.mxml')
-rw-r--r-- | Master/texmf-dist/source/latex/media9/players/APlayer9.mxml | 45 |
1 files changed, 42 insertions, 3 deletions
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; |