[Pkg-javascript-commits] [jarisplayer] 17/80: improved aspect ratio toogle
Jonas Smedegaard
dr at jones.dk
Tue May 10 08:45:31 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 d77179dec1b2f3c8ba7953d68ed4058202d8f4f9
Author: jgmylm <jgmylm at edf201c3-a14d-0410-a11e-aa85364efa9f>
Date: Thu Mar 11 19:53:17 2010 +0000
improved aspect ratio toogle
git-svn-id: https://jaris.svn.sourceforge.net/svnroot/jaris/trunk@17 edf201c3-a14d-0410-a11e-aa85364efa9f
---
bin/JarisFLVPlayer.swf | Bin 20066 -> 20157 bytes
changes.txt | 6 +++++-
src/jaris/display/Menu.hx | 34 +++++++++++++++++++++++-----------
src/jaris/player/Player.hx | 32 ++++++++++++++++++++++----------
4 files changed, 50 insertions(+), 22 deletions(-)
diff --git a/bin/JarisFLVPlayer.swf b/bin/JarisFLVPlayer.swf
index 4bfc1db..212ecfb 100644
Binary files a/bin/JarisFLVPlayer.swf and b/bin/JarisFLVPlayer.swf differ
diff --git a/changes.txt b/changes.txt
index c8ea103..414f4d2 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,4 +1,8 @@
-Jaris FLV Player v2.0.4 beta - 03/11/2010
+Jaris FLV Player v2.0.5 beta - 03/11/2010
+
+ * Improved aspect ratio toogle when video aspect ratio is already on the aspect ratios list
+
+Jaris FLV Player v2.0.4 beta - 03/11/2010
* Fixed a drawing issue where seek bar after fullscreen stayed long
* Documented other parts of the code
diff --git a/src/jaris/display/Menu.hx b/src/jaris/display/Menu.hx
index e9f3835..eb9212c 100644
--- a/src/jaris/display/Menu.hx
+++ b/src/jaris/display/Menu.hx
@@ -49,10 +49,13 @@ class Menu
private var _volumeDownMenuItem:ContextMenuItem;
private var _qualityContextMenu:ContextMenuItem;
+ private var _currentAspectRatio:String;
+
public function new(player:Player)
{
_movieClip = Lib.current;
_player = player;
+ _currentAspectRatio = "original";
//Initialize context menu replacement
_contextMenu = new ContextMenu();
@@ -132,34 +135,43 @@ class Menu
_muteMenuItem.caption = _player.isFullscreen()?"Mute":"Mute (M)";
}
- switch(_player.getAspectRatio())
+ switch(_currentAspectRatio)
{
- case _player.getOriginalAspectRatio():
+ case "original":
_aspectRatioMenuItem.caption = "Aspect Ratio (1:1) (TAB)";
+ _currentAspectRatio = "1:1";
- case AspectRatio._1_1:
- _aspectRatioMenuItem.caption ="Aspect Ratio (3:2) (TAB)";
+ case "1:1":
+ _aspectRatioMenuItem.caption = "Aspect Ratio (3:2) (TAB)";
+ _currentAspectRatio = "3:2";
- case AspectRatio._3_2:
+ case "3:2":
_aspectRatioMenuItem.caption = "Aspect Ratio (4:3) (TAB)";
+ _currentAspectRatio = "4:3";
- case AspectRatio._4_3:
+ case "4:3":
_aspectRatioMenuItem.caption = "Aspect Ratio (5:4) (TAB)";
+ _currentAspectRatio = "5:4";
- case AspectRatio._5_4:
+ case "5:4":
_aspectRatioMenuItem.caption = "Aspect Ratio (14:9) (TAB)";
+ _currentAspectRatio = "14:9";
- case AspectRatio._14_9:
+ case "14:9":
_aspectRatioMenuItem.caption = "Aspect Ratio (14:10) (TAB)";
+ _currentAspectRatio = "14:10";
- case AspectRatio._14_10:
+ case "14:10":
_aspectRatioMenuItem.caption = "Aspect Ratio (16:9) (TAB)";
+ _currentAspectRatio = "16:9";
- case AspectRatio._16_9:
+ case "16:9":
_aspectRatioMenuItem.caption = "Aspect Ratio (16:10) (TAB)";
+ _currentAspectRatio = "16:10";
- case AspectRatio._16_10:
+ case "16:10":
_aspectRatioMenuItem.caption = "Aspect Ratio (original) (TAB)";
+ _currentAspectRatio = "original";
}
if (_player.getQuality())
diff --git a/src/jaris/player/Player.hx b/src/jaris/player/Player.hx
index a057f37..1a92a09 100644
--- a/src/jaris/player/Player.hx
+++ b/src/jaris/player/Player.hx
@@ -88,6 +88,7 @@ class Player extends EventDispatcher
private var _mediaDuration:Float;
private var _isPlaying:Bool;
private var _aspectRatio:Float;
+ private var _currentAspectRatio:String;
private var _originalAspectRatio:Float;
private var _mediaEndReached:Bool;
private var _seekPoints:Array<Float>;
@@ -126,6 +127,7 @@ class Player extends EventDispatcher
_streamType = StreamType.FILE;
_type = InputType.VIDEO;
_server = "";
+ _currentAspectRatio = "original";
//}
//{Initialize sound object
@@ -1019,37 +1021,47 @@ class Player extends EventDispatcher
*/
public function toggleAspectRatio():Float
{
- switch(_aspectRatio)
+ switch(_currentAspectRatio)
{
- case _originalAspectRatio:
+ case "original":
_aspectRatio = AspectRatio._1_1;
+ _currentAspectRatio = "1:1";
- case AspectRatio._1_1:
+ case "1:1":
_aspectRatio = AspectRatio._3_2;
+ _currentAspectRatio = "3:2";
- case AspectRatio._3_2:
+ case "3:2":
_aspectRatio = AspectRatio._4_3;
+ _currentAspectRatio = "4:3";
- case AspectRatio._4_3:
+ case "4:3":
_aspectRatio = AspectRatio._5_4;
+ _currentAspectRatio = "5:4";
- case AspectRatio._5_4:
+ case "5:4":
_aspectRatio = AspectRatio._14_9;
+ _currentAspectRatio = "14:9";
- case AspectRatio._14_9:
+ case "14:9":
_aspectRatio = AspectRatio._14_10;
+ _currentAspectRatio = "14:10";
- case AspectRatio._14_10:
+ case "14:10":
_aspectRatio = AspectRatio._16_9;
+ _currentAspectRatio = "16:9";
- case AspectRatio._16_9:
+ case "16:9":
_aspectRatio = AspectRatio._16_10;
+ _currentAspectRatio = "16:10";
- case AspectRatio._16_10:
+ case "16:10":
_aspectRatio = _originalAspectRatio;
+ _currentAspectRatio = "original";
default:
_aspectRatio = _originalAspectRatio;
+ _currentAspectRatio = "original";
}
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