Created
December 21, 2011 08:15
-
-
Save kyo-ago/1505179 to your computer and use it in GitHub Desktop.
purpleplayer.js Android fill-mode, transform patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this patch is BSD License @kyo_ago | |
Index: purpleplayer.js | |
=================================================================== | |
--- purpleplayer.js (revision 8175) | |
+++ purpleplayer.js (working copy) | |
@@ -239,6 +239,10 @@ | |
); | |
} | |
+function isAndroid(){ | |
+ return /android/i.test(navigator.userAgent) && jQuery.browser.webkit; | |
+} | |
+ | |
/* | |
Player: | |
@@ -413,6 +417,31 @@ | |
if(self.config.get('autostart') == true) { | |
self.stage.start(); | |
} | |
+ | |
+ if (!isAndroid()) { | |
+ return; | |
+ }; | |
+ $('.pNode, .pLevel0, .pLevel1, .pLevel2, .pImage').css({ | |
+ '-webkit-backface-visibility' : 'visible', | |
+ '-webkit-perspective' : 'none' | |
+ }); | |
+ $.each(self.config.settings.jsonData.childNodes, function () { | |
+ $.each(this.childNodes, function () { | |
+ var id = '#' + this.id; | |
+ $.each(this.animations, function () { | |
+ if (!this.animationFillMode || this.animationFillMode === 'none') { | |
+ return; | |
+ }; | |
+ var frame = this.keyframes[this.keyframes.length - 1]; | |
+ $(id).bind('webkitAnimationEnd', function () { | |
+ $(this).css({ | |
+ 'opacity' : frame.opacity, | |
+ '-webkit-transform' : frame.transform | |
+ }).removeClass('track0'); | |
+ }); | |
+ }); | |
+ }); | |
+ }); | |
}, | |
buildStage: function() { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment