diff --git a/wp-includes/js/mediaelement/flashmediaelement.swf b/wp-includes/js/mediaelement/flashmediaelement.swf index b728fe6d8f..33c8d98f50 100644 Binary files a/wp-includes/js/mediaelement/flashmediaelement.swf and b/wp-includes/js/mediaelement/flashmediaelement.swf differ diff --git a/wp-includes/js/mediaelement/mediaelement-and-player.js b/wp-includes/js/mediaelement/mediaelement-and-player.js index bb49d6094a..048c8f0dea 100644 --- a/wp-includes/js/mediaelement/mediaelement-and-player.js +++ b/wp-includes/js/mediaelement/mediaelement-and-player.js @@ -10,1808 +10,59 @@ * Copyright 2010-2012, John Dyer (http://j.hn) * License: MIT * -*/ -// Namespace -var mejs = mejs || {}; - -// version number -mejs.version = '2.11.0'; - -// player number (for missing, same id attr) -mejs.meIndex = 0; - -// media types accepted by plugins -mejs.plugins = { - silverlight: [ - {version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']} - ], - flash: [ - {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/rtmp','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']} - //,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!) - ], - youtube: [ - {version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']} - ], - vimeo: [ - {version: null, types: ['video/vimeo', 'video/x-vimeo']} - ] -}; - - -/* -Utility methods -*/ -mejs.Utility = { - encodeUrl: function(url) { - return encodeURIComponent(url); //.replace(/\?/gi,'%3F').replace(/=/gi,'%3D').replace(/&/gi,'%26'); - }, - escapeHTML: function(s) { - return s.toString().split('&').join('&').split('<').join('<').split('"').join('"'); - }, - absolutizeUrl: function(url) { - var el = document.createElement('div'); - el.innerHTML = 'x'; - return el.firstChild.href; - }, - getScriptPath: function(scriptNames) { - var - i = 0, - j, - path = '', - name = '', - script, - scripts = document.getElementsByTagName('script'), - il = scripts.length, - jl = scriptNames.length; - - for (; i < il; i++) { - script = scripts[i].src; - for (j = 0; j < jl; j++) { - name = scriptNames[j]; - if (script.indexOf(name) > -1) { - path = script.substring(0, script.indexOf(name)); - break; - } - } - if (path !== '') { - break; - } - } - return path; - }, - secondsToTimeCode: function(time, forceHours, showFrameCount, fps) { - //add framecount - if (typeof showFrameCount == 'undefined') { - showFrameCount=false; - } else if(typeof fps == 'undefined') { - fps = 25; - } - - var hours = Math.floor(time / 3600) % 24, - minutes = Math.floor(time / 60) % 60, - seconds = Math.floor(time % 60), - frames = Math.floor(((time % 1)*fps).toFixed(3)), - result = - ( (forceHours || hours > 0) ? (hours < 10 ? '0' + hours : hours) + ':' : '') - + (minutes < 10 ? '0' + minutes : minutes) + ':' - + (seconds < 10 ? '0' + seconds : seconds) - + ((showFrameCount) ? ':' + (frames < 10 ? '0' + frames : frames) : ''); - - return result; - }, - - timeCodeToSeconds: function(hh_mm_ss_ff, forceHours, showFrameCount, fps){ - if (typeof showFrameCount == 'undefined') { - showFrameCount=false; - } else if(typeof fps == 'undefined') { - fps = 25; - } - - var tc_array = hh_mm_ss_ff.split(":"), - tc_hh = parseInt(tc_array[0], 10), - tc_mm = parseInt(tc_array[1], 10), - tc_ss = parseInt(tc_array[2], 10), - tc_ff = 0, - tc_in_seconds = 0; - - if (showFrameCount) { - tc_ff = parseInt(tc_array[3])/fps; - } - - tc_in_seconds = ( tc_hh * 3600 ) + ( tc_mm * 60 ) + tc_ss + tc_ff; - - return tc_in_seconds; - }, - - - convertSMPTEtoSeconds: function (SMPTE) { - if (typeof SMPTE != 'string') - return false; - - SMPTE = SMPTE.replace(',', '.'); - - var secs = 0, - decimalLen = (SMPTE.indexOf('.') != -1) ? SMPTE.split('.')[1].length : 0, - multiplier = 1; - - SMPTE = SMPTE.split(':').reverse(); - - for (var i = 0; i < SMPTE.length; i++) { - multiplier = 1; - if (i > 0) { - multiplier = Math.pow(60, i); - } - secs += Number(SMPTE[i]) * multiplier; - } - return Number(secs.toFixed(decimalLen)); - }, - - /* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */ - removeSwf: function(id) { - var obj = document.getElementById(id); - if (obj && /object|embed/i.test(obj.nodeName)) { - if (mejs.MediaFeatures.isIE) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - mejs.Utility.removeObjectInIE(id); - } else { - setTimeout(arguments.callee, 10); - } - })(); - } else { - obj.parentNode.removeChild(obj); - } - } - }, - removeObjectInIE: function(id) { - var obj = document.getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - } -}; - - -// Core detector, plugins are added below -mejs.PluginDetector = { - - // main public function to test a plug version number PluginDetector.hasPluginVersion('flash',[9,0,125]); - hasPluginVersion: function(plugin, v) { - var pv = this.plugins[plugin]; - v[1] = v[1] || 0; - v[2] = v[2] || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - }, - - // cached values - nav: window.navigator, - ua: window.navigator.userAgent.toLowerCase(), - - // stored version numbers - plugins: [], - - // runs detectPlugin() and stores the version number - addPlugin: function(p, pluginName, mimeType, activeX, axDetect) { - this.plugins[p] = this.detectPlugin(pluginName, mimeType, activeX, axDetect); - }, - - // get the version number from the mimetype (all but IE) or ActiveX (IE) - detectPlugin: function(pluginName, mimeType, activeX, axDetect) { - - var version = [0,0,0], - description, - i, - ax; - - // Firefox, Webkit, Opera - if (typeof(this.nav.plugins) != 'undefined' && typeof this.nav.plugins[pluginName] == 'object') { - description = this.nav.plugins[pluginName].description; - if (description && !(typeof this.nav.mimeTypes != 'undefined' && this.nav.mimeTypes[mimeType] && !this.nav.mimeTypes[mimeType].enabledPlugin)) { - version = description.replace(pluginName, '').replace(/^\s+/,'').replace(/\sr/gi,'.').split('.'); - for (i=0; i element for fullscreen detection - for (i=0; i or