vendor/assets/javascripts/webshims/shims/combos/12.js in webshims-rails-1.10.9 vs vendor/assets/javascripts/webshims/shims/combos/12.js in webshims-rails-1.10.10
- old
+ new
@@ -6,11 +6,11 @@
var swfmini = function() {
var UNDEF = "undefined",
OBJECT = "object",
- webshims = jQuery.webshims || window.webshims,
+ webshims = window.webshims,
SHOCKWAVE_FLASH = "Shockwave Flash",
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
FLASH_MIME_TYPE = "application/x-shockwave-flash",
win = window,
@@ -494,12 +494,13 @@
}
};
}();
-(function($, Modernizr, webshims){
+(function(Modernizr, webshims){
"use strict";
+ var $ = webshims.$;
var hasNative = Modernizr.audio && Modernizr.video;
var supportsLoop = false;
var bugs = webshims.bugs;
var swfType = 'mediaelement-jaris';
var loadSwf = function(){
@@ -599,10 +600,11 @@
webshims.register('mediaelement-core', function($, webshims, window, document, undefined){
hasSwf = swfmini.hasFlashPlayerVersion('9.0.115');
$('html').addClass(hasSwf ? 'swf' : 'no-swf');
var mediaelement = webshims.mediaelement;
+
mediaelement.parseRtmp = function(data){
var src = data.src.split('://');
var paths = src[1].split('/');
var i, len, found;
data.server = src[0]+'://'+paths[0]+'/';
@@ -768,11 +770,10 @@
srces = [];
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName);
if(!src.src){
-
$('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);}
});
} else {
@@ -783,22 +784,14 @@
mediaElem.removeAttr('src').removeAttr('type').find('source').remove();
if(!$.isArray(srces)){
srces = [srces];
}
srces.forEach(function(src){
- var source = document.createElement('source');
if(typeof src == 'string'){
src = {src: src};
}
- source.setAttribute('src', src.src);
- if(src.type){
- source.setAttribute('type', src.type);
- }
- if(src.media){
- source.setAttribute('media', src.media);
- }
- mediaElem.append(source);
+ mediaElem.append($(document.createElement('source')).attr(src));
});
}
};
@@ -942,10 +935,13 @@
clearTimeout(baseData.loadTimer);
$.data(elem, 'mediaerror', false);
if(!_srces.length || !parent || parent.nodeType != 1 || stopParent.test(parent.nodeName || '')){return;}
data = data || webshims.data(elem, 'mediaelement');
+ if(mediaelement.sortMedia){
+ _srces.sort(mediaelement.sortMedia);
+ }
stepSources(elem, data, options.preferFlash || undefined, _srces);
};
mediaelement.selectSource = selectSource;
@@ -1116,10 +1112,10 @@
} else {
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);
});
-})(jQuery, Modernizr, webshims);
+})(Modernizr, webshims);
webshims.register('track', function($, webshims, window, document, undefined){
"use strict";
var mediaelement = webshims.mediaelement;
var id = new Date().getTime();
var ADDBACK = $.fn.addBack ? 'addBack' : 'andSelf';
\ No newline at end of file