[Pkg-javascript-commits] [jarisplayer] 31/80: Added flashvar to pass the aspect ratio.
Jonas Smedegaard
dr at jones.dk
Tue May 10 08:45:33 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository jarisplayer.
commit dd410be0945ccfd887036e6233b39e782714c5df
Author: jgmylm <jgmylm at edf201c3-a14d-0410-a11e-aa85364efa9f>
Date: Wed Sep 29 04:09:24 2010 +0000
Added flashvar to pass the aspect ratio.
git-svn-id: https://jaris.svn.sourceforge.net/svnroot/jaris/trunk@31 edf201c3-a14d-0410-a11e-aa85364efa9f
---
bin/JarisFLVPlayer.swf | Bin 20730 -> 21298 bytes
changes.txt | 6 +++++-
documentation.txt | 3 +++
src/jaris/Main.hx | 25 +++++++++++++++++++++++++
src/jaris/player/Player.hx | 40 ++++++++++++++++++++++++++++++++++++++--
5 files changed, 71 insertions(+), 3 deletions(-)
diff --git a/bin/JarisFLVPlayer.swf b/bin/JarisFLVPlayer.swf
index a5c4794..4e35cdc 100644
Binary files a/bin/JarisFLVPlayer.swf and b/bin/JarisFLVPlayer.swf differ
diff --git a/changes.txt b/changes.txt
index 394ba1a..97586fb 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,4 +1,8 @@
-Jaris FLV Player v2.0.9 beta - 26/05/2010
+Jaris FLV Player v2.0.10 beta - 29/09/2010
+
+ * Added flashvar aspectratio option to initially tell on wich aspect ratio to play the video
+
+Jaris FLV Player v2.0.9 beta - 26/05/2010
* Improved poster to keep aspect ratio and display back when playback finishes
diff --git a/documentation.txt b/documentation.txt
index a9515ac..3656d7e 100644
--- a/documentation.txt
+++ b/documentation.txt
@@ -98,6 +98,9 @@ Here is the list of variables that you can pass to the player.
* hovercolor:
On mouse hover color for controls in html hexadecimal format
+
+ * aspectratio:
+ To override original aspect ratio on first time player load. Allowable values: 1:1, 3:2, 4:3, 5:4, 14:9, 14:10, 16:9, 16:10
==================
Keyboard Shortcuts
diff --git a/src/jaris/Main.hx b/src/jaris/Main.hx
index f4090e8..99a2be9 100644
--- a/src/jaris/Main.hx
+++ b/src/jaris/Main.hx
@@ -36,6 +36,7 @@ import jaris.player.controls.Controls;
import jaris.player.InputType;
import jaris.player.Player;
import jaris.player.StreamType;
+import jaris.player.AspectRatio;
/**
* Main jaris player starting point
@@ -65,6 +66,30 @@ class Main
var type:String = parameters.type != "" && parameters.type != null? parameters.type : InputType.VIDEO;
var streamType:String = parameters.streamtype != "" && parameters.streamtype != null? parameters.streamtype : StreamType.FILE;
var server:String = parameters.server != "" && parameters.server != null? parameters.server : "";
+ var aspectRatio:String = parameters.aspectratio != "" && parameters.aspectratio != null? parameters.aspectratio : "";
+
+ if (aspectRatio != "")
+ {
+ switch(aspectRatio)
+ {
+ case "1:1":
+ player.setAspectRatio(AspectRatio._1_1);
+ case "3:2":
+ player.setAspectRatio(AspectRatio._3_2);
+ case "4:3":
+ player.setAspectRatio(AspectRatio._4_3);
+ case "5:4":
+ player.setAspectRatio(AspectRatio._5_4);
+ case "14:9":
+ player.setAspectRatio(AspectRatio._14_9);
+ case "14:10":
+ player.setAspectRatio(AspectRatio._14_10);
+ case "16:9":
+ player.setAspectRatio(AspectRatio._16_9);
+ case "16:10":
+ player.setAspectRatio(AspectRatio._16_10);
+ }
+ }
player.setType(type);
player.setStreamType(streamType);
diff --git a/src/jaris/player/Player.hx b/src/jaris/player/Player.hx
index 6ee8d0b..a3aabba 100644
--- a/src/jaris/player/Player.hx
+++ b/src/jaris/player/Player.hx
@@ -54,6 +54,7 @@ import flash.ui.Mouse;
import flash.utils.Timer;
import jaris.events.PlayerEvents;
import jaris.utils.Utils;
+import jaris.player.AspectRatio;
/**
* Jaris main video player
@@ -126,6 +127,7 @@ class Player extends EventDispatcher
_type = InputType.VIDEO;
_server = "";
_currentAspectRatio = "original";
+ _aspectRatio = 0;
//}
//{Initialize sound object
@@ -452,8 +454,12 @@ class Player extends EventDispatcher
_mediaLoaded = true;
_mediaDuration = data.duration;
- _aspectRatio = AspectRatio.getAspectRatio(_videoWidth, _videoHeight);
- _originalAspectRatio = _aspectRatio;
+ _originalAspectRatio = AspectRatio.getAspectRatio(_videoWidth, _videoHeight);
+
+ if (_aspectRatio <= 0)
+ {
+ _aspectRatio = _originalAspectRatio;
+ }
callEvents(PlayerEvents.MEDIA_INITIALIZED);
@@ -1425,6 +1431,36 @@ class Player extends EventDispatcher
{
_aspectRatio = aspectRatio;
+ switch(_aspectRatio)
+ {
+ case 0.0:
+ _currentAspectRatio = "original";
+
+ case AspectRatio._1_1:
+ _currentAspectRatio = "1:1";
+
+ case AspectRatio._3_2:
+ _currentAspectRatio = "3:2";
+
+ case AspectRatio._4_3:
+ _currentAspectRatio = "4:3";
+
+ case AspectRatio._5_4:
+ _currentAspectRatio = "5:4";
+
+ case AspectRatio._14_9:
+ _currentAspectRatio = "14:9";
+
+ case AspectRatio._14_10:
+ _currentAspectRatio = "14:10";
+
+ case AspectRatio._16_9:
+ _currentAspectRatio = "16:9";
+
+ case AspectRatio._16_10:
+ _currentAspectRatio = "16:10";
+ }
+
resizeAndCenterPlayer();
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jarisplayer.git
More information about the Pkg-javascript-commits
mailing list