diff --git a/podlove-web-player/img/bigplay.png b/podlove-web-player/img/bigplay.png index e29165080..6c6d4ed01 100644 Binary files a/podlove-web-player/img/bigplay.png and b/podlove-web-player/img/bigplay.png differ diff --git a/podlove-web-player/img/deeplink.png b/podlove-web-player/img/deeplink.png new file mode 100644 index 000000000..b7f76619f Binary files /dev/null and b/podlove-web-player/img/deeplink.png differ diff --git a/podlove-web-player/mediaelement/flashmediaelement.swf b/podlove-web-player/mediaelement/flashmediaelement.swf index 19b9bda45..3e347aa23 100755 Binary files a/podlove-web-player/mediaelement/flashmediaelement.swf and b/podlove-web-player/mediaelement/flashmediaelement.swf differ diff --git a/podlove-web-player/mediaelement/mediaelement-and-player.js b/podlove-web-player/mediaelement/mediaelement-and-player.js index a3e8097af..7ba6f881f 100755 --- a/podlove-web-player/mediaelement/mediaelement-and-player.js +++ b/podlove-web-player/mediaelement/mediaelement-and-player.js @@ -11,147 +11,170 @@ * Dual licensed under the MIT or GPL Version 2 licenses. * */ -// Namespace -var mejs = mejs || {}; - -// version number -mejs.version = '2.9.1'; - -// 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/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']} - ], - vimeo: [ - {version: null, types: ['video/vimeo']} - ] +// Namespace +var mejs = mejs || {}; + +// version number +mejs.version = '2.9.5'; + +// 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']} + ], + vimeo: [ + {version: null, types: ['video/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 && obj.nodeName == "OBJECT") { + 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); + } + } }; - -/* -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; - }, - - /* 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 && obj.nodeName == "OBJECT") { - 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 @@ -759,6 +782,7 @@ Default options mejs.MediaElementDefaults = { // allows testing on HTML5, flash, silverlight // auto: attempts to detect what the browser can do + // auto_plugin: prefer plugins and then attempt native HTML5 // native: forces HTML5 playback // shim: disallows HTML5, will attempt either Flash or Silverlight // none: forces fallback view @@ -773,6 +797,8 @@ mejs.MediaElementDefaults = { pluginPath: mejs.Utility.getScriptPath(['mediaelement.js','mediaelement.min.js','mediaelement-and-player.js','mediaelement-and-player.min.js']), // name of flash file flashName: 'flashmediaelement.swf', + // streamer for RTMP streaming + flashStreamer: '', // turns on the smoothing filter in Flash enablePluginSmoothing: false, // name of silverlight file @@ -926,7 +952,7 @@ mejs.HtmlMediaElementShim = { // test for native playback first - if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'native')) { + if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'auto_plugin' || options.mode === 'native')) { if (!isMediaTag) { @@ -955,12 +981,15 @@ mejs.HtmlMediaElementShim = { htmlMediaElement.src = result.url; } - return result; + // if `auto_plugin` mode, then cache the native result but try plugins. + if (options.mode !== 'auto_plugin') { + return result; + } } } // if native playback didn't work, then test plugins - if (options.mode === 'auto' || options.mode === 'shim') { + if (options.mode === 'auto' || options.mode === 'auto_plugin' || options.mode === 'shim') { for (i=0; i 0) { result.url = mediaFiles[0].url; @@ -1026,7 +1061,26 @@ mejs.HtmlMediaElementShim = { getTypeFromFile: function(url) { var ext = url.substring(url.lastIndexOf('.') + 1); - return (/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + ext; + return (/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + this.getTypeFromExtension(ext); + }, + + getTypeFromExtension: function(ext) { + + switch (ext) { + case 'mp4': + case 'm4v': + return 'mp4'; + case 'webm': + case 'webma': + case 'webmv': + return 'webm'; + case 'ogg': + case 'oga': + case 'ogv': + return 'ogg'; + default: + return ext; + } }, createErrorMessage: function(playback, options, poster) { @@ -1122,6 +1176,7 @@ mejs.HtmlMediaElementShim = { 'width=' + width, 'startvolume=' + options.startVolume, 'timerrate=' + options.timerRate, + 'flashstreamer=' + options.flashStreamer, 'height=' + height]; if (playback.url !== null) { @@ -1218,7 +1273,7 @@ mejs.HtmlMediaElementShim = { // DEMO Code. Does NOT work. case 'vimeo': - console.log('vimeoid'); + //console.log('vimeoid'); pluginMediaElement.vimeoid = playback.url.substr(playback.url.lastIndexOf('/')+1); @@ -1516,6 +1571,7 @@ function onYouTubePlayerReady(id) { window.mejs = mejs; window.MediaElement = mejs.MediaElement; + /*! * MediaElementPlayer * http://mediaelementjs.com/ @@ -1532,1207 +1588,1223 @@ if (typeof jQuery != 'undefined') { } else if (typeof ender != 'undefined') { mejs.$ = ender; } -(function ($) { - - // default player values - mejs.MepDefaults = { - // url to poster (to fix iOS 3.x) - poster: '', - // default if the