Sha256: 0bdf68b1266dd68af0109267e12f4e97f77b78780a4651bcd2a64348db5ec51c

Contents?: true

Size: 1.47 KB

Versions: 1

Compression:

Stored size: 1.47 KB

Contents

jQuery.webshims.register("mediaelement-native-fix",function(d,c,j,g){if(!Modernizr.videoBuffered){var e=function(a){var b=c.data(a,"mediaelementBuffered");b||(b={buffered:{start:function(a){if(a>=b.buffered.length)c.error("buffered index size error");else return 0},end:function(a){if(a>=b.buffered.length)c.error("buffered index size error");else return b.loaded},length:0},loaded:0},c.data(a,"mediaelementBuffered",b));return b},h=function(a){if((a=a.originalEvent)&&"lengthComputable"in a){var b=c.data(a.target,
"mediaelement");if(!(b&&"html5"!=b.isActive)&&a.lengthComputable&&"loaded"in a){var b=a.target.duration,f=e(a.target);f.loaded=b?a.loaded/a.total*b:0;if(f.loaded)f.buffered.length=1;"load"==a.type&&d(a.target).triggerHandler("progress")}}},i=function(a){a=e(a.target);a.buffered.length=0;a.loaded=0};["audio","video"].forEach(function(a){var b=c.defineNodeNameProperty(a,"buffered",{prop:{get:function(){var a=c.data(this,"mediaelement");if(a&&"flash"==a.isActive&&b.prop._supget)b.prop._supget.apply(this);
else return e(this).buffered}}})});(function(){var a=g.createElement("video");if(!("preload"in a)&&"autobuffer"in a){var b={metadata:1,none:1};c.onNodeNamesPropertyModify(["audio","video"],["preload"],{set:function(a,e,d){if(b[a]||"removeAttr"==d)this.autobuffer=!1;else if("html5"==!(c.data(this,"mediaelement")||{}).isActive)this.autobuffer=!0},initAttr:!0})}})();c.addReady(function(a,b){d("video, audio",a).add(b.filter("video, audio")).on("load progress",h).on("emptied",i)})}});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webshims-rails-0.4.4 vendor/assets/javascripts/webshims/minified/shims/mediaelement-native-fix.js