Skip to content

Instantly share code, notes, and snippets.

@kyo-ago
Created December 21, 2011 08:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyo-ago/1505179 to your computer and use it in GitHub Desktop.
Save kyo-ago/1505179 to your computer and use it in GitHub Desktop.
purpleplayer.js Android fill-mode, transform patch
// 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