diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/media9/players')
5 files changed, 85 insertions, 27 deletions
diff --git a/Master/texmf-dist/source/latex/media9/players/APlayer.mxml b/Master/texmf-dist/source/latex/media9/players/APlayer.mxml index 9be181f2f5d..263123a369d 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 20150511 --> +<!-- version 20150601 --> <!-- --> <!-- --> <!-- The free Apache Flex 4 SDK is required to compile --> @@ -39,7 +39,7 @@ <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);" + preinitialize="initialise(this.parameters);" applicationComplete="initSound();addEventListeners(); fadeTargets=new Array(playProgress, caption);" creationComplete="initCallBacks();initContext();" @@ -76,7 +76,6 @@ private var keyPressed:Boolean=false; private var mouseIsOver:Boolean=false; - import mx.core.FlexGlobals; private function initialise(flashVars:Object):void { source=flashVars.source; if(flashVars.policy) policy=flashVars.policy; diff --git a/Master/texmf-dist/source/latex/media9/players/APlayer9.mxml b/Master/texmf-dist/source/latex/media9/players/APlayer9.mxml index 8c12fa943ab..cc1a1a0c629 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 20150511 --> +<!-- version 20150601 --> <!-- --> <!-- Copyright (C) 2012-today Alexander Grahn --> <!-- --> @@ -24,7 +24,7 @@ <!-- --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" - preinitialize="initialise(Application.application.parameters);" + preinitialize="initialise(this.parameters);" applicationComplete="initSound();addEventListeners();" creationComplete="initCallBacks();initContext();" mouseDown="pause();setFocus();" diff --git a/Master/texmf-dist/source/latex/media9/players/SlideShow.mxml b/Master/texmf-dist/source/latex/media9/players/SlideShow.mxml index 6d7087bbc70..743d482602d 100644 --- a/Master/texmf-dist/source/latex/media9/players/SlideShow.mxml +++ b/Master/texmf-dist/source/latex/media9/players/SlideShow.mxml @@ -4,7 +4,7 @@ <!-- a FlashPlayer-10 compatible component for --> <!-- JPEG/PNG/GIF slideshows. --> <!-- --> -<!-- version 20150511 --> +<!-- version 20150601 --> <!-- --> <!-- --> <!-- The free Apache Flex 4 SDK is required to compile --> @@ -38,8 +38,9 @@ <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);" + preinitialize="initialise(this.parameters);" applicationComplete="initApp();" + resize="if(dynResolution){dynResolution=false;forcedByUsr=true;setImgSrc();}" backgroundAlpha="0" > <fx:Script> @@ -73,15 +74,15 @@ { slideshowXML = new XML(loader.data); setXMLDone=true; + rotations=new Object(); 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 var xmlfile:String=null; private function initialise(flashVars:Object):void { xmlfile=flashVars.xml; @@ -95,6 +96,7 @@ private var curFile:String; private var idx:Number=0; + private var urlIdx:Number=0; [Bindable] private var src1:String; [Bindable] private var src2:String; @@ -104,15 +106,22 @@ 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; + rotations[slideshowXML.Img[idx].URL[urlIdx].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; + rotations[slideshowXML.Img[idx].URL[urlIdx].toString()]= + Img2.rotation/90; } } + import mx.collections.ArrayCollection; + import spark.collections.Sort; + import spark.collections.SortField; + private var forcedByUsr:Boolean; + private var dynResolution:Boolean; private function setImgSrc():void { if(reloadTimer && reloadTimer.hasEventListener(TimerEvent.TIMER)){ @@ -126,7 +135,57 @@ CursorManager.setBusyCursor(); timeoutTimer.start(); isIOError=true; - curFile=slideshowXML.Img[idx].URL.toString(); + + urlIdx=0; + if(slideshowXML.Img[idx].URL.length()>1){ + var sizes:ArrayCollection = new ArrayCollection(); + for(var i:Number=0; i<slideshowXML.Img[idx].URL.length(); i++){ + var sizeStr:String=slideshowXML.Img[idx].URL[i].attribute("size"); + if(sizeStr.match(/^\s*[0-9]+x[0-9]+\s*$/)){ + var xsize:Number=Number(sizeStr.replace(/x[0-9]+/, "")); + var ysize:Number=Number(sizeStr.replace(/[0-9]+x/, "")); + sizes.addItem( + {size: xsize*ysize, index: i, x: xsize, y: ysize}); + } + } + if(sizes.length>0){ + dynResolution=true; + var sort:Sort = new Sort(); + sort.fields=[new SortField("size",true,true)]; + sizes.sort=sort;// ^--descending order + sizes.refresh(); + + urlIdx=sizes.getItemAt(0).index; + for(i=0; i<sizes.length; i++){ + if( + sizes.getItemAt(i).x >= this.width || + sizes.getItemAt(i).y >= this.height + ) urlIdx=sizes.getItemAt(i).index; + } + } + } + + curFile=slideshowXML.Img[idx].URL[urlIdx].toString(); + + var pattern:RegExp; + if(slideshowXML.Img[idx].URL[urlIdx].attribute('height').length() > 0){ + pattern = new RegExp( + slideshowXML.Img[idx].URL[urlIdx].attribute('height'), "g"); + if(curFile.search(pattern)>-1){ + dynResolution=true; + curFile=curFile.replace(pattern, this.toString()); + } + } + + if(slideshowXML.Img[idx].URL[urlIdx].attribute('width').length() > 0){ + pattern = new RegExp( + slideshowXML.Img[idx].URL[urlIdx].attribute('width'), "g"); + if(curFile.search(pattern)>-1){ + dynResolution=true; + curFile=curFile.replace(pattern, this.width.toString()); + } + } + if(Img1.visible) { src2=null; src2=curFile; } else { @@ -305,10 +364,10 @@ } }); - rotations=new Object(); timeoutTimer=new Timer(30000, 1); timeoutTimer.addEventListener(TimerEvent.TIMER, onAnyError); - curFile=xmlfile; setXML(xmlfile); + curFile=xmlfile; if(xmlfile) setXML(xmlfile); + CursorManager.hideCursor(); } private var isIOError:Boolean; @@ -322,7 +381,7 @@ src1=null; src1="/dev/null" } caption.text=e.type+': '+curFile; - if(caption.text==TimerEvent.TIMER) + if(e.type==TimerEvent.TIMER) caption.text="timeout after 30 s: "+curFile; CursorManager.removeBusyCursor(); }else{ @@ -350,8 +409,8 @@ slideNo.visible=slideNo.includeInLayout=false; } var curRot:Number=0; - if (rotations.hasOwnProperty(slideshowXML.Img[idx].URL.toString())) - curRot=rotations[slideshowXML.Img[idx].URL.toString()]; + if (rotations.hasOwnProperty(slideshowXML.Img[idx].URL[urlIdx].toString())) + curRot=rotations[slideshowXML.Img[idx].URL[urlIdx].toString()]; else curRot=Number(slideshowXML.Img[idx].attribute('rot90')); rotate(0); @@ -363,10 +422,10 @@ } else { caption.text=""; caption.visible=false; - } - if(!isReload) anim.play(); + } + if(!isReload) anim.play(); if(slideshowXML.Img[idx].attribute('live')>0) - cache.removeCacheEntry(slideshowXML.Img[idx].URL.toString()); + cache.removeCacheEntry(curFile); } CursorManager.removeBusyCursor(); isEnabled=true; @@ -420,7 +479,8 @@ <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);" + mouseOver="anim.play();CursorManager.showCursor();" + mouseOut="if(anim.isPlaying) anim.reverse(); else anim.play(null,true); + CursorManager.hideCursor();" /> </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 d3ef5e17fad..ff3dc7962b0 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 20150511 --> +<!-- version 20150601 --> <!-- --> <!-- --> <!-- The free Apache Flex 4 SDK is required to compile --> @@ -39,7 +39,7 @@ <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);" + preinitialize="initialise(this.parameters);" applicationComplete="initApp();" backgroundAlpha="0" > @@ -60,7 +60,6 @@ private var pauseAtPos:Number = -1; private var toBePaused:Boolean = false; - import mx.core.FlexGlobals; private function initialise(flashVars:Object):void { source=flashVars.source; if(flashVars.autoPlay=='true'){autoPlay=true} diff --git a/Master/texmf-dist/source/latex/media9/players/VPlayer9.mxml b/Master/texmf-dist/source/latex/media9/players/VPlayer9.mxml index 7d748112a95..5ecbaaf4d53 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 20150511 --> +<!-- version 20150601 --> <!-- --> <!-- Copyright (C) 2012-today Alexander Grahn --> <!-- --> @@ -24,7 +24,7 @@ <!-- --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" - preinitialize="initialise(Application.application.parameters);" + preinitialize="initialise(this.parameters);" applicationComplete="initApp();" backgroundAlpha="0" paddingTop="0" paddingBottom="0" |