summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-01-21 23:44:06 +0000
committerKarl Berry <karl@freefriends.org>2015-01-21 23:44:06 +0000
commitb75ee24c55627af0be9aa61c350f4fc09662584b (patch)
tree11f8617b4f4450315a0a691b6732aa8310290171 /Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
parentc9c2fdfb6c939de3cc60075093a9489947a08536 (diff)
media9 (21jan15)
git-svn-id: svn://tug.org/texlive/trunk@36112 c570f23f-e606-0410-a88d-b1316a301751
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.mxml294
1 files changed, 0 insertions, 294 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
deleted file mode 100644
index 02c684ffe32..00000000000
--- a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
+++ /dev/null
@@ -1,294 +0,0 @@
-<?xml version="1.0"?>
-<!-- -->
-<!-- Adobe Flex 3 source file of VPlayer9.swf, -->
-<!-- a FlashPlayer-9 compatible component for playing -->
-<!-- FLV and MP4/H.264 video files and streams. -->
-<!-- -->
-<!-- version 20140625 -->
-<!-- -->
-<!-- Copyright (C) 2012-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. -->
-<!-- -->
-
-<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
- preinitialize="initialise(Application.application.parameters);"
- creationComplete="init();"
- backgroundAlpha="0"
- paddingTop="0" paddingBottom="0"
- paddingLeft="0" paddingRight="0"
- layout="absolute" clipContent="false"
->
- <mx:Script>
- <![CDATA[
- [Bindable] private var source:String;
- [Bindable] private var autoPlay:Boolean=false;
- [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;
- private var vidComplete:Boolean=false;
- private var deltaSeek:Number;
- private var playheadTime:Number;
- private var newPos:Number;
- 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 {
- 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}
- }
-
- private function onProgress(event:ProgressEvent):void {
- if (event.bytesTotal) event.target.visible=true;
- else event.target.visible=false;
- }
-
- import mx.events.VideoEvent;
- import mx.controls.Alert;
- private function onStateChange(event:VideoEvent):void {
- vidComplete=false;
- if(event.state=='connectionError')
- Alert.show('Unable to play \''+event.target.source+'\'','Error');
- }
-
- private function onKeyDown(e:KeyboardEvent):void {
- switch(e.keyCode) {
- case 32: //space bar
- playPause();
- break;
- case 36: //home
- vidDisp.pause();
- vidDisp.playheadTime=0;
- break;
- case 35: //end
- if(vidDisp.bytesTotal){
- vidDisp.pause();
- vidDisp.playheadTime=vidDisp.totalTime-0.1;
- }
- break;
- case 37: //<--
- fadeEffect.end();
- playProgress.alpha=0.5;
- playProgress.visible=true;
- if(!keyPressed){
- deltaSeek=Math.max(1,vidDisp.totalTime/1000);
- playheadTime=vidDisp.playheadTime;
- }
- keyPressed=true;
- newPos=Math.max(0,playheadTime-deltaSeek);
- playProgress.setProgress(newPos,vidDisp.totalTime);
- playProgress.label=formatTime(newPos);
- vidDisp.playheadTime=newPos;
- deltaSeek*=1.1;
- break;
- case 39: //-->
- fadeEffect.end();
- playProgress.alpha=0.5;
- playProgress.visible=true;
- if(!keyPressed){
- deltaSeek=Math.max(1,vidDisp.totalTime/1000);
- playheadTime=vidDisp.playheadTime;
- }
- keyPressed=true;
- newPos=Math.min(vidDisp.totalTime-0.1,playheadTime+deltaSeek);
- playProgress.setProgress(newPos,vidDisp.totalTime);
- playProgress.label=formatTime(newPos);
- vidDisp.playheadTime=newPos;
- deltaSeek*=1.1;
- break;
- case 38:
- vol=Math.min(1,vol+0.025);
- volume(vol);
- break;
- case 40:
- vol=Math.max(0,vol-0.025);
- volume(vol);
- break;
- default:
- if(e.charCode==109) mute(); //`m'
- }
- }
-
- private function onKeyUp(e:KeyboardEvent):void {
- switch(e.keyCode) {
- case 37: //<--
- case 39: //-->
- deltaSeek=Math.max(1,vidDisp.totalTime/1000);
- keyPressed=false;
- fadeEffect.play();
- break;
- }
- }
-
- private function onEnterFrame(e:Event):void {
- if(stepping&&vidDisp.playing){vidDisp.pause();}
- }
-
- 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(p:Number=-1):void {
- if(p>=0){pauseAtPos=p;return;}
- vidDisp.pause();
- }
-
- private function playPause():void {
- if(vidDisp.playing) vidDisp.pause(); else vidDisp.play();
- }
-
- private function seek(p:Number):void {
- vidDisp.playheadTime=p;
- }
-
- private function step():void {
- if(stepping){stepping=false;}else{stepping=true;}
- }
-
- private function rewind():void {
- vidDisp.playheadTime=0;
- }
-
- private function volume(v:Number):void {
- muted=false;
- vidDisp.volume = v;
- }
-
- private function mute():void {
- if(muted) {
- if (lastVolume==0) volume(0.75);
- else volume(lastVolume);
- }
- else {
- muted=true;lastVolume=vidDisp.volume;vidDisp.volume=0;
- }
- }
-
- private function setSource(s:String):void {
- vidDisp.pause();vidDisp.source = s;
- vidDisp.play();vidDisp.pause();
- vidDisp.playheadTime=0;
- }
-
- private function formatTime(s:Number):String {
- var hrs:Number = Math.floor(s / 3600);
- var min:Number = Math.floor(s / 60 % 60);
- var sec:Number = Math.floor(s % 60);
-
- var fmtd:String='';
-
- if (hrs>0) fmtd = String(hrs)+':';
-
- if (hrs>0 && min <10) fmtd+='0';
- fmtd += String(min)+':';
-
- if (sec<10) fmtd+='0';
- fmtd += String(sec);
-
- 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);
- this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
- this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
- ExternalInterface.addCallback("play", play);
- ExternalInterface.addCallback("pause", pause);
- ExternalInterface.addCallback("playPause", playPause);
- ExternalInterface.addCallback("seek", seek);
- ExternalInterface.addCallback("rewind", rewind);
- ExternalInterface.addCallback("volume", volume);
- 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>
-
- <mx:Fade id="fadeEffect" target="{playProgress}" alphaFrom="0.5" alphaTo="0" duration="2000"
- effectEnd="playProgress.label=''"
- />
-
- <mx:VideoDisplay
- id="vidDisp"
- width="100%" height="100%" maintainAspectRatio="{letterbox}"
- 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();"
- playheadUpdate="onPlayheadUpdate(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)"
- />
-
- <mx:ProgressBar width="100%" mode="manual"
- horizontalCenter="0" bottom="0" labelPlacement="center"
- id="playProgress" alpha="0.5"
- visible="false"
- />
-</mx:Application>