diff options
Diffstat (limited to 'chimere/static/jme/packages')
| -rw-r--r-- | chimere/static/jme/packages/jmefs.swf | bin | 0 -> 12040 bytes | |||
| -rw-r--r-- | chimere/static/jme/packages/mm.embed.js | 1166 | ||||
| -rw-r--r-- | chimere/static/jme/packages/mm.embed.min.js | 41 | ||||
| -rw-r--r-- | chimere/static/jme/packages/mm.full.js | 2732 | ||||
| -rw-r--r-- | chimere/static/jme/packages/mm.full.min.js | 90 | ||||
| -rw-r--r-- | chimere/static/jme/packages/player-swf-readme.html | 58 | ||||
| -rw-r--r-- | chimere/static/jme/packages/player.swf | bin | 0 -> 106407 bytes | |||
| -rw-r--r-- | chimere/static/jme/packages/yt.swf | bin | 0 -> 1136 bytes |
8 files changed, 4087 insertions, 0 deletions
diff --git a/chimere/static/jme/packages/jmefs.swf b/chimere/static/jme/packages/jmefs.swf Binary files differnew file mode 100644 index 0000000..a8b2ba7 --- /dev/null +++ b/chimere/static/jme/packages/jmefs.swf diff --git a/chimere/static/jme/packages/mm.embed.js b/chimere/static/jme/packages/mm.embed.js new file mode 100644 index 0000000..3213893 --- /dev/null +++ b/chimere/static/jme/packages/mm.embed.js @@ -0,0 +1,1166 @@ +/**! + * Part of the jMediaelement-Project vpre1.3.5 | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ + +(function($){ + $.multimediaSupport = {}; + var m = $.multimediaSupport, + vID = new Date().getTime(), + doc = document, + tVid = $('<video />')[0], + //this bad assumption isn't really true, but our workaround-implementation doesn't really hurt + supportMediaPreload = !( 'webkitPreservesPitch' in tVid && parseFloat($.browser.version, 10) < 535 && (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Mac') === -1) ) + ; + // support test + document.createElement trick + $.support.video = !!(tVid.canPlayType); + $.support.autoBuffer = !!('autobuffer' in tVid); + $.support.audio = !!($('<audio />')[0].canPlayType); + + tVid = null; + + $('<source />'); + $('<track />'); + + $.support.mediaElements = ($.support.video && $.support.audio); + $.support.dynamicHTML5 = !!($('<video><div></div></video>')[0].innerHTML); + $.support.mediaLoop = ('loop' in $('<video />')[0]); + $.browser.deprecatedPoster = !supportMediaPreload; + + // HTML5 shiv document.createElement does not work with dynamic inserted elements + // thanks to jdbartlett for this simple script + // see also http://jdbartlett.github.com/innershiv/ + $.fixHTML5 = (function(){ + var d, b; + return ($.support.dynamicHTML5) ? + function(h){return h;} : + function(h) { + if (!d) { + b = document.body; + d = document.createElement('div'); + d.style.display = 'none'; + } + var e = d.cloneNode(false); + b.appendChild(e); + e.innerHTML = h; + b.removeChild(e); + return e.childNodes; + } + ; + })(); + + + + var cssShow = { left: "0px", position: "absolute", visibility: "hidden", display:"block" }, + dimStyles = ['float'] + ; + + $.each(['Top', 'Left', 'Right', 'Bottom'], function(i, name){ + dimStyles.push('margin'+ name); + dimStyles.push('padding'+ name); + dimStyles.push('border'+ name +'Width'); + setTimeout(function(){ + m._transferStyles.push('border'+ name +'Color'); + m._transferStyles.push('border'+ name +'Style'); + }, 1); + }); + $.fn.getDimensions = function(){ + var ret = {width: 0, height: 0}; + if(this[0]){ + var elem = this, + elmS = this[0].style + ; + // assume that inline style is correct + // enables %, em etc. feature with inline-style (i.e.: 100%) + ret.height = elmS.height || this.height(); + ret.width = elmS.width || this.width(); + $.each(dimStyles, function(i, name){ + // assume that inline style is correct + ret[name] = elmS[name] || elem.css(name); + }); + } + return ret; + }; + + + + var oldAttr = $.attr, + attrElems = /video|audio|source/i, + srcNames = { + src: 1, + poster: 1 + }, + booleanNames = { + loop: 1, + autoplay: 1, + controls: 1 + }, + mixedNames = { + srces: 1, + getConfig: 1, + preload: 1 + }, + preloadVals = { + auto: 1, + metadata: 1, + none: 1 + } + ; + + var fixPreload = { + change: function(elem, setPreload, force){ + if( !$.support.mediaElements ){return;} + var _preload = elem.getAttribute('preload') || 'metadata'; + if( force || setPreload !== _preload ){ + if( !supportMediaPreload ){ + if( setPreload === 'none' || (_preload === 'none' && (setPreload === 'auto' || !elem.getAttribute('poster')) ) ){ + $(elem).unbind('play', fixPreload.changePlayMode); + if(setPreload === 'none'){ + $(elem).bind('play', fixPreload.changePlayMode); + } + $.attr(elem, 'srces', $.attr(elem, 'srces'), setPreload); + } + } else if( $.support.autoBuffer ){ + elem.autobuffer = !!(setPreload === 'auto'); + } + } + }, + changeAutoplay: function(elem, autoplay){ + if( $.support.mediaElements && !supportMediaPreload && $.attr(elem, 'preload') === 'none' && autoplay !== $.attr(elem, 'autoplay')){ + var srces = $.attr(elem, 'srces'); + $.attr(elem, 'srces', srces, 'auto'); + if( srces.length && autoplay ){ + setTimeout(function(){ + if(elem.play && $(elem).getMediaAPI() === 'nativ' ){ + elem.play(); + } + }, 9); + } + } + }, + changePlayMode: function(){ + fixPreload.changeAutoplay(this, true); + }, + addSrces: function(elem, srces, preload){ + if( supportMediaPreload || !$.support.mediaElements ){ + return false; + } + + preload = preload || $.attr(elem, 'preload'); + $(elem).unbind('play', fixPreload.changePlayMode); + if( preload === 'auto' || $.attr(elem, 'autoplay') ){return $.data(elem, 'jme-srces', false);} + $(elem).bind('play', fixPreload.changePlayMode); + $.data(elem, 'jme-srces', srces); + return true; + } + }; + $.attr = function(elem, name, value, preloadPass){ + + if( !(elem.nodeName && attrElems.test(elem.nodeName) && (mixedNames[name] || booleanNames[name] || srcNames[name])) ){ + return oldAttr(elem, name, value, preloadPass); + } + + var set = (value !== undefined), elemName, api, ret; + + if(!set){ + if(booleanNames[name]){ + return ( typeof elem[name] === 'boolean' ) ? elem[name] : !!((elem.attributes[name] || {}).specified); + } + if(srcNames[name]){ + return $.support.video && elem[name] || m.makeAbsURI(elem.getAttribute(name)); + } + switch(name) { + case 'srces': + ret = $.data(elem, 'jme-srces'); + if(ret){break;} + + ret = $.attr(elem, 'src'); + if( ret ){ + ret = [{ + src: ret, + type: elem.getAttribute('type'), + media: elem.getAttribute('media') + }] + ; + } else { + ret = []; + $('source', elem).each(function(i){ + ret.push({ + src: $.attr(this, 'src'), + type: this.getAttribute('type'), + media: this.getAttribute('media') + }); + }); + // safari without quicktime ignores source-tags, initially + if(!ret.length){ + $('a.source', elem).each(function(){ + ret.push({ + src: this.href, + type: this.getAttribute('type'), + media: this.getAttribute('data-media') + }); + }); + } + } + break; + case 'getConfig': + ret = {}; + $.each(['autoplay', 'loop', 'controls', 'poster', 'preload'], function(i, name){ + ret[name] = $.attr(elem, name); + }); + break; + case 'preload': + ret = elem.preload || elem.getAttribute('preload'); + if(ret === ''){ + ret = 'auto'; + } + if(!preloadVals[ret]){ + ret = 'metadata'; + } + break; + } + return ret; + } else { + if(booleanNames[name]){ + value = !!(value); + elem[name] = value; + if(name === 'autoplay'){ + fixPreload.changeAutoplay(elem, value); + } + if(value){ + elem[name] = value; + elem.setAttribute(name, name); + } else { + elem[name] = value; + elem.removeAttribute(name); + } + } else if(srcNames[name]){ + elem.setAttribute(name, value); + } else if (name === 'srces') { + $('source, a.source', elem).remove(); + elem.removeAttribute('src'); + value = $.isArray(value) ? value : [value]; + if(fixPreload.addSrces(elem, value, preloadPass)){return;} + $.each(value, function(i, src){ + + ret = doc.createElement('source'); + if(typeof src === 'string'){ + src = {src: src}; + } + ret.setAttribute('src', src.src); + if(src.type){ + ret.setAttribute('type', src.type); + } + if(src.media){ + ret.setAttribute('media', src.media); + } + elem.appendChild(ret); + }); + } else if(name === 'getConfig'){ + //works, but you shouldn´t use as a setter + $.each(value, function(n, v){ + $.attr(elem, n, v); + }); + } else if(name === 'preload'){ + if(value === ''){ + value = 'auto'; + } else if(!preloadVals[value]){ + value = 'metadata'; + } + fixPreload.change(elem, value, preloadPass); + elem.setAttribute(name, value); + } + } + }; + + function sourceError(){ + $.event.special.mediaerror.handler.apply($(this).closest('video, audio')[0], arguments); + } + + function bindSource(e){ + if(!$.support.mediaElements){return;} + + var apis = $.data(this, 'mediaElemSupport'); + if(!apis || !apis.apis){return;} + //reset error + if(e && e.type){ + $.data(this, 'calledMediaError', false); + } + apis = apis.apis; + + //webkit is really stupid with the error event, so fallback to canPlaytype + var elem = this, + srces = $.attr(this, 'srces') + ; + + if( elem.error || (srces.length && !apis.nativ.canPlaySrces(srces)) ){ + $.event.special.mediaerror.handler.call(this, $.Event('mediaerror')); + //stop trying to play + try { + elem.pause(); + } catch(er){} + } + + //bind error + $('source', this) + .unbind('error', sourceError) + .filter(':last') + .bind('error', sourceError) + ; + } + + $.event.special.mediaerror = { + setup: function(){ + //ff always triggers an error on video/audio | w3c/webkit/opera triggers error event on source, if available + var media = $(this) + .bind('error', $.event.special.mediaerror.handler) + //older webkit do not support emptied + .bind('native_mediareset', bindSource) + ; + //bindSource can trigger mediaerror, but event is always bound after setup + setTimeout(function(){ + media.each(bindSource); + }, 0); + }, + teardown: function(){ + $(this) + .unbind('error', $.event.special.mediaerror.handler) + .find('source') + .unbind('error', sourceError) + ; + }, + handler: function(e){ + if($.data(this, 'calledMediaError')){return;} + e = $.extend({}, e || {}, {type: 'mediaerror'}); + $.data(this, 'calledMediaError', true); + return $.event.handle.apply(this, arguments); + } + }; + + m.getExt = function(src){ + var pos = src.indexOf('?'), + ext = '' + ; + src = (pos > 0) ? src.substring(0, pos) : src; + pos = src.lastIndexOf('.') + 1; + ext = src.substr(pos); + return (ext && ext.toLowerCase) ? ext.toLowerCase() : ext; + }; + + + var getExt = m.getExt; + var mimeTypes = { + audio: { + //ogm shouldn´t be used! + 'audio/ogg': ['ogg','oga', 'ogm'], + 'audio/mpeg': ['mp2','mp3','mpga','mpega'], + 'audio/mp4': ['mp4','mpg4', 'm4r'], + 'audio/wav': ['wav'], + 'audio/x-m4a': ['m4a'], + 'audio/x-m4p': ['m4p'], + 'audio/3gpp': ['3gp','3gpp'], + 'audio/webm': ['webm'] + }, + video: { + //ogm shouldn´t be used! + 'video/ogg': ['ogg','ogv', 'ogm'], + 'video/mpeg': ['mpg','mpeg','mpe'], + 'video/mp4': ['mp4','mpg4', 'm4v'], + 'video/quicktime': ['mov','qt'], + 'video/x-msvideo': ['avi'], + 'video/x-ms-asf': ['asf', 'asx'], + 'video/flv': ['flv', 'f4v'], + 'video/3gpp': ['3gp','3gpp'], + 'video/webm': ['webm'] + } + } + ; + + + $.extend(m, { + jsPath: (function(){ + var scripts = $('script'), + path = scripts[scripts.length - 1].src.split('?')[0] + ; + return path.slice(0, path.lastIndexOf("/") + 1); + })(), + extendWithData: (function(){ + var allowedVals ={ + string: 1, + number: 1, + 'boolean': 1 + }; + return function(elem, target, obj){ + if(!obj){ + obj = target; + } + $.each(obj, $.isArray(obj) ? + function(i, name){ + m.getData(elem, name, target); + } : + function(name, val){ + if(allowedVals[typeof val]){ + m.getData(elem, name, target); + } + } + ); + return target; + }; + })(), + getData: (function(){ + var getVal = function(elem, name){ + var val = elem.getAttribute('data-'+ name); + if(!val && val !== ''){ + return undefined; + } + + return (val * 1 == val) ? + parseFloat(val, 10) : + (val === 'false') ? + false : + (val === 'true') ? + true : + val + ; + }; + return function(elem, arr, ret){ + var name = arr; + ret = ret || {}; + if(typeof arr === 'string'){ + arr = [name]; + } + + $.each(arr, $.isArray(arr) ? + function(i, name){ + var val = getVal(elem, name); + if(val !== undefined){ + ret[name] = val; + } + } : + function(name){ + var val = getVal(elem, name); + if(val !== undefined){ + ret[name] = val; + } + } + ); + return ret; + }; + })(), + registerMimetype: function(elemName, mimeObj){ + if(arguments.length === 1){ + $.each(mimeTypes, function(name){ + m.registerMimetype(name, elemName); + }); + return; + } + $.each(mimeObj, function(mime, exts){ + if(mimeTypes[elemName][mime]){ + mimeTypes[elemName][mime] = []; + } + mimeTypes[elemName][mime] = mimeTypes[elemName][mime].concat(exts); + }); + + }, + _showMimeTypes: function(){ + if(window.console){ + console.log(mimeTypes); + } + }, + add: function(name, elemName, api){ + if(!this.apis[elemName][name]){ + this.apis[elemName][name] = m.beget(this.fn); + if(name !== 'nativ' && $.inArray(name, $.fn.jmeEmbed.defaults.apiOrder) === -1){ + $.fn.jmeEmbed.defaults.apiOrder.push(name); + } + } + $.extend(true, this.apis[elemName][name], api); + }, + fn: { + _init: $.noop, + canPlayType: function(type){ + var elem = this.apiElem, + ret + ; + if(elem && elem.canPlayType){ + ret = elem.canPlayType(type); + return (ret === 'no') ? '' : ret; + } + var parts = m.extractContainerCodecsFormType(type), + that = this + ; + ret = 'probably'; + if(!parts[1]){ + return (this.canPlayContainer && $.inArray(parts[0], this.canPlayContainer) !== -1) ? 'maybe' : ''; + } + $.each(parts[1], function(i, part){ + if(!that.canPlayCodecs || $.inArray(part, that.canPlayCodecs) === -1){ + ret = ''; + return false; + } + }); + return ret; + }, + canPlaySrc: function(src){ + var that = this; + if(typeof src !== 'string'){ + if(src.type){ + return this.canPlayType(src.type); + } + src = src.src; + } + + var ext = getExt(src), ret = ''; + $.each(mimeTypes[this.nodeName], function(mime, exts){ + var index = $.inArray(ext, exts); + if(index !== -1){ + ret = that.canPlayType(mime); + return false; + } + }); + return ret; + }, + canPlaySrces: function(srces){ + srces = srces || $.attr(this.element, 'srces'); + if(!$.isArray(srces)){ + srces = [srces]; + } + var that = this, + canplay = false, + src = '' + ; + $.each(srces, function(i, curSrc){ + canplay = that.canPlaySrc(curSrc); + if(canplay){ + src = curSrc; + return false; + } + }); + return src; + }, + _setActive: $.noop, + _setInactive: $.noop, + _trigger: function(e){$(this.element).triggerHandler(e, e);} + }, + apis: { + audio: {}, + video: {} + }, + extractContainerCodecsFormType: function(type){ + var types = type.split(/\s*;\s*/g); + if(types[1] && types[1].indexOf('codecs') !== -1){ + types[1] = types[1].replace(/["|']$/, '').replace(/^\s*codecs=('|")/, '').split(/\s*,\s*/g); + } + return types; + }, + makeAbsURI: (function(){ + return function(src){ + if(src && typeof src === 'string'){ + src = $('<a href="'+ src +'"></a>')[0].href; + } + return src; + }; + })(), + // simple, but powerfull + beget: function(sup){ + var F = function(){}; + F.prototype = sup; + return new F(); + }, + _create: function(elemName, supType, element, opts){ + var data = $.data(element, 'mediaElemSupport') || $.data(element, 'mediaElemSupport', {apis: {}, nodeName: elemName}); + if(!data.apis[supType]){ + data.apis[supType] = m.beget( m.apis[elemName][supType]); + data.apis[supType].element = element; + data.apis[supType].nodeName = elemName; + data.apis[supType].name = supType; + data.apis[supType].data = {}; + data.apis[supType].embedOpts = opts; + } + return data; + }, + _transferStyles: [ + 'backgroundColor', 'backgroundPosition', 'backgroundImage', 'backgroundRepeat', 'background-attachment' + ], + _setAPIActive: function(element, supType){ + var data = $.data(element, 'mediaElemSupport'), + oldActive = data.name + ; + if(oldActive === supType){return true;} + + var hideElem = data.apis[oldActive].apiElem, + showElem = data.apis[supType] && data.apis[supType].apiElem, + apiReady = false + ; + + if(showElem && showElem.nodeName){ + if(data.nodeName !== 'audio' || $.attr(element, 'controls')){ + if(supType === 'nativ'){ + data.apis[supType].visualElem.css({display: ''}); + } else { + data.apis[supType].visualElem + .css( $.extend({visibility: ''}, data.apis[oldActive].visualElem.getDimensions()) ) + ; + } + } + data.apis[supType]._setActive(oldActive); + apiReady = true; + + data.apis[supType]._trigger({type: 'apiActivated', api: supType}); + if( data.apis[oldActive] ){ + if( data.apis[oldActive]._volumelevelState !== undefined ){ + $(element).volumelevel(data.apis[oldActive]._volumelevelState); + } + if( data.apis[oldActive]._muteState !== undefined ){ + $(element).muted(data.apis[oldActive]._muteState); + } + if(data.apis[oldActive].visualElem){ + $.each(m._transferStyles, function(i, name){ + data.apis[supType].visualElem.css(name, data.apis[oldActive].visualElem.css(name)); + }); + } + } + + } + data.apis[supType].isAPIActive = true; + if(hideElem && hideElem.nodeName){ + if(oldActive === 'nativ'){ + hideElem.style.display = 'none'; + } else { + data.apis[oldActive].visualElem + .css({ + height: 0, + width: 0, + visibility: 'hidden' + }) + ; + } + data.apis[oldActive]._setInactive(supType); + data.apis[oldActive].isAPIActive = false; + data.apis[supType]._trigger({type: 'apiDeActivated', api: oldActive}); + } + + data.name = supType; + + return apiReady; + }, + getSuitedPlayers: function(elem, apiOrder){ + var apis = $.data(elem, 'mediaElemSupport'); + if(!apis || !apis.apis){return;} + apis = apis.apis; + var srces = $.attr(elem, 'srces'), + supported = false, + getSupported = function(name, api){ + if( (typeof api.isTechAvailable === 'boolean' && !api.isTechAvailable) || ( $.isFunction(api.isTechAvailable) && !api.isTechAvailable() ) ){ + return; + } + var src = api.canPlaySrces(srces); + + if(src){ + supported = { + src: src.src || src, + name: name + }; + } + return supported; + } + ; + if(!srces.length){return 'noSource';} + if(apiOrder){ + $.each(apiOrder, function(i, name){ + return !(getSupported(name, apis[name])); + }); + } else { + $.each(apis, function(name, api){ + return !(getSupported(name, api)); + }); + } + return supported; + }, + _embedApi: function(elem, supported, apiData){ + var config = $.attr(elem, 'getConfig'), + jElm = $(elem), + dims = {}, + id = elem.id, + fn = function(apiElem){ + apiData.apis[supported.name].apiElem = apiElem; + $(apiElem).addClass(apiData.nodeName); + if(!config.controls){ + $(apiElem).attr({ + tabindex: '-1', + role: 'presentation' + }); + } + apiData.apis[supported.name]._init(); + apiData.apis[supported.name]._trigger({type: 'apiActivated', api: supported.name}); + }, + label = jElm.attr('aria-labelledby') + ; + + if(!id){ + vID++; + id = apiData.nodeName +'-'+vID; + elem.id = id; + } + apiData.apis[supported.name].visualElem = $('<div class="media-element-box mm-'+ apiData.nodeName +'-box" style="position: relative;" />').insertBefore(elem); + + if(label){ + apiData.apis[supported.name].visualElem.attr({ + role: 'group', + 'aria-labelledby': label + }); + } + + if(apiData.nodeName === 'audio' && !config.controls){ + apiData.apis[supported.name].visualElem + .css({ + height: 0, + width: 0 + }) + ; + } else { + apiData.apis[supported.name].visualElem + .css( jElm.getDimensions() ) + ; + $.each(m._transferStyles, function(i, name){ + apiData.apis[supported.name].visualElem.css(name, jElm.css(name)); + }); + } + apiData.apis[supported.name]._embed(supported.src, apiData.name +'-'+ id, config, fn); + }, + getPluginVersion: function(name, plugDesc){ + var plugin = plugDesc || (navigator.plugins && navigator.plugins[name]), + version = [-1, 0], + desc + ; + if(plugin){ + desc = (plugin.description || '').replace(/,/g, '.').match(/(\d+)/g) || ['0']; + if(desc && desc[0]){ + version[0] = desc[0]; + if(desc[1]){ + version[0] += '.'+desc[1]; + } + version[0] = parseFloat(version[0], 10); + if(desc[2]){ + version[1] = parseInt(desc[2], 10); + } + } + } + return version; + }, + embedObject: function(elem, id, attrs, params, activeXAttrs, pluginName){ + elem.style.overflow = 'hidden'; + elem = $('<div />').prependTo(elem)[0]; + var obj; + + if(navigator.plugins && navigator.plugins.length){ + obj = doc.createElement('object'); + $.each(attrs, function(name, val){ + obj.setAttribute(name, val); + }); + + $.each(params, function(name, val){ + var param = doc.createElement('param'); + param.setAttribute('name', name); + param.setAttribute('value', val); + obj.appendChild(param); + }); + obj.setAttribute('id', id); + obj.setAttribute('name', id); + if(params.wmode === 'transparent'){ + obj.style.minHeight = '1px'; + obj.style.minHeight = '1px'; + } + elem.parentNode.replaceChild(obj, elem); + } else if(window.ActiveXObject){ + obj = '<object style="width: 100%; height: 100%; width="100%" height="100%"'; + $.each($.extend({}, attrs, activeXAttrs), function(name, val){ + obj += ' '+ name +'="'+ val +'"'; + }); + obj += ' name="'+ id +'"'; + obj += ' id="'+ id +'"'; + obj += '>'; + $.each(params, function(name, val){ + obj += ' <param name="'+ name +'" value="'+ val +'" />'; + }); + obj += '</object>'; + elem.outerHTML = obj; + obj = doc.getElementById(id); + } + if(obj){ + obj.setAttribute('width', '100%'); + obj.setAttribute('height', '100%'); + } + $(window).unload(function(){ + jQuery.cleanData( [ obj ] ); + obj = null; + }); +// vlc in ie is a little stupid here + setTimeout(function(){ + if( !obj || !obj.style ){return;} + obj.style.width = '100%'; + obj.style.height = '100%'; + }, 0); + return obj; + } + }); + + m.add('nativ', 'video', {}); + m.add('nativ', 'audio', {}); + + function findInitFallback(elem, opts){ + var elemName = elem.nodeName.toLowerCase(); + + //getSupportedSrc and Player + var supported = m.getSuitedPlayers(elem, opts.apiOrder), + apiData = $.data(elem, 'mediaElemSupport') + ; + + // important total fail error event + if(!supported){ + apiData.apis.nativ._trigger({type: 'totalerror'}); + try { + elem.pause(); + } catch(e){} + return; + } + if(supported === 'noSource'){ + apiData.noSource = true; + return; + } + //_setAPIActive returns false if player isn´t embeded + if(!m._setAPIActive(elem, supported.name)){ + m._embedApi(elem, supported, apiData, elemName); + } else if(apiData.apis[supported.name]._mmload){ + apiData.apis[supported.name]._mmload(supported.src, $.attr(elem, 'poster')); + } + } + + var showFallback = function(){ + var fallback = $(this).hide().children(':not(source, track)').clone().insertAfter(this); + $(this).one('mediareset', function(){ + $(this).show(); + fallback.remove(); + }); + }; + + + + $.fn.jmeEmbed = function(opts){ + opts = $.extend(true, {}, $.fn.jmeEmbed.defaults, opts); + if(opts.showFallback && $.support.mediaElements){ + this.bind('totalerror', showFallback); + } + + return this.each(function(){ + var elemName = this.nodeName.toLowerCase(), + supported = false, + elem = this + ; + + if(elemName !== 'video' && elemName !== 'audio' || ($.support.flash9 && $.nodeName(elem.parentNode, 'object'))){return;} + + //remove swf fallback + $('object, embed', this) + .each(function(){ + $('> *:not(param, embed, object)', this).appendTo(elem); + }) + .remove() + ; + + $(this).trigger('jmeBeforeEmbed', { + options: opts, + nodeName: elemName + }) + ; + if(opts.removeControls){ + $.attr(this, 'controls', false); + } + + var apiData = m._create(elemName, 'nativ', this, opts); + apiData.name = 'nativ'; + apiData.apis.nativ.apiElem = this; + apiData.apis.nativ.visualElem = $(this); + apiData.apis.nativ.isAPIActive = true; + $.each(m.apis[elemName], function(name){ + if(name !== 'nativ'){ + m._create(elemName, name, elem, opts); + } + }); + + $(this) + .bind('mediaerror', function(e){ + if(apiData.name === 'nativ'){ + findInitFallback(this, opts); + } + }) + ; + + if($.support.flash9 && opts.activateFlash && opts.flashPlayer){ + supported = m.getSuitedPlayers(elem, [opts.flashPlayer]); + if( supported == 'noSource' ){ + supported = {name: opts.flashPlayer}; + } + apiData.apis.nativ.isAPIReady = true; + if(supported.name == opts.flashPlayer && !m._setAPIActive(this, opts.flashPlayer)){ + m._embedApi(this, supported, apiData, elemName); + } else { + supported = false; + } + } + if( !supported ){ + if(opts.debug || !$.support.mediaElements){ + findInitFallback(this, opts); + apiData.apis.nativ.isAPIReady = true; + } else { + apiData.apis.nativ._init(); + } + } + $.attr(this, 'preload', $.attr(this, 'preload'), true); + + $(this) + .trigger('jmeEmbed', { + options: opts, + nodeName: elemName, + data: apiData + }) + ; + }); + }; + + $.fn.jmeEmbed.defaults = { + debug: false, + removeControls: false, + showFallback: false, + apiOrder: [], + activateFlash: false, + flashPlayer: '' + }; + + // deprecated + $.fn.mediaElementEmbed = $.fn.jmeEmbed; + + if($.cleanData && window.ActiveXObject){ + var _cleanData = $.cleanData; + $.cleanData = function(elems){ + _cleanData(elems); + for(var i = 0, len = elems.length; i < len; i++){ + if(elems[i].nodeName === 'OBJECT'){ + try { + for (var j in elems[i]) { + if (typeof elems[i][j] === "function") { + elems[i][j] = null; + } + } + } catch(e){} + } + } + }; + } + +})(jQuery);/**! + * Part of the jMediaelement-Project | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ + +(function($){ + + var swfAttr = {type: 'application/x-shockwave-flash'}, + aXAttrs = {classid: 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'}, + m = $.multimediaSupport + ; + + $.extend($.fn.jmeEmbed.defaults, + { + flashPlayer: 'jwPlayer', + jwPlayer: { + path: m.jsPath + 'player.swf', + hideIcons: 'auto', + vars: {}, + attrs: {}, + plugins: {}, + params: { + allowscriptaccess: 'always', + allowfullscreen: 'true' + } + } + } + ) + ; + + $(function(){ + var path = ($('script.jwPlayer')[0] || {}).src; + if(path){ + $.fn.jmeEmbed.defaults.jwPlayer.path = path; + } + }); + + var regs = { + A: /&/g, + a: /&/g, + e: /\=/g, + q: /\?/g + }, + providerMatch = { + audio: 'sound', + video: 'video' + }, + replaceVar = function(val){ + return (val.replace) ? val.replace(regs.A, '%26').replace(regs.a, '%26').replace(regs.e, '%3D').replace(regs.q, '%3F') : val; + } + ; + + + + (function(){ + $.support.flash9 = false; + $.support.flashVersion = 0; + var swf = m.getPluginVersion('Shockwave Flash'), + supportsMovieStar = function(obj, _retest){ + $.support.flash9 = false; + try { + //opera needs typeof check do not use 'GetVariable' in obj + if (obj && typeof obj.GetVariable !== 'undefined') { + var version = obj.GetVariable("$version"); + obj = m.getPluginVersion('', { + description: version + }); + $.support.flashVersion = obj[0]; + $.support.flash9 = !!(obj[0] > 9 || (obj[0] === 9 && obj[1] >= 115)); + } + } catch (e) {} + + } + ; + if(swf && swf[0]){ + $.support.flashVersion = swf[0]; + } + if(swf[0] > 9 || (swf[0] === 9 && swf[1] >= 115)){ + //temp result + + $.support.flash9 = true; + $(function(){ + swf = $('<object />', swfAttr).appendTo('body'); + supportsMovieStar(swf[0]); + swf.remove(); + }); + } else if(window.ActiveXObject){ + try { + swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); + supportsMovieStar(swf); + swf = null; + } catch(e){} + } + })(); + + var jwMM = { + isTechAvailable: function(){ + return $.support.flash9; + }, + _extendJWLoad: function(src, obj, elem){ + if(!src){return;} + + elem = elem || this.element; + var changeVars = this.embedOpts.jwPlayer.changeVars; + m.extendWithData(elem, obj, ['type', 'provider', 'stretching', 'bufferlength', 'streamer']); + obj.file = (elem.getAttribute('data-jwprefixsrc') || '') + obj.file; + // if we can't autodetect provider by file-extension, + // we add a provider + var ext = m.getExt(src), + name = (ext == 'm4r') ? 'video' : this.nodeName + ; + if(ext == 'm4r' || !this.canPlaySrc(src)){ + if(!obj.provider){ + obj.provider = providerMatch[name]; + } + if(!obj.type){ + obj.type = providerMatch[name]; + } + } + if(changeVars){ + changeVars(src, obj, elem, this); + } + return obj; + }, + _embed: function(src, id, cfg, fn){ + var opts = this.embedOpts.jwPlayer, + vars = $.extend({}, opts.vars, {file: src, id: id}), + attrs = $.extend({name: id}, opts.attrs, swfAttr, !(window.ActiveXObject) ? {data: opts.path} : {}), + params = $.extend({movie: opts.path}, opts.params), + plugins = [], + that = this + ; + + this._extendJWLoad(src, vars); + + if(cfg.poster){ + vars.image = cfg.poster; + } + + vars.autostart = ''+ cfg.autoplay; + vars.repeat = (cfg.loop) ? 'single' : 'false'; + vars.controlbar = (cfg.controls) ? 'bottom' : 'none'; + + if( !cfg.controls && this.nodeName !== 'audio' && params.wmode === undefined ){ + params.wmode = 'transparent'; + } + + if( (!cfg.controls && opts.hideIcons && params.wmode === 'transparent') || opts.hideIcons === true ){ + vars.icons = 'false'; + vars.showicons = 'false'; + } + + if( params.wmode === 'transparent' && !vars.screencolor && !attrs.bgcolor ){ + vars.screencolor = 'ffffffff'; + attrs.bgcolor = '#000000'; + } + + params.flashvars = []; + $.each(vars, function(name, val){ + params.flashvars.push(replaceVar(name)+'='+replaceVar(val)); + }); + + $.each(opts.plugins, function(name, src){ + plugins.push(src); + }); + if(plugins.length){ + params.flashvars.push( 'plugins='+ ( plugins.join(',') ) ); + } + params.flashvars = params.flashvars.join('&'); + fn(m.embedObject( this.visualElem[0], id, attrs, params, aXAttrs, 'Shockwave Flash' )); + setTimeout(function(){ + var swf = $('object', that.visualElem)[0]; + if( !swf || (swf.style.display === 'none' && $('> *', that.visualElem).length > 1 ) ){ + $('div[bgactive]', that.visualElem).css({width: '100%', height: '100%'}); + that._trigger('flashblocker'); + } + }, 9); + }, + canPlaySrc: function(media){ + var ret = m.fn.canPlaySrc.apply(this, arguments), + index = -1, + src = media.src || media + ; + + if( !ret && typeof src === 'string' ){ + index = src.indexOf('youtube.com/'); + if(index < 15 && index > 6){ + ret = 'maybe'; + } + } + + return ret; + }, + canPlayCodecs: ['avc1.42E01E', 'mp4a.40.2', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'VP6', 'mp3', 'AAC'], + canPlayContainer: ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'jwplayer/jwplayer'] + } + ; + + m.add('jwPlayer', 'video', jwMM); + m.add('jwPlayer', 'audio', jwMM); + +})(jQuery); diff --git a/chimere/static/jme/packages/mm.embed.min.js b/chimere/static/jme/packages/mm.embed.min.js new file mode 100644 index 0000000..2f7651f --- /dev/null +++ b/chimere/static/jme/packages/mm.embed.min.js @@ -0,0 +1,41 @@ +/**! + * Part of the jMediaelement-Project vpre1.3.5 | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ +(function(b){function x(){b.event.special.mediaerror.handler.apply(b(this).closest("video, audio")[0],arguments)}function C(a){if(b.support.mediaElements){var c=b.data(this,"mediaElemSupport");if(c&&c.apis){a&&a.type&&b.data(this,"calledMediaError",false);c=c.apis;a=this;var d=b.attr(this,"srces");if(a.error||d.length&&!c.nativ.canPlaySrces(d)){b.event.special.mediaerror.handler.call(this,b.Event("mediaerror"));try{a.pause()}catch(e){}}b("source",this).unbind("error",x).filter(":last").bind("error", +x)}}}function s(a,c){var d=a.nodeName.toLowerCase();c=j.getSuitedPlayers(a,c.apiOrder);var e=b.data(a,"mediaElemSupport");if(c)if(c==="noSource")e.noSource=true;else if(j._setAPIActive(a,c.name))e.apis[c.name]._mmload&&e.apis[c.name]._mmload(c.src,b.attr(a,"poster"));else j._embedApi(a,c,e,d);else{e.apis.nativ._trigger({type:"totalerror"});try{a.pause()}catch(f){}}}b.multimediaSupport={};var j=b.multimediaSupport,z=(new Date).getTime(),v=document,w=b("<video />")[0],i=!("webkitPreservesPitch"in w&& +parseFloat(b.browser.version,10)<535&&(navigator.userAgent.indexOf("Chrome")!==-1||navigator.userAgent.indexOf("Mac")===-1));b.support.video=!!w.canPlayType;b.support.autoBuffer=!!("autobuffer"in w);b.support.audio=!!b("<audio />")[0].canPlayType;w=null;b("<source />");b("<track />");b.support.mediaElements=b.support.video&&b.support.audio;b.support.dynamicHTML5=!!b("<video><div></div></video>")[0].innerHTML;b.support.mediaLoop="loop"in b("<video />")[0];b.browser.deprecatedPoster=!i;b.fixHTML5=function(){var a, +c;return b.support.dynamicHTML5?function(d){return d}:function(d){if(!a){c=document.body;a=document.createElement("div");a.style.display="none"}var e=a.cloneNode(false);c.appendChild(e);e.innerHTML=d;c.removeChild(e);return e.childNodes}}();var l=["float"];b.each(["Top","Left","Right","Bottom"],function(a,c){l.push("margin"+c);l.push("padding"+c);l.push("border"+c+"Width");setTimeout(function(){j._transferStyles.push("border"+c+"Color");j._transferStyles.push("border"+c+"Style")},1)});b.fn.getDimensions= +function(){var a={width:0,height:0};if(this[0]){var c=this,d=this[0].style;a.height=d.height||this.height();a.width=d.width||this.width();b.each(l,function(e,f){a[f]=d[f]||c.css(f)})}return a};var m=b.attr,p=/video|audio|source/i,o={src:1,poster:1},n={loop:1,autoplay:1,controls:1},A={srces:1,getConfig:1,preload:1},q={auto:1,metadata:1,none:1},t={change:function(a,c,d){if(b.support.mediaElements){var e=a.getAttribute("preload")||"metadata";if(d||c!==e)if(i){if(b.support.autoBuffer)a.autobuffer=c=== +"auto"}else if(c==="none"||e==="none"&&(c==="auto"||!a.getAttribute("poster"))){b(a).unbind("play",t.changePlayMode);c==="none"&&b(a).bind("play",t.changePlayMode);b.attr(a,"srces",b.attr(a,"srces"),c)}}},changeAutoplay:function(a,c){if(b.support.mediaElements&&!i&&b.attr(a,"preload")==="none"&&c!==b.attr(a,"autoplay")){var d=b.attr(a,"srces");b.attr(a,"srces",d,"auto");d.length&&c&&setTimeout(function(){a.play&&b(a).getMediaAPI()==="nativ"&&a.play()},9)}},changePlayMode:function(){t.changeAutoplay(this, +true)},addSrces:function(a,c,d){if(i||!b.support.mediaElements)return false;d=d||b.attr(a,"preload");b(a).unbind("play",t.changePlayMode);if(d==="auto"||b.attr(a,"autoplay"))return b.data(a,"jme-srces",false);b(a).bind("play",t.changePlayMode);b.data(a,"jme-srces",c);return true}};b.attr=function(a,c,d,e){if(!(a.nodeName&&p.test(a.nodeName)&&(A[c]||n[c]||o[c])))return m(a,c,d,e);var f;if(d===undefined){if(n[c])return typeof a[c]==="boolean"?a[c]:!!(a.attributes[c]||{}).specified;if(o[c])return b.support.video&& +a[c]||j.makeAbsURI(a.getAttribute(c));switch(c){case "srces":if(f=b.data(a,"jme-srces"))break;if(f=b.attr(a,"src"))f=[{src:f,type:a.getAttribute("type"),media:a.getAttribute("media")}];else{f=[];b("source",a).each(function(){f.push({src:b.attr(this,"src"),type:this.getAttribute("type"),media:this.getAttribute("media")})});f.length||b("a.source",a).each(function(){f.push({src:this.href,type:this.getAttribute("type"),media:this.getAttribute("data-media")})})}break;case "getConfig":f={};b.each(["autoplay", +"loop","controls","poster","preload"],function(g,h){f[h]=b.attr(a,h)});break;case "preload":f=a.preload||a.getAttribute("preload");if(f==="")f="auto";q[f]||(f="metadata");break}return f}else if(n[c]){d=!!d;a[c]=d;c==="autoplay"&&t.changeAutoplay(a,d);if(d){a[c]=d;a.setAttribute(c,c)}else{a[c]=d;a.removeAttribute(c)}}else if(o[c])a.setAttribute(c,d);else if(c==="srces"){b("source, a.source",a).remove();a.removeAttribute("src");d=b.isArray(d)?d:[d];t.addSrces(a,d,e)||b.each(d,function(g,h){f=v.createElement("source"); +if(typeof h==="string")h={src:h};f.setAttribute("src",h.src);h.type&&f.setAttribute("type",h.type);h.media&&f.setAttribute("media",h.media);a.appendChild(f)})}else if(c==="getConfig")b.each(d,function(g,h){b.attr(a,g,h)});else if(c==="preload"){if(d==="")d="auto";else q[d]||(d="metadata");t.change(a,d,e);a.setAttribute(c,d)}};b.event.special.mediaerror={setup:function(){var a=b(this).bind("error",b.event.special.mediaerror.handler).bind("native_mediareset",C);setTimeout(function(){a.each(C)},0)}, +teardown:function(){b(this).unbind("error",b.event.special.mediaerror.handler).find("source").unbind("error",x)},handler:function(a){if(!b.data(this,"calledMediaError")){a=b.extend({},a||{},{type:"mediaerror"});b.data(this,"calledMediaError",true);return b.event.handle.apply(this,arguments)}}};j.getExt=function(a){var c=a.indexOf("?"),d="";a=c>0?a.substring(0,c):a;c=a.lastIndexOf(".")+1;return(d=a.substr(c))&&d.toLowerCase?d.toLowerCase():d};var y=j.getExt,r={audio:{"audio/ogg":["ogg","oga","ogm"], +"audio/mpeg":["mp2","mp3","mpga","mpega"],"audio/mp4":["mp4","mpg4","m4r"],"audio/wav":["wav"],"audio/x-m4a":["m4a"],"audio/x-m4p":["m4p"],"audio/3gpp":["3gp","3gpp"],"audio/webm":["webm"]},video:{"video/ogg":["ogg","ogv","ogm"],"video/mpeg":["mpg","mpeg","mpe"],"video/mp4":["mp4","mpg4","m4v"],"video/quicktime":["mov","qt"],"video/x-msvideo":["avi"],"video/x-ms-asf":["asf","asx"],"video/flv":["flv","f4v"],"video/3gpp":["3gp","3gpp"],"video/webm":["webm"]}};b.extend(j,{jsPath:function(){var a=b("script"); +a=a[a.length-1].src.split("?")[0];return a.slice(0,a.lastIndexOf("/")+1)}(),extendWithData:function(){var a={string:1,number:1,"boolean":1};return function(c,d,e){e||(e=d);b.each(e,b.isArray(e)?function(f,g){j.getData(c,g,d)}:function(f,g){a[typeof g]&&j.getData(c,f,d)});return d}}(),getData:function(){var a=function(c,d){c=c.getAttribute("data-"+d);if(!(!c&&c!==""))return c*1==c?parseFloat(c,10):c==="false"?false:c==="true"?true:c};return function(c,d,e){var f=d;e=e||{};if(typeof d==="string")d= +[f];b.each(d,b.isArray(d)?function(g,h){g=a(c,h);if(g!==undefined)e[h]=g}:function(g){var h=a(c,g);if(h!==undefined)e[g]=h});return e}}(),registerMimetype:function(a,c){arguments.length===1?b.each(r,function(d){j.registerMimetype(d,a)}):b.each(c,function(d,e){if(r[a][d])r[a][d]=[];r[a][d]=r[a][d].concat(e)})},_showMimeTypes:function(){window.console&&console.log(r)},add:function(a,c,d){if(!this.apis[c][a]){this.apis[c][a]=j.beget(this.fn);a!=="nativ"&&b.inArray(a,b.fn.jmeEmbed.defaults.apiOrder)=== +-1&&b.fn.jmeEmbed.defaults.apiOrder.push(a)}b.extend(true,this.apis[c][a],d)},fn:{_init:b.noop,canPlayType:function(a){var c=this.apiElem,d;if(c&&c.canPlayType){d=c.canPlayType(a);return d==="no"?"":d}a=j.extractContainerCodecsFormType(a);var e=this;d="probably";if(!a[1])return this.canPlayContainer&&b.inArray(a[0],this.canPlayContainer)!==-1?"maybe":"";b.each(a[1],function(f,g){if(!e.canPlayCodecs||b.inArray(g,e.canPlayCodecs)===-1){d="";return false}});return d},canPlaySrc:function(a){var c=this; +if(typeof a!=="string"){if(a.type)return this.canPlayType(a.type);a=a.src}var d=y(a),e="";b.each(r[this.nodeName],function(f,g){if(b.inArray(d,g)!==-1){e=c.canPlayType(f);return false}});return e},canPlaySrces:function(a){a=a||b.attr(this.element,"srces");b.isArray(a)||(a=[a]);var c=this,d=false,e="";b.each(a,function(f,g){if(d=c.canPlaySrc(g)){e=g;return false}});return e},_setActive:b.noop,_setInactive:b.noop,_trigger:function(a){b(this.element).triggerHandler(a,a)}},apis:{audio:{},video:{}},extractContainerCodecsFormType:function(a){a= +a.split(/\s*;\s*/g);if(a[1]&&a[1].indexOf("codecs")!==-1)a[1]=a[1].replace(/["|']$/,"").replace(/^\s*codecs=('|")/,"").split(/\s*,\s*/g);return a},makeAbsURI:function(){return function(a){if(a&&typeof a==="string")a=b('<a href="'+a+'"></a>')[0].href;return a}}(),beget:function(a){var c=function(){};c.prototype=a;return new c},_create:function(a,c,d,e){var f=b.data(d,"mediaElemSupport")||b.data(d,"mediaElemSupport",{apis:{},nodeName:a});if(!f.apis[c]){f.apis[c]=j.beget(j.apis[a][c]);f.apis[c].element= +d;f.apis[c].nodeName=a;f.apis[c].name=c;f.apis[c].data={};f.apis[c].embedOpts=e}return f},_transferStyles:["backgroundColor","backgroundPosition","backgroundImage","backgroundRepeat","background-attachment"],_setAPIActive:function(a,c){var d=b.data(a,"mediaElemSupport"),e=d.name;if(e===c)return true;var f=d.apis[e].apiElem,g=d.apis[c]&&d.apis[c].apiElem,h=false;if(g&&g.nodeName){if(d.nodeName!=="audio"||b.attr(a,"controls"))c==="nativ"?d.apis[c].visualElem.css({display:""}):d.apis[c].visualElem.css(b.extend({visibility:""}, +d.apis[e].visualElem.getDimensions()));d.apis[c]._setActive(e);h=true;d.apis[c]._trigger({type:"apiActivated",api:c});if(d.apis[e]){d.apis[e]._volumelevelState!==undefined&&b(a).volumelevel(d.apis[e]._volumelevelState);d.apis[e]._muteState!==undefined&&b(a).muted(d.apis[e]._muteState);d.apis[e].visualElem&&b.each(j._transferStyles,function(k,u){d.apis[c].visualElem.css(u,d.apis[e].visualElem.css(u))})}}d.apis[c].isAPIActive=true;if(f&&f.nodeName){if(e==="nativ")f.style.display="none";else d.apis[e].visualElem.css({height:0, +width:0,visibility:"hidden"});d.apis[e]._setInactive(c);d.apis[e].isAPIActive=false;d.apis[c]._trigger({type:"apiDeActivated",api:e})}d.name=c;return h},getSuitedPlayers:function(a,c){var d=b.data(a,"mediaElemSupport");if(d&&d.apis){d=d.apis;var e=b.attr(a,"srces"),f=false,g=function(h,k){if(!(typeof k.isTechAvailable==="boolean"&&!k.isTechAvailable||b.isFunction(k.isTechAvailable)&&!k.isTechAvailable())){if(k=k.canPlaySrces(e))f={src:k.src||k,name:h};return f}};if(!e.length)return"noSource";c?b.each(c, +function(h,k){return!g(k,d[k])}):b.each(d,function(h,k){return!g(h,k)});return f}},_embedApi:function(a,c,d){var e=b.attr(a,"getConfig"),f=b(a),g=a.id,h=f.attr("aria-labelledby");if(!g){z++;g=d.nodeName+"-"+z;a.id=g}d.apis[c.name].visualElem=b('<div class="media-element-box mm-'+d.nodeName+'-box" style="position: relative;" />').insertBefore(a);h&&d.apis[c.name].visualElem.attr({role:"group","aria-labelledby":h});if(d.nodeName==="audio"&&!e.controls)d.apis[c.name].visualElem.css({height:0,width:0}); +else{d.apis[c.name].visualElem.css(f.getDimensions());b.each(j._transferStyles,function(k,u){d.apis[c.name].visualElem.css(u,f.css(u))})}d.apis[c.name]._embed(c.src,d.name+"-"+g,e,function(k){d.apis[c.name].apiElem=k;b(k).addClass(d.nodeName);e.controls||b(k).attr({tabindex:"-1",role:"presentation"});d.apis[c.name]._init();d.apis[c.name]._trigger({type:"apiActivated",api:c.name})})},getPluginVersion:function(a,c){c=c||navigator.plugins&&navigator.plugins[a];a=[-1,0];if(c)if((c=(c.description||"").replace(/,/g, +".").match(/(\d+)/g)||["0"])&&c[0]){a[0]=c[0];if(c[1])a[0]+="."+c[1];a[0]=parseFloat(a[0],10);if(c[2])a[1]=parseInt(c[2],10)}return a},embedObject:function(a,c,d,e,f){a.style.overflow="hidden";a=b("<div />").prependTo(a)[0];var g;if(navigator.plugins&&navigator.plugins.length){g=v.createElement("object");b.each(d,function(h,k){g.setAttribute(h,k)});b.each(e,function(h,k){var u=v.createElement("param");u.setAttribute("name",h);u.setAttribute("value",k);g.appendChild(u)});g.setAttribute("id",c);g.setAttribute("name", +c);if(e.wmode==="transparent"){g.style.minHeight="1px";g.style.minHeight="1px"}a.parentNode.replaceChild(g,a)}else if(window.ActiveXObject){g='<object style="width: 100%; height: 100%; width="100%" height="100%"';b.each(b.extend({},d,f),function(h,k){g+=" "+h+'="'+k+'"'});g+=' name="'+c+'"';g+=' id="'+c+'"';g+=">";b.each(e,function(h,k){g+=' <param name="'+h+'" value="'+k+'" />'});g+="</object>";a.outerHTML=g;g=v.getElementById(c)}if(g){g.setAttribute("width","100%");g.setAttribute("height","100%")}b(window).unload(function(){jQuery.cleanData([g]); +g=null});setTimeout(function(){if(g&&g.style){g.style.width="100%";g.style.height="100%"}},0);return g}});j.add("nativ","video",{});j.add("nativ","audio",{});var B=function(){var a=b(this).hide().children(":not(source, track)").clone().insertAfter(this);b(this).one("mediareset",function(){b(this).show();a.remove()})};b.fn.jmeEmbed=function(a){a=b.extend(true,{},b.fn.jmeEmbed.defaults,a);a.showFallback&&b.support.mediaElements&&this.bind("totalerror",B);return this.each(function(){var c=this.nodeName.toLowerCase(), +d=false,e=this;if(!(c!=="video"&&c!=="audio"||b.support.flash9&&b.nodeName(e.parentNode,"object"))){b("object, embed",this).each(function(){b("> *:not(param, embed, object)",this).appendTo(e)}).remove();b(this).trigger("jmeBeforeEmbed",{options:a,nodeName:c});a.removeControls&&b.attr(this,"controls",false);var f=j._create(c,"nativ",this,a);f.name="nativ";f.apis.nativ.apiElem=this;f.apis.nativ.visualElem=b(this);f.apis.nativ.isAPIActive=true;b.each(j.apis[c],function(g){g!=="nativ"&&j._create(c,g, +e,a)});b(this).bind("mediaerror",function(){f.name==="nativ"&&s(this,a)});if(b.support.flash9&&a.activateFlash&&a.flashPlayer){d=j.getSuitedPlayers(e,[a.flashPlayer]);if(d=="noSource")d={name:a.flashPlayer};f.apis.nativ.isAPIReady=true;if(d.name==a.flashPlayer&&!j._setAPIActive(this,a.flashPlayer))j._embedApi(this,d,f,c);else d=false}if(!d)if(a.debug||!b.support.mediaElements){s(this,a);f.apis.nativ.isAPIReady=true}else f.apis.nativ._init();b.attr(this,"preload",b.attr(this,"preload"),true);b(this).trigger("jmeEmbed", +{options:a,nodeName:c,data:f})}})};b.fn.jmeEmbed.defaults={debug:false,removeControls:false,showFallback:false,apiOrder:[],activateFlash:false,flashPlayer:""};b.fn.mediaElementEmbed=b.fn.jmeEmbed;if(b.cleanData&&window.ActiveXObject){var D=b.cleanData;b.cleanData=function(a){D(a);for(var c=0,d=a.length;c<d;c++)if(a[c].nodeName==="OBJECT")try{for(var e in a[c])if(typeof a[c][e]==="function")a[c][e]=null}catch(f){}}}})(jQuery); +(function(b){var x={type:"application/x-shockwave-flash"},C={classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},s=b.multimediaSupport;b.extend(b.fn.jmeEmbed.defaults,{flashPlayer:"jwPlayer",jwPlayer:{path:s.jsPath+"player.swf",hideIcons:"auto",vars:{},attrs:{},plugins:{},params:{allowscriptaccess:"always",allowfullscreen:"true"}}});b(function(){var i=(b("script.jwPlayer")[0]||{}).src;if(i)b.fn.jmeEmbed.defaults.jwPlayer.path=i});var j={A:/&/g,a:/&/g,e:/\=/g,q:/\?/g},z={audio:"sound",video:"video"}, +v=function(i){return i.replace?i.replace(j.A,"%26").replace(j.a,"%26").replace(j.e,"%3D").replace(j.q,"%3F"):i};(function(){b.support.flash9=false;b.support.flashVersion=0;var i=s.getPluginVersion("Shockwave Flash"),l=function(p){b.support.flash9=false;try{if(p&&typeof p.GetVariable!=="undefined"){var o=p.GetVariable("$version");p=s.getPluginVersion("",{description:o});b.support.flashVersion=p[0];b.support.flash9=!!(p[0]>9||p[0]===9&&p[1]>=115)}}catch(n){}};if(i&&i[0])b.support.flashVersion=i[0]; +if(i[0]>9||i[0]===9&&i[1]>=115){b.support.flash9=true;b(function(){i=b("<object />",x).appendTo("body");l(i[0]);i.remove()})}else if(window.ActiveXObject)try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");l(i);i=null}catch(m){}})();var w={isTechAvailable:function(){return b.support.flash9},_extendJWLoad:function(i,l,m){if(i){m=m||this.element;var p=this.embedOpts.jwPlayer.changeVars;s.extendWithData(m,l,["type","provider","stretching","bufferlength","streamer"]);l.file=(m.getAttribute("data-jwprefixsrc")|| +"")+l.file;var o=s.getExt(i),n=o=="m4r"?"video":this.nodeName;if(o=="m4r"||!this.canPlaySrc(i)){if(!l.provider)l.provider=z[n];if(!l.type)l.type=z[n]}p&&p(i,l,m,this);return l}},_embed:function(i,l,m,p){var o=this.embedOpts.jwPlayer,n=b.extend({},o.vars,{file:i,id:l}),A=b.extend({name:l},o.attrs,x,!window.ActiveXObject?{data:o.path}:{}),q=b.extend({movie:o.path},o.params),t=[],y=this;this._extendJWLoad(i,n);if(m.poster)n.image=m.poster;n.autostart=""+m.autoplay;n.repeat=m.loop?"single":"false";n.controlbar= +m.controls?"bottom":"none";if(!m.controls&&this.nodeName!=="audio"&&q.wmode===undefined)q.wmode="transparent";if(!m.controls&&o.hideIcons&&q.wmode==="transparent"||o.hideIcons===true){n.icons="false";n.showicons="false"}if(q.wmode==="transparent"&&!n.screencolor&&!A.bgcolor){n.screencolor="ffffffff";A.bgcolor="#000000"}q.flashvars=[];b.each(n,function(r,B){q.flashvars.push(v(r)+"="+v(B))});b.each(o.plugins,function(r,B){t.push(B)});t.length&&q.flashvars.push("plugins="+t.join(","));q.flashvars=q.flashvars.join("&"); +p(s.embedObject(this.visualElem[0],l,A,q,C,"Shockwave Flash"));setTimeout(function(){var r=b("object",y.visualElem)[0];if(!r||r.style.display==="none"&&b("> *",y.visualElem).length>1){b("div[bgactive]",y.visualElem).css({width:"100%",height:"100%"});y._trigger("flashblocker")}},9)},canPlaySrc:function(i){var l=s.fn.canPlaySrc.apply(this,arguments),m=-1;m=i.src||i;if(!l&&typeof m==="string"){m=m.indexOf("youtube.com/");if(m<15&&m>6)l="maybe"}return l},canPlayCodecs:["avc1.42E01E","mp4a.40.2","avc1.58A01E", +"avc1.4D401E","avc1.64001E","VP6","mp3","AAC"],canPlayContainer:["video/3gpp","video/x-msvideo","video/quicktime","video/x-m4v","video/mp4","video/m4p","video/x-flv","video/flv","audio/mpeg","audio/aac","audio/mp4","audio/x-m4a","audio/m4a","audio/mp3","audio/x-fla","audio/fla","youtube/flv","jwplayer/jwplayer"]};s.add("jwPlayer","video",w);s.add("jwPlayer","audio",w)})(jQuery); diff --git a/chimere/static/jme/packages/mm.full.js b/chimere/static/jme/packages/mm.full.js new file mode 100644 index 0000000..3571c20 --- /dev/null +++ b/chimere/static/jme/packages/mm.full.js @@ -0,0 +1,2732 @@ +/**! + * Part of the jMediaelement-Project v1.3.5 | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ + +(function($){ + $.multimediaSupport = {}; + var m = $.multimediaSupport, + vID = new Date().getTime(), + doc = document, + tVid = $('<video />')[0], + //this bad assumption isn't really true, but our workaround-implementation doesn't really hurt + supportMediaPreload = !( 'webkitPreservesPitch' in tVid && parseFloat($.browser.version, 10) < 535 && (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Mac') === -1) ) + ; + // support test + document.createElement trick + $.support.video = !!(tVid.canPlayType); + $.support.autoBuffer = !!('autobuffer' in tVid); + $.support.audio = !!($('<audio />')[0].canPlayType); + + tVid = null; + + $('<source />'); + $('<track />'); + + $.support.mediaElements = ($.support.video && $.support.audio); + $.support.dynamicHTML5 = !!($('<video><div></div></video>')[0].innerHTML); + $.support.mediaLoop = ('loop' in $('<video />')[0]); + $.browser.deprecatedPoster = !supportMediaPreload; + + // HTML5 shiv document.createElement does not work with dynamic inserted elements + // thanks to jdbartlett for this simple script + // see also http://jdbartlett.github.com/innershiv/ + $.fixHTML5 = (function(){ + var d, b; + return ($.support.dynamicHTML5) ? + function(h){return h;} : + function(h) { + if (!d) { + b = document.body; + d = document.createElement('div'); + d.style.display = 'none'; + } + var e = d.cloneNode(false); + b.appendChild(e); + e.innerHTML = h; + b.removeChild(e); + return e.childNodes; + } + ; + })(); + + + + var cssShow = { left: "0px", position: "absolute", visibility: "hidden", display:"block" }, + dimStyles = ['float'] + ; + + $.each(['Top', 'Left', 'Right', 'Bottom'], function(i, name){ + dimStyles.push('margin'+ name); + dimStyles.push('padding'+ name); + dimStyles.push('border'+ name +'Width'); + setTimeout(function(){ + m._transferStyles.push('border'+ name +'Color'); + m._transferStyles.push('border'+ name +'Style'); + }, 1); + }); + $.fn.getDimensions = function(){ + var ret = {width: 0, height: 0}; + if(this[0]){ + var elem = this, + elmS = this[0].style + ; + // assume that inline style is correct + // enables %, em etc. feature with inline-style (i.e.: 100%) + ret.height = elmS.height || this.height(); + ret.width = elmS.width || this.width(); + $.each(dimStyles, function(i, name){ + // assume that inline style is correct + ret[name] = elmS[name] || elem.css(name); + }); + } + return ret; + }; + + + + var oldAttr = $.attr, + attrElems = /video|audio|source/i, + srcNames = { + src: 1, + poster: 1 + }, + booleanNames = { + loop: 1, + autoplay: 1, + controls: 1 + }, + mixedNames = { + srces: 1, + getConfig: 1, + preload: 1 + }, + preloadVals = { + auto: 1, + metadata: 1, + none: 1 + } + ; + + var fixPreload = { + change: function(elem, setPreload, force){ + if( !$.support.mediaElements ){return;} + var _preload = elem.getAttribute('preload') || 'metadata'; + if( force || setPreload !== _preload ){ + if( !supportMediaPreload ){ + if( setPreload === 'none' || (_preload === 'none' && (setPreload === 'auto' || !elem.getAttribute('poster')) ) ){ + $(elem).unbind('play', fixPreload.changePlayMode); + if(setPreload === 'none'){ + $(elem).bind('play', fixPreload.changePlayMode); + } + $.attr(elem, 'srces', $.attr(elem, 'srces'), setPreload); + } + } else if( $.support.autoBuffer ){ + elem.autobuffer = !!(setPreload === 'auto'); + } + } + }, + changeAutoplay: function(elem, autoplay){ + if( $.support.mediaElements && !supportMediaPreload && $.attr(elem, 'preload') === 'none' && autoplay !== $.attr(elem, 'autoplay')){ + var srces = $.attr(elem, 'srces'); + $.attr(elem, 'srces', srces, 'auto'); + if( srces.length && autoplay ){ + setTimeout(function(){ + if(elem.play && $(elem).getMediaAPI() === 'nativ' ){ + elem.play(); + } + }, 9); + } + } + }, + changePlayMode: function(){ + fixPreload.changeAutoplay(this, true); + }, + addSrces: function(elem, srces, preload){ + if( supportMediaPreload || !$.support.mediaElements ){ + return false; + } + + preload = preload || $.attr(elem, 'preload'); + $(elem).unbind('play', fixPreload.changePlayMode); + if( preload === 'auto' || $.attr(elem, 'autoplay') ){return $.data(elem, 'jme-srces', false);} + $(elem).bind('play', fixPreload.changePlayMode); + $.data(elem, 'jme-srces', srces); + return true; + } + }; + $.attr = function(elem, name, value, preloadPass){ + + if( !(elem.nodeName && attrElems.test(elem.nodeName) && (mixedNames[name] || booleanNames[name] || srcNames[name])) ){ + return oldAttr(elem, name, value, preloadPass); + } + + var set = (value !== undefined), elemName, api, ret; + + if(!set){ + if(booleanNames[name]){ + return ( typeof elem[name] === 'boolean' ) ? elem[name] : !!((elem.attributes[name] || {}).specified); + } + if(srcNames[name]){ + return $.support.video && elem[name] || m.makeAbsURI(elem.getAttribute(name)); + } + switch(name) { + case 'srces': + ret = $.data(elem, 'jme-srces'); + if(ret){break;} + + ret = $.attr(elem, 'src'); + if( ret ){ + ret = [{ + src: ret, + type: elem.getAttribute('type'), + media: elem.getAttribute('media') + }] + ; + } else { + ret = []; + $('source', elem).each(function(i){ + ret.push({ + src: $.attr(this, 'src'), + type: this.getAttribute('type'), + media: this.getAttribute('media') + }); + }); + // safari without quicktime ignores source-tags, initially + if(!ret.length){ + $('a.source', elem).each(function(){ + ret.push({ + src: this.href, + type: this.getAttribute('type'), + media: this.getAttribute('data-media') + }); + }); + } + } + break; + case 'getConfig': + ret = {}; + $.each(['autoplay', 'loop', 'controls', 'poster', 'preload'], function(i, name){ + ret[name] = $.attr(elem, name); + }); + break; + case 'preload': + ret = elem.preload || elem.getAttribute('preload'); + if(ret === ''){ + ret = 'auto'; + } + if(!preloadVals[ret]){ + ret = 'metadata'; + } + break; + } + return ret; + } else { + if(booleanNames[name]){ + value = !!(value); + elem[name] = value; + if(name === 'autoplay'){ + fixPreload.changeAutoplay(elem, value); + } + if(value){ + elem[name] = value; + elem.setAttribute(name, name); + } else { + elem[name] = value; + elem.removeAttribute(name); + } + } else if(srcNames[name]){ + elem.setAttribute(name, value); + } else if (name === 'srces') { + $('source, a.source', elem).remove(); + elem.removeAttribute('src'); + value = $.isArray(value) ? value : [value]; + if(fixPreload.addSrces(elem, value, preloadPass)){return;} + $.each(value, function(i, src){ + + ret = doc.createElement('source'); + if(typeof src === 'string'){ + src = {src: src}; + } + ret.setAttribute('src', src.src); + if(src.type){ + ret.setAttribute('type', src.type); + } + if(src.media){ + ret.setAttribute('media', src.media); + } + elem.appendChild(ret); + }); + } else if(name === 'getConfig'){ + //works, but you shouldn´t use as a setter + $.each(value, function(n, v){ + $.attr(elem, n, v); + }); + } else if(name === 'preload'){ + if(value === ''){ + value = 'auto'; + } else if(!preloadVals[value]){ + value = 'metadata'; + } + fixPreload.change(elem, value, preloadPass); + elem.setAttribute(name, value); + } + } + }; + + function sourceError(){ + $.event.special.mediaerror.handler.apply($(this).closest('video, audio')[0], arguments); + } + + function bindSource(e){ + if(!$.support.mediaElements){return;} + + var apis = $.data(this, 'mediaElemSupport'); + if(!apis || !apis.apis){return;} + //reset error + if(e && e.type){ + $.data(this, 'calledMediaError', false); + } + apis = apis.apis; + + //webkit is really stupid with the error event, so fallback to canPlaytype + var elem = this, + srces = $.attr(this, 'srces') + ; + + if( elem.error || (srces.length && !apis.nativ.canPlaySrces(srces)) ){ + $.event.special.mediaerror.handler.call(this, $.Event('mediaerror')); + //stop trying to play + try { + elem.pause(); + } catch(er){} + } + + //bind error + $('source', this) + .unbind('error', sourceError) + .filter(':last') + .bind('error', sourceError) + ; + } + + $.event.special.mediaerror = { + setup: function(){ + //ff always triggers an error on video/audio | w3c/webkit/opera triggers error event on source, if available + var media = $(this) + .bind('error', $.event.special.mediaerror.handler) + //older webkit do not support emptied + .bind('native_mediareset', bindSource) + ; + //bindSource can trigger mediaerror, but event is always bound after setup + setTimeout(function(){ + media.each(bindSource); + }, 0); + }, + teardown: function(){ + $(this) + .unbind('error', $.event.special.mediaerror.handler) + .find('source') + .unbind('error', sourceError) + ; + }, + handler: function(e){ + if($.data(this, 'calledMediaError')){return;} + e = $.extend({}, e || {}, {type: 'mediaerror'}); + $.data(this, 'calledMediaError', true); + return $.event.handle.apply(this, arguments); + } + }; + + m.getExt = function(src){ + var pos = src.indexOf('?'), + ext = '' + ; + src = (pos > 0) ? src.substring(0, pos) : src; + pos = src.lastIndexOf('.') + 1; + ext = src.substr(pos); + return (ext && ext.toLowerCase) ? ext.toLowerCase() : ext; + }; + + + var getExt = m.getExt; + var mimeTypes = { + audio: { + //ogm shouldn´t be used! + 'audio/ogg': ['ogg','oga', 'ogm'], + 'audio/mpeg': ['mp2','mp3','mpga','mpega'], + 'audio/mp4': ['mp4','mpg4', 'm4r'], + 'audio/wav': ['wav'], + 'audio/x-m4a': ['m4a'], + 'audio/x-m4p': ['m4p'], + 'audio/3gpp': ['3gp','3gpp'], + 'audio/webm': ['webm'] + }, + video: { + //ogm shouldn´t be used! + 'video/ogg': ['ogg','ogv', 'ogm'], + 'video/mpeg': ['mpg','mpeg','mpe'], + 'video/mp4': ['mp4','mpg4', 'm4v'], + 'video/quicktime': ['mov','qt'], + 'video/x-msvideo': ['avi'], + 'video/x-ms-asf': ['asf', 'asx'], + 'video/flv': ['flv', 'f4v'], + 'video/3gpp': ['3gp','3gpp'], + 'video/webm': ['webm'] + } + } + ; + + + $.extend(m, { + jsPath: (function(){ + var scripts = $('script'), + path = scripts[scripts.length - 1].src.split('?')[0] + ; + return path.slice(0, path.lastIndexOf("/") + 1); + })(), + extendWithData: (function(){ + var allowedVals ={ + string: 1, + number: 1, + 'boolean': 1 + }; + return function(elem, target, obj){ + if(!obj){ + obj = target; + } + $.each(obj, $.isArray(obj) ? + function(i, name){ + m.getData(elem, name, target); + } : + function(name, val){ + if(allowedVals[typeof val]){ + m.getData(elem, name, target); + } + } + ); + return target; + }; + })(), + getData: (function(){ + var getVal = function(elem, name){ + var val = elem.getAttribute('data-'+ name); + if(!val && val !== ''){ + return undefined; + } + + return (val * 1 == val) ? + parseFloat(val, 10) : + (val === 'false') ? + false : + (val === 'true') ? + true : + val + ; + }; + return function(elem, arr, ret){ + var name = arr; + ret = ret || {}; + if(typeof arr === 'string'){ + arr = [name]; + } + + $.each(arr, $.isArray(arr) ? + function(i, name){ + var val = getVal(elem, name); + if(val !== undefined){ + ret[name] = val; + } + } : + function(name){ + var val = getVal(elem, name); + if(val !== undefined){ + ret[name] = val; + } + } + ); + return ret; + }; + })(), + registerMimetype: function(elemName, mimeObj){ + if(arguments.length === 1){ + $.each(mimeTypes, function(name){ + m.registerMimetype(name, elemName); + }); + return; + } + $.each(mimeObj, function(mime, exts){ + if(mimeTypes[elemName][mime]){ + mimeTypes[elemName][mime] = []; + } + mimeTypes[elemName][mime] = mimeTypes[elemName][mime].concat(exts); + }); + + }, + _showMimeTypes: function(){ + if(window.console){ + console.log(mimeTypes); + } + }, + add: function(name, elemName, api){ + if(!this.apis[elemName][name]){ + this.apis[elemName][name] = m.beget(this.fn); + if(name !== 'nativ' && $.inArray(name, $.fn.jmeEmbed.defaults.apiOrder) === -1){ + $.fn.jmeEmbed.defaults.apiOrder.push(name); + } + } + $.extend(true, this.apis[elemName][name], api); + }, + fn: { + _init: $.noop, + canPlayType: function(type){ + var elem = this.apiElem, + ret + ; + if(elem && elem.canPlayType){ + ret = elem.canPlayType(type); + return (ret === 'no') ? '' : ret; + } + var parts = m.extractContainerCodecsFormType(type), + that = this + ; + ret = 'probably'; + if(!parts[1]){ + return (this.canPlayContainer && $.inArray(parts[0], this.canPlayContainer) !== -1) ? 'maybe' : ''; + } + $.each(parts[1], function(i, part){ + if(!that.canPlayCodecs || $.inArray(part, that.canPlayCodecs) === -1){ + ret = ''; + return false; + } + }); + return ret; + }, + canPlaySrc: function(src){ + var that = this; + if(typeof src !== 'string'){ + if(src.type){ + return this.canPlayType(src.type); + } + src = src.src; + } + + var ext = getExt(src), ret = ''; + $.each(mimeTypes[this.nodeName], function(mime, exts){ + var index = $.inArray(ext, exts); + if(index !== -1){ + ret = that.canPlayType(mime); + return false; + } + }); + return ret; + }, + canPlaySrces: function(srces){ + srces = srces || $.attr(this.element, 'srces'); + if(!$.isArray(srces)){ + srces = [srces]; + } + var that = this, + canplay = false, + src = '' + ; + $.each(srces, function(i, curSrc){ + canplay = that.canPlaySrc(curSrc); + if(canplay){ + src = curSrc; + return false; + } + }); + return src; + }, + _setActive: $.noop, + _setInactive: $.noop, + _trigger: function(e){$(this.element).triggerHandler(e, e);} + }, + apis: { + audio: {}, + video: {} + }, + extractContainerCodecsFormType: function(type){ + var types = type.split(/\s*;\s*/g); + if(types[1] && types[1].indexOf('codecs') !== -1){ + types[1] = types[1].replace(/["|']$/, '').replace(/^\s*codecs=('|")/, '').split(/\s*,\s*/g); + } + return types; + }, + makeAbsURI: (function(){ + return function(src){ + if(src && typeof src === 'string'){ + src = $('<a href="'+ src +'"></a>')[0].href; + } + return src; + }; + })(), + // simple, but powerfull + beget: function(sup){ + var F = function(){}; + F.prototype = sup; + return new F(); + }, + _create: function(elemName, supType, element, opts){ + var data = $.data(element, 'mediaElemSupport') || $.data(element, 'mediaElemSupport', {apis: {}, nodeName: elemName}); + if(!data.apis[supType]){ + data.apis[supType] = m.beget( m.apis[elemName][supType]); + data.apis[supType].element = element; + data.apis[supType].nodeName = elemName; + data.apis[supType].name = supType; + data.apis[supType].data = {}; + data.apis[supType].embedOpts = opts; + } + return data; + }, + _transferStyles: [ + 'backgroundColor', 'backgroundPosition', 'backgroundImage', 'backgroundRepeat', 'background-attachment' + ], + _setAPIActive: function(element, supType){ + var data = $.data(element, 'mediaElemSupport'), + oldActive = data.name + ; + if(oldActive === supType){return true;} + + var hideElem = data.apis[oldActive].apiElem, + showElem = data.apis[supType] && data.apis[supType].apiElem, + apiReady = false + ; + + if(showElem && showElem.nodeName){ + if(data.nodeName !== 'audio' || $.attr(element, 'controls')){ + if(supType === 'nativ'){ + data.apis[supType].visualElem.css({display: ''}); + } else { + data.apis[supType].visualElem + .css( $.extend({visibility: ''}, data.apis[oldActive].visualElem.getDimensions()) ) + ; + } + } + data.apis[supType]._setActive(oldActive); + apiReady = true; + + data.apis[supType]._trigger({type: 'apiActivated', api: supType}); + if( data.apis[oldActive] ){ + if( data.apis[oldActive]._volumelevelState !== undefined ){ + $(element).volumelevel(data.apis[oldActive]._volumelevelState); + } + if( data.apis[oldActive]._muteState !== undefined ){ + $(element).muted(data.apis[oldActive]._muteState); + } + if(data.apis[oldActive].visualElem){ + $.each(m._transferStyles, function(i, name){ + data.apis[supType].visualElem.css(name, data.apis[oldActive].visualElem.css(name)); + }); + } + } + + } + data.apis[supType].isAPIActive = true; + if(hideElem && hideElem.nodeName){ + if(oldActive === 'nativ'){ + hideElem.style.display = 'none'; + } else { + data.apis[oldActive].visualElem + .css({ + height: 0, + width: 0, + visibility: 'hidden' + }) + ; + } + data.apis[oldActive]._setInactive(supType); + data.apis[oldActive].isAPIActive = false; + data.apis[supType]._trigger({type: 'apiDeActivated', api: oldActive}); + } + + data.name = supType; + + return apiReady; + }, + getSuitedPlayers: function(elem, apiOrder){ + var apis = $.data(elem, 'mediaElemSupport'); + if(!apis || !apis.apis){return;} + apis = apis.apis; + var srces = $.attr(elem, 'srces'), + supported = false, + getSupported = function(name, api){ + if( (typeof api.isTechAvailable === 'boolean' && !api.isTechAvailable) || ( $.isFunction(api.isTechAvailable) && !api.isTechAvailable() ) ){ + return; + } + var src = api.canPlaySrces(srces); + + if(src){ + supported = { + src: src.src || src, + name: name + }; + } + return supported; + } + ; + if(!srces.length){return 'noSource';} + if(apiOrder){ + $.each(apiOrder, function(i, name){ + return !(getSupported(name, apis[name])); + }); + } else { + $.each(apis, function(name, api){ + return !(getSupported(name, api)); + }); + } + return supported; + }, + _embedApi: function(elem, supported, apiData){ + var config = $.attr(elem, 'getConfig'), + jElm = $(elem), + dims = {}, + id = elem.id, + fn = function(apiElem){ + apiData.apis[supported.name].apiElem = apiElem; + $(apiElem).addClass(apiData.nodeName); + if(!config.controls){ + $(apiElem).attr({ + tabindex: '-1', + role: 'presentation' + }); + } + apiData.apis[supported.name]._init(); + apiData.apis[supported.name]._trigger({type: 'apiActivated', api: supported.name}); + }, + label = jElm.attr('aria-labelledby') + ; + + if(!id){ + vID++; + id = apiData.nodeName +'-'+vID; + elem.id = id; + } + apiData.apis[supported.name].visualElem = $('<div class="media-element-box mm-'+ apiData.nodeName +'-box" style="position: relative;" />').insertBefore(elem); + + if(label){ + apiData.apis[supported.name].visualElem.attr({ + role: 'group', + 'aria-labelledby': label + }); + } + + if(apiData.nodeName === 'audio' && !config.controls){ + apiData.apis[supported.name].visualElem + .css({ + height: 0, + width: 0 + }) + ; + } else { + apiData.apis[supported.name].visualElem + .css( jElm.getDimensions() ) + ; + $.each(m._transferStyles, function(i, name){ + apiData.apis[supported.name].visualElem.css(name, jElm.css(name)); + }); + } + apiData.apis[supported.name]._embed(supported.src, apiData.name +'-'+ id, config, fn); + }, + getPluginVersion: function(name, plugDesc){ + var plugin = plugDesc || (navigator.plugins && navigator.plugins[name]), + version = [-1, 0], + desc + ; + if(plugin){ + desc = (plugin.description || '').replace(/,/g, '.').match(/(\d+)/g) || ['0']; + if(desc && desc[0]){ + version[0] = desc[0]; + if(desc[1]){ + version[0] += '.'+desc[1]; + } + version[0] = parseFloat(version[0], 10); + if(desc[2]){ + version[1] = parseInt(desc[2], 10); + } + } + } + return version; + }, + embedObject: function(elem, id, attrs, params, activeXAttrs, pluginName){ + elem.style.overflow = 'hidden'; + elem = $('<div />').prependTo(elem)[0]; + var obj; + + if(navigator.plugins && navigator.plugins.length){ + obj = doc.createElement('object'); + $.each(attrs, function(name, val){ + obj.setAttribute(name, val); + }); + + $.each(params, function(name, val){ + var param = doc.createElement('param'); + param.setAttribute('name', name); + param.setAttribute('value', val); + obj.appendChild(param); + }); + obj.setAttribute('id', id); + obj.setAttribute('name', id); + if(params.wmode === 'transparent'){ + obj.style.minHeight = '1px'; + obj.style.minWidth = '1px'; + } + elem.parentNode.replaceChild(obj, elem); + } else if(window.ActiveXObject){ + obj = '<object style="width: 100%; height: 100%; width="100%" height="100%"'; + $.each($.extend({}, attrs, activeXAttrs), function(name, val){ + obj += ' '+ name +'="'+ val +'"'; + }); + obj += ' name="'+ id +'"'; + obj += ' id="'+ id +'"'; + obj += '>'; + $.each(params, function(name, val){ + obj += ' <param name="'+ name +'" value="'+ val +'" />'; + }); + obj += '</object>'; + elem.outerHTML = obj; + obj = doc.getElementById(id); + } + if(obj){ + obj.setAttribute('width', '100%'); + obj.setAttribute('height', '100%'); + } + $(window).unload(function(){ + jQuery.cleanData( [ obj ] ); + obj = null; + }); +// vlc in ie is a little stupid here + setTimeout(function(){ + if( !obj || !obj.style ){return;} + obj.style.width = '100%'; + obj.style.height = '100%'; + }, 0); + return obj; + } + }); + + m.add('nativ', 'video', {}); + m.add('nativ', 'audio', {}); + + function findInitFallback(elem, opts){ + var elemName = elem.nodeName.toLowerCase(); + + //getSupportedSrc and Player + var supported = m.getSuitedPlayers(elem, opts.apiOrder), + apiData = $.data(elem, 'mediaElemSupport') + ; + + // important total fail error event + if(!supported){ + apiData.apis.nativ._trigger({type: 'totalerror'}); + try { + elem.pause(); + } catch(e){} + return; + } + if(supported === 'noSource'){ + apiData.noSource = true; + return; + } + //_setAPIActive returns false if player isn´t embeded + if(!m._setAPIActive(elem, supported.name)){ + m._embedApi(elem, supported, apiData, elemName); + } else if(apiData.apis[supported.name]._mmload){ + apiData.apis[supported.name]._mmload(supported.src, $.attr(elem, 'poster')); + } + } + + var showFallback = function(){ + var fallback = $(this).hide().children(':not(source, track)').clone().insertAfter(this); + $(this).one('mediareset', function(){ + $(this).show(); + fallback.remove(); + }); + }; + + + + $.fn.jmeEmbed = function(opts){ + opts = $.extend(true, {}, $.fn.jmeEmbed.defaults, opts); + if(opts.showFallback && $.support.mediaElements){ + this.bind('totalerror', showFallback); + } + + return this.each(function(){ + var elemName = this.nodeName.toLowerCase(), + supported = false, + elem = this + ; + + if(elemName !== 'video' && elemName !== 'audio' || ($.support.flash9 && $.nodeName(elem.parentNode, 'object'))){return;} + + //remove swf fallback + $('object, embed', this) + .each(function(){ + $('> *:not(param, embed, object)', this).appendTo(elem); + }) + .remove() + ; + + $(this).trigger('jmeBeforeEmbed', { + options: opts, + nodeName: elemName + }) + ; + if(opts.removeControls){ + $.attr(this, 'controls', false); + } + + var apiData = m._create(elemName, 'nativ', this, opts); + apiData.name = 'nativ'; + apiData.apis.nativ.apiElem = this; + apiData.apis.nativ.visualElem = $(this); + apiData.apis.nativ.isAPIActive = true; + $.each(m.apis[elemName], function(name){ + if(name !== 'nativ'){ + m._create(elemName, name, elem, opts); + } + }); + + $(this) + .bind('mediaerror', function(e){ + if(apiData.name === 'nativ'){ + findInitFallback(this, opts); + } + }) + ; + + if($.support.flash9 && opts.activateFlash && opts.flashPlayer){ + supported = m.getSuitedPlayers(elem, [opts.flashPlayer]); + if( supported == 'noSource' ){ + supported = {name: opts.flashPlayer}; + } + apiData.apis.nativ.isAPIReady = true; + if(supported.name == opts.flashPlayer && !m._setAPIActive(this, opts.flashPlayer)){ + m._embedApi(this, supported, apiData, elemName); + } else { + supported = false; + } + } + if( !supported ){ + if(opts.debug || !$.support.mediaElements){ + findInitFallback(this, opts); + apiData.apis.nativ.isAPIReady = true; + } else { + apiData.apis.nativ._init(); + } + } + $.attr(this, 'preload', $.attr(this, 'preload'), true); + + $(this) + .trigger('jmeEmbed', { + options: opts, + nodeName: elemName, + data: apiData + }) + ; + }); + }; + + $.fn.jmeEmbed.defaults = { + debug: false, + removeControls: false, + showFallback: false, + apiOrder: [], + activateFlash: false, + flashPlayer: '' + }; + + // deprecated + $.fn.mediaElementEmbed = $.fn.jmeEmbed; + + if($.cleanData && window.ActiveXObject){ + var _cleanData = $.cleanData; + $.cleanData = function(elems){ + _cleanData(elems); + for(var i = 0, len = elems.length; i < len; i++){ + if(elems[i].nodeName === 'OBJECT'){ + try { + for (var j in elems[i]) { + if (typeof elems[i][j] === "function") { + elems[i][j] = null; + } + } + } catch(e){} + } + } + }; + } + +})(jQuery);/**! + * Part of the jMediaelement-Project | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ +(function($){ + var video = document.createElement('video'), + $m = $.multimediaSupport, + noAPIEvents = { + apiActivated: 1, + apiDeActivated: 1, + mediareset: 1, + native_mediareset: 1, + //these are api-events, but shouldn´t throw mmAPIReady + totalerror: 1, + jmeflashRefresh: 1, + flashblocker: 1 + }, + nuBubbleEvents = { + native_mediareset: 1, + apiDeActivated: 1, + native_mediareset: 1, + apiActivated: 1, + timechange: 1, + progresschange: 1, + mmAPIReady: 1, + jmeflashRefresh: 1 + }, + fsMethods = {} + ; + + if('enterFullScreen' in video && video.supportsFullscreen){ + $.support.videoFullscreen = true; + fsMethods.enter = 'enterFullScreen'; + fsMethods.exit = 'exitFullScreen'; + } else { + $.each(['webkit', 'moz', 'o', 'ms'], function(i, name){ + if(name+'EnterFullScreen' in video && name+'SupportsFullscreen' in video){ + $.support.videoFullscreen = true; + fsMethods.enter = name+'EnterFullScreen'; + fsMethods.exit = name+'ExitFullScreen'; + return false; + } + }); + } + + video = null; + + $.extend($m, { + capturingEvents: function(names){ + if(!document.addEventListener){return;} + if(typeof names == 'string'){ + names = [names]; + } + $.each(names, function(i, name){ + var handler = function( e ) { + e = $.event.fix( e ); + return $.event.handle.call( this, e ); + }; + $.event.special[name] = $.event.special[name] || {}; + $.extend($.event.special[name], { + setup: function() { + this.addEventListener(name, handler, true); + }, + teardown: function() { + this.removeEventListener(name, handler, true); + } + }); + }); + }, + formatTime: function(sec){ + return $.map( + [ + parseInt(sec/60, 10), + parseInt(sec%60, 10) + ], + function(num){ + return (isNaN(num)) ? '--' : (num < 10) ? ('0'+num) : num; + }) + .join(':') + ; + } + }); + + //mediaevents/most html5 events do not bubble normally, except in ff, we make them bubble, because we love this feature + $m.capturingEvents('play pause playing waiting ended'.split(' ')); + //ToDo add jmeReady/mmAPIReady + $.event.special.loadedmeta = { + add: function( details ) { + var api = $(this).getJMEAPI(); + if(api && api.loadedmeta){ + var evt = $.extend({}, api.loadedmeta); + details.handler.call(this, evt, evt); + } + } + }; + + //extend fn + $.extend($m.fn, { + _trigger: function(e){ + var evt = (e.type) ? e : {type: e}, + type = evt.type + ; + + switch(type){ + case 'mmAPIReady': + if(this.isAPIReady){ + return; + } + this.isAPIReady = true; + break; + case 'loadedmeta': + this.loadedmeta = evt; + break; + case 'totalerror': + this.totalerror = true; + break; + case 'mute': + this._muteState = e.isMuted; + break; + case 'volumelevelchange': + this._volumelevelState = e.volumelevel; + break; + case 'mediareset': + this.loadedmeta = false; + this.totalerror = false; + this._bufferLoaded = false; + break; + } + + if(!this.isAPIActive || (this.totalerror && !noAPIEvents[type]) || this._stoppedEvents[type]){return;} + if(!this.isAPIReady && !noAPIEvents[type]){ + this._trigger('mmAPIReady'); + } + + if(e.type === 'progresschange'){ + this._bufferLoaded = e.relLoaded; + } + + e.target = this.element; + e = $.Event(e); + e.preventDefault(); + + evt.mediaAPI = this.name; + + if($.fn.on){ + $.event.trigger( e, evt, this.element, !!(nuBubbleEvents[type]) ); + } else { + if(nuBubbleEvents[type]){ + e.stopPropagation(); + } + $.event.trigger( e, evt, this.element ); + } + }, + _stoppedEvents: {}, + _stopEvent: function(name, autoAllow){ + this._stoppedEvents[name] = true; + if(autoAllow){ + var that = this; + setTimeout(function(){ + that._allowEvent(name); + }, 9); + } + }, + _allowEvent: function(name){ + this._stoppedEvents[name] = false; + }, + supportsFullScreen: function(){ + return this._videoFullscreen || false; + }, + enterFullscreen: $.noop, + exitFullscreen: $.noop, + isAPIReady: false, + isJMEReady: function(){ + return this.isAPIReady; + }, + relCurrentTime: function(rel){ + var dur = this.getDuration() || Number.MIN_VALUE; + if(rel && isFinite(rel)){ + this.currentTime(dur * rel / 100); + } + return this.currentTime() / dur * 100; + }, + getMediaAPI: function(){ + return this.name; + }, + togglePlay: function(){ + this[(this.isPlaying()) ? 'pause' : 'play'](); + }, + toggleMuted: function(){ + this.muted(!(this.muted())); + }, + getJMEVisual: function(){ + return this.visualElem; + }, + jmeReady: function(fn, n){ + var e = {type: 'mmAPIReady'}; + if( this.isJMEReady() && (this.name !== 'nativ' || $.support.mediaElements) ){ + fn.call(this.element, e, e); + } else { + n = n || 'jmediaelement'; + var that = this, + fn2 = function(){ + $(that.element) + .unbind('mmAPIReady.'+n, fn2) + .unbind('jmeflashRefresh.'+n, fn2) + ; + fn.call(that.element, e, e); + }; + $(this.element) + .bind('mmAPIReady.'+n, fn2) + .bind('jmeflashRefresh.'+n, fn2) + ; + } + }, + unAPIReady: function(name){ + $(this.element).unbind('mmAPIReady.'+name); + }, + _adjustPluginLoop: function(pluginLoop){ + var htmlLoop = $.attr(this.element, 'loop'), + api = this + ; + if(htmlLoop !== pluginLoop){ + setTimeout(function(){ + api[ (htmlLoop) ? 'play' : 'pause' ](); + }, 0); + } + }, + _format: $m.formatTime, + getFormattedDuration: function(){ + return this._format(this.getDuration()); + }, + getFormattedTime: function(){ + return this._format(this.currentTime()); + }, + loadSrc: function(srces, poster, mediaName, extras){ + if(srces){ + $.attr(this.element, 'srces', srces); + srces = $.isArray(srces) ? srces : [srces]; + } else { + srces = $.attr(this.element, 'srces'); + } + + if(poster !== undefined){ + if(poster){ + $.attr(this.element, 'poster', poster); + } else { + $(this.element).removeAttr('poster'); + } + } else { + poster = $.attr(this.element, 'poster'); + } + var data = $.data(this.element, 'mediaElemSupport'); + if( typeof mediaName == 'string' ){ + if( data.mediaName ){ + data.mediaName.text(mediaName); + } + } + + data.noSource = !!(srces.length); + + this._isResetting = true; + + var canPlaySrc = this.canPlaySrces(srces); + this._trigger('mediareset'); + if(canPlaySrc){ + canPlaySrc = canPlaySrc.src || canPlaySrc; + this._mmload(canPlaySrc, poster, extras); + } else { + $m._setAPIActive(this.element, 'nativ'); + this._trigger('native_mediareset'); + $(this.element).data('mediaElemSupport').apis.nativ._mmload(); + } + this._isResetting = false; + }, + isPlaying: function(){ + return (this._isResetting) ? false : this._isPlaying(); + }, + _makenum: function(num){ + var ret = false; + if(num == num * 1){ + ret = parseFloat(num, 10); + } + return ret; + } + }); + + // firefox and old webkits (safari 4/chrome 4) are using an extended event, but safari uses load instead of progress + // newer webkits are compilant to the current w3c specification (progress is a simple event + buffered is a timerange-object) + // opera 10.5 hasn´t implemented the timerange-object yet <- no support + var fixProgressEvent = function(api){ + var getConcerningRange = function(){ + var time = api.element.currentTime || 0, + buffered = api.element.buffered, + bufLen = buffered.length, + ret = {} + ; + + for(var i = 0; i < bufLen; i++){ + ret.start = buffered.start(i); + ret.end = buffered.end(i); + if(ret.start <= time && ret.end >= time){ + break; + } + } + return ret; + }, + + calculateProgress = function(e){ + var evt = {type: 'progresschange'}, + dur, bufRange + ; + + //current implementation -> chrome 5/safari 5 + if(this.buffered && this.buffered.length){ + + dur = this.duration; + if(dur){ + bufRange = getConcerningRange(); + evt.relStart = bufRange.start / dur * 100; + evt.relLoaded = bufRange.end / dur * 100; + } + api._trigger(evt); + //ff + safari4 implementation + } else if(e.originalEvent && 'lengthComputable' in e.originalEvent && e.originalEvent.loaded){ + if(e.originalEvent.lengthComputable && e.originalEvent.total){ + evt.relStart = 0; + evt.relLoaded = e.originalEvent.loaded / e.originalEvent.total * 100; + } + api._trigger(evt); + } + //opera fallback + if( !evt.relLoaded && this.readyState === 4 ){ + evt.relStart = 0; + evt.relLoaded = 100; + api._trigger(evt); + } + return evt.relLoaded; + }, + progressInterval = function(){ + if( calculateProgress.call(api.element, { type: 'ipadprogress' }) >= 100 || api.element.readyState === 1 ){ + clearInterval(timer); + } + }, + timer + ; + $(api.element).bind('progress load', calculateProgress); + + //iPad has no progress event + if ('buffered' in api.element) { + $(api.element).bind('play waiting loadstart', function(){ + clearInterval(timer); + if (api.isAPIActive) { + timer = setInterval(progressInterval, 333); + progressInterval(); + } + }); + } + }; + + //add API for native MM-Support + var nativ = { + isTechAvailable: $.support.mediaElements, + _init: function(){ + var that = this, + curMuted = this.apiElem.muted, + //bug: firefox loadingerror + loadingTimer = false, + triggerLoadingErr = function(e){ + clearInterval(loadingTimer); + if ( !that.element.error && that.element.mozLoadFrom && that.isAPIActive && !that.element.readyState && that.element.networkState === 2 && $.support.flash9 ) { + if(e === true){ + //this will abort and start the error handling + that.element.load(); + } else { + loadingTimer = setTimeout(function(){ + triggerLoadingErr(true); + }, ( e === 'initial' ) ? 20000 : 9000); + } + } + } + ; + + //addEvents + fixProgressEvent(this); + + $(this.element) + .bind({ + volumechange: function(){ + if(curMuted !== that.apiElem.muted){ + curMuted = that.apiElem.muted; + that._trigger.call(that, {type: 'mute', isMuted: curMuted}); + } else { + that._trigger.call(that, {type: 'volumelevelchange', volumelevel: that.apiElem.volume * 100}); + } + }, + ended: function(){ + if(that.isAPIActive && this.ended && !this.paused && !$.attr(this, 'loop') ){ + that._stopEvent('pause', true); + this.pause(); + } + }, + timeupdate: function(){ + var e = { + type: 'timechange', + time: this.currentTime + }; + if(this.duration){ + e.duration = this.duration; + e.timeProgress = e.time / e.duration * 100; + } + + that._trigger(e); + }, + //Opera sometimes forgets to dispatch loadedmetadata + progress: function(){ + if(!that.loadedmeta && this.duration){ + that._trigger({ + type: 'loadedmeta', + duration: this.duration + }); + } + }, + loadedmetadata: function(){ + that._trigger({ + type: 'loadedmeta', + duration: this.duration + }); + } + }) + .bind('play playing', function(e){ + if( !that.isAPIActive && e.originalEvent && !that.element.paused && !that.element.ended ){ + try{ + that.element.pause(); + } catch(e){} + } + }) + .bind('mediareset', triggerLoadingErr) + .bind('ended play pause waiting playing', function(e){ + if( (!that.isAPIActive && e.originalEvent && (e.originalEvent.mediaAPI === "nativ" || !e.originalEvent.mediaAPI)) || that._stoppedEvents[e.type]){ + e.stopImmediatePropagation(); + } + }) + ; + + triggerLoadingErr( 'initial' ); + + if( !$.support.mediaLoop ){ + $(this.element).bind('ended', function(){ + if( that.isAPIActive && $.attr(this, 'loop') ){ + var elem = this; + setTimeout(function(){ + ( $.attr(elem, 'loop') && elem.play() ); + }, 0); + } + }); + } + //workaround for loadedmeta and particularly mmAPIReady event + if( this.element.error ){return;} + //jmeEmbed is called very late (after onload) + if ( this.element.readyState > 0 ) { + this._trigger({ + type: 'loadedmeta', + duration: this.element.duration + }); + // if element isn't busy || opera can freeze and mozilla doesn't react on method load + // bug: iPad & iPhone initially report networkState === 2 although they are idling + } else if ( this.element.networkState !== 2 || 'webkitPreservesPitch' in this.element ) { + this._trigger('mmAPIReady'); + } + }, + play: function(){ + this.element.play(); + }, + pause: function(){ + this._allowEvent('pause'); + this.element.pause(); + }, + muted: function(bool){ + if(typeof bool !== 'boolean'){ + return this.element.muted; + } + this.element.muted = bool; + }, + volume: function(vol){ + if(!isFinite(vol)){ + return this.element.volume * 100; + } + this.element.volume = vol / 100; + }, + currentTime: function(sec){ + if(!isFinite(sec)){ + return this.element.currentTime; + } + try { + this.element.currentTime = sec; + } catch(e){} + }, + _mmload: function(){ + if(this.element.load){ + this.element.load(); + } else { + $(this.element).triggerHandler('error'); + } + }, + _isPlaying: function(){ + //readyState should be above 1, but IE9 has a bug here above 1 means isPlaying means now isPlaying or will be playing + return (!this.element.paused && this.element.readyState > 1 && !this.element.error && !this.element.ended); + }, + getDuration: function(){ + return this.element.duration; + }, + getCurrentSrc: function(){ + return this.element.currentSrc; + } + }; + + + + $m.add('nativ', 'video', $.extend({ + _videoFullscreen: $.support.videoFullscreen, + enterFullScreen: function(){ + if(!this._videoFullscreen){return false;} + try { + this.element[fsMethods.enter](); + } catch(e){ + return false; + } + return true; + }, + exitFullScreen: function(){ + if(!this._videoFullscreen){return false;} + try { + this.element[fsMethods.exit](); + } catch(e){ + return false; + } + return true; + } + }, nativ)); + + + $m.add('nativ', 'audio', nativ); + + + //public-methods + $.fn.getJMEAPI = function(full){ + if(!this[0]){return;} + var api = $.data(this[0], 'mediaElemSupport'); + return ( full || !api || !api.name || !api.apis ) ? api : api.apis[api.name]; + }; + + var noAPIMethods = { + jmeReady: 1, + getJMEVisual: 1, + jmeReady: 1, + isJMEReady: 1, + getMediaAPI: 1, + supportsFullScreen: 1 + } + ; + $m.registerAPI = function(names){ + if(typeof names === 'string'){ + names = [names]; + } + $.each(names, function(i, name){ + var fn = $m.apis.video.nativ[name]; + if(fn && !$.fn[name] && $.isFunction(fn) && name.indexOf('_') !== 0){ + $.fn[name] = function(){ + var args = arguments, + ret + ; + this.each(function(){ + var api = $(this).getJMEAPI(); + if(!api){return;} + if( noAPIMethods[name] || (name == 'loadSrc' && $.data(this, 'mediaElemSupport').noSource) || (api.isJMEReady() && !api.totalerror && (api.name !== 'nativ' || $.support.mediaElements) ) ){ + ret = api[name].apply(api, args); + return !(ret !== undefined); + } else { + api.unAPIReady(name+'queue'); + api.jmeReady.call(api, function(){ + api[name].apply(api, args); + }, name+'queue'); + } + }); + return (ret === undefined) ? this : ret; + }; + } + }); + }; + + var fnNames = []; + $.each($m.apis.video.nativ, function(name, fn){ + fnNames.push(name); + }); + + $m.registerAPI(fnNames); + + // deprecated + $.fn.onAPIReady = $.fn.jmeReady; + $.fn.getMMAPI = $.fn.getJMEAPI; + + //plugin mechanism + $m.fn._extend = function(exts, noAPI){ + var names = []; + $.each(exts, function(name, fn){ + $m.fn[name] = fn; + names.push(name); + if(noAPI){ + noAPIMethods[name] = true; + } + }); + $m.registerAPI(names); + }; + +})(jQuery);/**! + * Part of the jMediaelement-Project | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ + +(function($){ + if(!$.event.special.ariaclick){ + (function(){ + var preventclick = false, + handleAriaClick = function(e){ + if(!preventclick && (!e.keyCode || e.keyCode === 13 || ( e.keyCode === 32 && $.attr(e.target, 'role') === 'button' ) )){ + preventclick = true; + setTimeout(function(){ + preventclick = false; + }, 1); + return $.event.special.ariaclick.handler.apply(this, arguments); + } else if(preventclick && e.type == 'click'){ + e.preventDefault(); + return false; + } + return undefined; + } + ; + $.event.special.ariaclick = { + setup: function(){ + $(this).bind('click keydown', handleAriaClick); + return true; + }, + teardown: function(){ + $(this).unbind('click keydown', handleAriaClick); + return true; + }, + handler: function(e){ + e.type = 'ariaclick'; + return $.event.handle.apply(this, arguments); + } + }; + })(); + + } + + var controls = {}, + $m = $.multimediaSupport + ; + + function getElems(elem, o){ + var jElm = $(elem), + ret = {}, + mmID = jElm.attr('data-controls') + ; + + ret.mm = (mmID) ? $('#'+ mmID) : $('video, audio', jElm).filter(':first'); + ret.api = ret.mm.getJMEAPI(true) || ret.mm.jmeEmbed(o.embed).getJMEAPI(true); + if(!ret.api){return ret;} + if(jElm.is(o.controlSel)){ + ret.controls = jElm; + } + + if(!ret.controls || ret.controls.hasClass(o.classPrefix+'media-controls')) { + if( jElm[0] && !ret.api.controlWrapper && $.contains( jElm[0], ret.mm[0] ) ){ + ret.api.controlWrapper = jElm; + } + ret.controls = (ret.controls) ? $(o.controlSel, jElm).add(ret.controls) : $(o.controlSel, jElm); + } + return ret; + } + + + function addWrapperBindings(wrapper, mm, api, o){ + if(wrapper.data('jmePlayer')){return;} + $m.addStateClasses(wrapper, mm, o.classPrefix); + wrapper.data('jmePlayer', {mediaelement: mm, api: api}); + if( $.fn.videoOverlay ){ + wrapper + .videoOverlay({ + video: mm, + startCSS: { + width: 'auto', + height: 'auto', + zIndex: 99998, + padding: 0, + margin: 0, + borderWidth: 0 + }, + position: { + bottom: 0, + left: 0, + right: 0, + top: 0, + width: 0, + height: 0 + } + }) + ; + } + if (!$.ui || !$.ui.keyCode) {return;} + wrapper + .bind('keydown', function(e){ + if( e.jmeHandledEvent ){return;} + e.jmeHandledEvent = true; + if( {40: 1,37: 1,39: 1,38: 1}[e.keyCode] ){ + //user is interacting with the slider don´t do anything + if($(e.target).is('.ui-slider-handle')){return;} + var dif = 5; + switch(e.keyCode) { + case $.ui.keyCode.UP: + if(e.ctrlKey){ + dif += 5; + } + mm.volume( Math.min(100, mm.volume() + dif ) ); + break; + case $.ui.keyCode.DOWN: + if(e.ctrlKey){ + dif += 5; + } + mm.volume( Math.max(0, mm.volume() - dif ) ); + break; + case $.ui.keyCode.LEFT: + if(e.ctrlKey){ + dif += 55; + } + mm.currentTime( Math.max(0, mm.currentTime() - dif ) ); + break; + case $.ui.keyCode.RIGHT: + if(e.ctrlKey){ + dif += 55; + } + mm.currentTime( Math.min( mm.getDuration(), mm.currentTime() + dif ) ); + break; + } + e.preventDefault(); + } else if( e.keyCode === $.ui.keyCode.SPACE && ( !$.nodeName(e.target, 'button') && $.attr(e.target, 'role') !== 'button' || wrapper.hasClass('wraps-fullscreen')) ){ + mm.togglePlay(); + e.preventDefault(); + } + }) + ; + } + + $.fn.jmeControl = function(opts){ + opts = $.extend(true, {}, $.fn.jmeControl.defaults, opts); + opts.controlSel = []; + $.each(controls, function(name){ + if(name !== 'media-controls'){ + opts.controlSel.push('.'+ opts.classPrefix + name); + } + }); + opts.controlSel.push('.'+ opts.classPrefix + 'media-controls'); + opts.controlSel = opts.controlSel.join(', '); + + function registerControl(){ + var elems = getElems(this, opts); + if( !elems.api ){return;} + elems.api.controls = elems.api.controls || []; + if(!elems.api){return;} + elems.controls.each(function(){ + var jElm = $(this); + + if($.inArray(this, elems.api.controls) !== -1){return;} + elems.api.controls.push(this); + $.each(controls, function(name, ui){ + if( jElm.hasClass(opts.classPrefix+name) ){ + var o = $.extend(true, {}, opts); + o[ui.optionsName] = $m.extendWithData(jElm[0], o[ui.optionsName], opts[ui.optionsName]); + ui(jElm, elems.mm, elems.api, o); + return false; + } + }); + }); + if( elems.api.controlWrapper && elems.api.controlWrapper[0] ){ + addWrapperBindings(elems.api.controlWrapper, elems.mm, elems.api, opts); + } + } + + return this.each(registerControl); + }; + + $.fn.jmeControl.defaults = { + //common + embed: {removeControls: true}, + classPrefix: '', + addThemeRoller: true + }; + + $.support.waiaria = (!$.browser.msie || $.browser.version > 7); + + $.fn.jmeControl.getBtn = (function(){ + var split = /\s*\/\s*|\s*\|\s*|\s*\,\s*/g; + return function(control){ + var elems = { + icon: $('.ui-icon', control), + text: $('.button-text', control), + title: control + }; + + if (!control.is(':button') && !control.attr('role')) { + if ($.support.waiaria) { + control.removeAttr('href'); + } + control.attr({ + role: 'button', + tabindex: 0 + }); + } + + if (!elems.icon[0] && !elems.text[0] && !$('*', control)[0]) { + elems.icon = control; + elems.text = control; + } + + elems.names = elems.text.text().split(split); + elems.titleText = (control.attr('title') || '').split(split); + + if (elems.names.length !== 2) { + elems.text = $([]); + } + if (elems.titleText.length !== 2) { + elems.title = $([]); + } + return elems; + }; + })(); + + $m.camelCase = (function(){ + var rdashAlpha = /-([a-z])/ig, + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + } + ; + return function(name){ + return name.replace(rdashAlpha, fcamelCase); + }; + })(); + $.fn.jmeControl.addControl = function(name, fn, ops, optsName){ + ops = ops || {}; + optsName = optsName || $m.camelCase(name); + $.fn.jmeControl.defaults[optsName] = ops; + fn.optionsName = optsName; + controls[name] = fn; + + }; + + $.fn.jmeControl.addControls = function(controls){ + $.each(controls, function(i, control){ + $.fn.jmeControl.addControl(control.name, control.fn, control.options, control.optionName); + }); + }; + + $.fn.registerMMControl = $.fn.jmeControl; + + + //implement controls + var toggleModells = { + 'play-pause': {stateMethod: 'isPlaying', actionMethod: 'togglePlay', evts: 'play playing pause ended loadedmeta mediareset', trueClass: 'ui-icon-pause', falseClass: 'ui-icon-play'}, + 'mute-unmute': {stateMethod: 'muted', actionMethod: 'toggleMuted', evts: 'mute loadedmeta', trueClass: 'ui-icon-volume-off', falseClass: 'ui-icon-volume-on'} + } + ; + + $.each(toggleModells, function(name, opts){ + $.fn.jmeControl.addControl(name, function(control, mm, api, o){ + var elems = $.fn.jmeControl.getBtn(control); + if(o.addThemeRoller){ + control.addClass('ui-state-default ui-corner-all'); + } + function changeState(e){ + var state = (name == 'play-pause' && e && e.type == 'playing') ? true : mm[opts.stateMethod](); + + if(state){ + elems.text.text(elems.names[1]); + elems.title.attr('title', elems.titleText[1]); + elems.icon.addClass(opts.trueClass).removeClass(opts.falseClass); + } else { + elems.text.text(elems.names[0]); + elems.title.attr('title', elems.titleText[0]); + elems.icon.addClass(opts.falseClass).removeClass(opts.trueClass); + } + } + + changeState(); + + mm + .bind(opts.evts, changeState) + .jmeReady(changeState) + ; + control.bind('ariaclick', function(e){ + mm[opts.actionMethod](); + e.preventDefault(); + }); + }); + }); + + + + $.each(['current-time', 'remaining-time'], function(i, name){ + $.fn.jmeControl.addControl(name, function(control, mm, api, o){ + var timeChange = ( name == 'remaining-time' ) ? + function(e, evt){ + control.html( api.apis[api.name]._format( duration - evt.time )); + } : + function(e, evt){ + control.html(api.apis[api.name]._format(evt.time)); + }, + duration = Number.MIN_VALUE + ; + + if(o.addThemeRoller){ + control.addClass('ui-widget-content ui-corner-all'); + } + control.html('00:00').attr('role', 'timer'); + + if( name == 'remaining-time' ){ + mm.bind('loadedmeta', function(e, evt){ + duration = evt.duration || Number.MIN_VALUE; + timeChange(false, {time: 0}); + }); + } + mm + .bind('timechange', timeChange) + .bind('mediareset', function(){ + control.html('00:00'); + }) + ; + }); + }); + + $.fn.jmeControl.addControls([ + { + name: 'duration', + fn: function(control, mm, api, o){ + if(o.addThemeRoller){ + control.addClass('ui-widget-content ui-corner-all'); + } + control.html('00:00'); + mm + .bind('loadedmeta', function(e, evt){ + control.html(api.apis[api.name]._format(evt.duration)); + }) + .bind('mediareset', function(){ + control.html('00:00'); + }) + ; + + } + }, + { + name: 'media-controls', + options: { + dynamicTimeslider: false, + timeSliderAdjust: 0, + excludeSel: false, + fullWindowOverlay: false + }, + fn: function(control, mm, api, o){ + if(o.addThemeRoller){ + control.addClass('ui-widget ui-widget-header ui-corner-all'); + } + control.attr('role', 'toolbar'); + function calcSlider(){ + var space = control.width() + o.mediaControls.timeSliderAdjust, + occupied = timeSlider.outerWidth(true) - timeSlider.innerWidth() + ; + + $('> *', control).each(function(){ + if(timeSlider[0] !== this && this.offsetWidth && $.curCSS(this, 'position') !== 'absolute' && ( !o.excludeSel || !$(this).is(o.excludeSel) ) ){ + occupied += $(this).outerWidth(true); + } + }); + timeSlider.css('width', space - occupied); + } + + if(o.mediaControls.dynamicTimeslider){ + var timeSlider = $('.'+ o.classPrefix +'timeline-slider', control), + calcTimer = setTimeout(calcSlider, 0) + ; + + mm.jmeReady(function(){ + clearInterval(calcTimer); + setTimeout(calcSlider, 0); + }); + $(window).bind('resize', calcSlider); + mm.bind('resize emchange', calcSlider); + } + if(o.mediaControls.fullWindowOverlay && $.fn.videoOverlay ){ + control.videoOverlay({ + fullscreenClass: o.classPrefix +'controls-fullscreenvideo', + video: mm, + startCSS: { + width: 'auto' + }, + position: { + bottom: 0, + left: 0, + right: 0 + } + }); + } + } + }, + { + name: 'media-label', + fn: (function(){ + var labelID = 0; + return function(control, mm, data, o){ + if (!data.controlWrapper || data.controlWrapper.attr('role')) { + return; + } + var id = control.attr('id'), mediaName = $('.' + o.classPrefix + 'media-name', control); + if (!id) { + labelID++; + id = o.classPrefix + 'media-label-' + labelID; + control.attr('id', id); + } + data.mediaName = (mediaName[0]) ? mediaName : control; + data.controlWrapper.attr({ + role: 'group', + 'aria-labelledby': id + }); + }; + })() + }, + { + name: 'fallback', + fn: function(control, mm, api, o){ + if( o.embed.showFallback || !$.support.mediaElements ){return;} + var fallback = control.clone(true), + showFallback = function(){ + mm.after(fallback).hide(); + $(this).one('mediareset', function(){ + mm.show(); + fallback.detach(); + }); + } + ; + mm.bind('totalerror', showFallback); + } + }, + { + name: 'media-state', + options: { + click: 'togglePlay' + }, + fn: function(control, mm, api, o){ + $m.addStateClasses(control, mm, o.classPrefix); + if( o.mediaState.click && mm[o.mediaState.click] ){ + control.click(function(){ + mm[o.mediaState.click](); + }); + } + + } + } + ]); + + $m.addStateClasses = function(control, mm, prefix){ + prefix = prefix || ''; + var stateClasses = prefix+'playing '+ prefix +'totalerror '+ prefix +'waiting '+ prefix +'idle '+ prefix +'flashblocker', + removeStateClasses = function(){ + control.removeClass(stateClasses); + } + ; + mm.jmeReady(function(){ + var playing = mm.isPlaying(); + if(typeof playing !== 'boolean'){return;} + control.addClass(prefix+ (playing) ? 'idle' : 'playing'); + }); + + control.addClass(prefix + mm.getMediaAPI()); + mm + .bind({ + apiActivated: function(e, d){ + control.addClass(prefix + d.api); + }, + apiDeActivated: function(e, d){ + control.removeClass(prefix + d.api); + } + }) + .bind('playing totalerror waiting flashblocker', function(e){ + removeStateClasses(); + control.addClass(prefix + e.type); + }) + .bind('play', function(){ + control.removeClass(prefix + 'idle'); + }) + .bind('pause ended mediareset', function(e){ + removeStateClasses(); + control.addClass(prefix +'idle'); + }) + .bind('canplay', function(e){ + control.removeClass(prefix +'waiting'); + }) + ; + }; + + (function(){ + var sliderMethod = ($.fn.a11ySlider) ? 'a11ySlider' : 'slider'; + var sliderOpts = {range: false, animate: false}; + + $(function(){ + sliderMethod = ($.fn.a11ySlider) ? 'a11ySlider' : 'slider'; + }); + + $.fn.jmeControl.addControls([ + { + name: 'timeline-slider', + optionName: 'timeSlider', + options: sliderOpts, + fn: function(control, mm, api, o){ + var stopSlide = false, + changeTimeState = function(e, ui){ + var time = parseInt( ui.timeProgress, 10 ); + if(ui.timeProgress !== undefined && !stopSlide ){ + control[sliderMethod]('value', ui.timeProgress); + } + }, + changeDisabledState = function(){ + if(api.apis[api.name].loadedmeta && api.apis[api.name].loadedmeta.duration){ + control[sliderMethod]('option', 'step', 100 / Math.max( 100, control[0].offsetWidth ) ); + control[sliderMethod]('option', 'disabled', false); + } else { + control[sliderMethod]('option', 'disabled', true); + } + } + ; + + control[sliderMethod](o.timeSlider)[sliderMethod]('option', 'disabled', true); + $(window).bind('resize', changeDisabledState); + $(document).bind('emchange', changeDisabledState); + mm + .bind('loadedmeta resize', changeDisabledState) + .bind('timechange', changeTimeState) + .bind('mediareset', function(){ + control[sliderMethod]('value', 0); + changeDisabledState(); + }) + .bind('ended', function(){ + control[sliderMethod]('value', 100); + }) + ; + control + .bind('slidestart', function(e, ui){ + if (e.originalEvent) { + stopSlide = true; + } + }) + .bind('slidestop', function(e, ui){ + stopSlide = false; + }) + .bind('slide', function(e, ui){ + if(e.originalEvent && api.apis[api.name].isAPIReady){ + api.apis[api.name].relCurrentTime(ui.value); + } + }) + ; + } + }, + { + name: 'volume-slider', + options: $.extend( {mutestate: false}, sliderOpts ), + fn: function(control, mm, api, o){ + var stopSlide = false; + + control[sliderMethod](o.volumeSlider)[sliderMethod]('option', 'disabled', true); + + function changeVolumeUI(e, data){ + if (stopSlide) {return;} + if(e.type == 'volumelevelchange') { + control[sliderMethod]('value', data.volumelevel); + } else { + control[sliderMethod]('value', ( mm.muted() ) ? 0 : mm.volume() ); + } + + } + + control + .bind('slidestart', function(e){ + if (e.originalEvent) { + stopSlide = true; + } + }) + .bind('slidestop', function(){ + stopSlide = false; + }) + .bind('slide', function(e, ui){ + if(e.originalEvent && api.apis[api.name].isAPIReady){ + api.apis[api.name].volume(ui.value); + if( o.volumeSlider.mutestate && api.apis[api.name].muted() ){ + api.apis[api.name].muted(false); + } + } + }) + ; + + mm + .bind('volumelevelchange loadedmeta', changeVolumeUI) + .jmeReady(function(){ + control[sliderMethod]('option', 'disabled', false); + changeVolumeUI({type: 'ready'}); + }) + ; + //todo!!! + if(o.volumeSlider.mutestate){ + mm.bind('mute', changeVolumeUI); + } + } + }, + { + name: 'progressbar', + fn: function(control, mm, api, o){ + control.progressbar(o.progressbar).progressbar('option', 'disabled', true); + + function changeProgressUI(e, ui){ + if ('relLoaded' in ui) { + control.progressbar('option', 'disabled', false).progressbar('value', ui.relLoaded); + } else { + control.progressbar('option', 'disabled', true); + } + } + + function resetProgress(e, ui){ + control.progressbar('option', 'disabled', true).progressbar('value', 0); + } + + mm + .bind('progresschange', changeProgressUI) + .bind('mediareset', resetProgress) + ; + + } + } + ]); + })(); +})(jQuery);/**! + * Part of the jMediaelement-Project | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ + +(function($){ + + var swfAttr = {type: 'application/x-shockwave-flash'}, + aXAttrs = {classid: 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'}, + m = $.multimediaSupport + ; + + $.extend($.fn.jmeEmbed.defaults, + { + flashPlayer: 'jwPlayer', + jwPlayer: { + path: m.jsPath + 'player.swf', + hideIcons: 'auto', + vars: {}, + attrs: {}, + plugins: {}, + params: { + allowscriptaccess: 'always', + allowfullscreen: 'true' + } + } + } + ) + ; + + $(function(){ + var path = ($('script.jwPlayer')[0] || {}).src; + if(path){ + $.fn.jmeEmbed.defaults.jwPlayer.path = path; + } + }); + + var regs = { + A: /&/g, + a: /&/g, + e: /\=/g, + q: /\?/g + }, + providerMatch = { + audio: 'sound', + video: 'video' + }, + replaceVar = function(val){ + return (val.replace) ? val.replace(regs.A, '%26').replace(regs.a, '%26').replace(regs.e, '%3D').replace(regs.q, '%3F') : val; + } + ; + + + + (function(){ + $.support.flash9 = false; + $.support.flashVersion = 0; + var swf = m.getPluginVersion('Shockwave Flash'), + supportsMovieStar = function(obj, _retest){ + $.support.flash9 = false; + try { + //opera needs typeof check do not use 'GetVariable' in obj + if (obj && typeof obj.GetVariable !== 'undefined') { + var version = obj.GetVariable("$version"); + obj = m.getPluginVersion('', { + description: version + }); + $.support.flashVersion = obj[0]; + $.support.flash9 = !!(obj[0] > 9 || (obj[0] === 9 && obj[1] >= 115)); + } + } catch (e) {} + + } + ; + if(swf && swf[0]){ + $.support.flashVersion = swf[0]; + } + if(swf[0] > 9 || (swf[0] === 9 && swf[1] >= 115)){ + //temp result + + $.support.flash9 = true; + $(function(){ + swf = $('<object />', swfAttr).appendTo('body'); + supportsMovieStar(swf[0]); + swf.remove(); + }); + } else if(window.ActiveXObject){ + try { + swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); + supportsMovieStar(swf); + swf = null; + } catch(e){} + } + })(); + + var jwMM = { + isTechAvailable: function(){ + return $.support.flash9; + }, + _extendJWLoad: function(src, obj, elem){ + if(!src){return;} + + elem = elem || this.element; + var changeVars = this.embedOpts.jwPlayer.changeVars; + m.extendWithData(elem, obj, ['type', 'provider', 'stretching', 'bufferlength', 'streamer']); + obj.file = (elem.getAttribute('data-jwprefixsrc') || '') + obj.file; + // if we can't autodetect provider by file-extension, + // we add a provider + var ext = m.getExt(src), + name = (ext == 'm4r') ? 'video' : this.nodeName + ; + if(ext == 'm4r' || !this.canPlaySrc(src)){ + if(!obj.provider){ + obj.provider = providerMatch[name]; + } + if(!obj.type){ + obj.type = providerMatch[name]; + } + } + if(changeVars){ + changeVars(src, obj, elem, this); + } + return obj; + }, + _embed: function(src, id, cfg, fn){ + var opts = this.embedOpts.jwPlayer, + vars = $.extend({}, opts.vars, {file: src, id: id}), + attrs = $.extend({name: id}, opts.attrs, swfAttr, !(window.ActiveXObject) ? {data: opts.path} : {}), + params = $.extend({movie: opts.path}, opts.params), + plugins = [], + that = this + ; + + this._extendJWLoad(src, vars); + + if(cfg.poster){ + vars.image = cfg.poster; + } + + vars.autostart = ''+ cfg.autoplay; + vars.repeat = (cfg.loop) ? 'single' : 'false'; + vars.controlbar = (cfg.controls) ? 'bottom' : 'none'; + + if( !cfg.controls && this.nodeName !== 'audio' && params.wmode === undefined ){ + params.wmode = 'transparent'; + } + + if( (!cfg.controls && opts.hideIcons && params.wmode === 'transparent') || opts.hideIcons === true ){ + vars.icons = 'false'; + vars.showicons = 'false'; + } + + if( params.wmode === 'transparent' && !vars.screencolor && !attrs.bgcolor ){ + vars.screencolor = 'ffffffff'; + attrs.bgcolor = '#000000'; + } + + params.flashvars = []; + $.each(vars, function(name, val){ + params.flashvars.push(replaceVar(name)+'='+replaceVar(val)); + }); + + $.each(opts.plugins, function(name, src){ + plugins.push(src); + }); + if(plugins.length){ + params.flashvars.push( 'plugins='+ ( plugins.join(',') ) ); + } + params.flashvars = params.flashvars.join('&'); + fn(m.embedObject( this.visualElem[0], id, attrs, params, aXAttrs, 'Shockwave Flash' )); + setTimeout(function(){ + var swf = $('object', that.visualElem)[0]; + if( !swf || (swf.style.display === 'none' && $('> *', that.visualElem).length > 1 ) ){ + $('div[bgactive]', that.visualElem).css({width: '100%', height: '100%'}); + that._trigger('flashblocker'); + } + }, 9); + }, + canPlaySrc: function(media){ + var ret = m.fn.canPlaySrc.apply(this, arguments), + index = -1, + src = media.src || media + ; + + if( !ret && typeof src === 'string' ){ + index = src.indexOf('youtube.com/'); + if(index < 15 && index > 6){ + ret = 'maybe'; + } + } + + return ret; + }, + canPlayCodecs: ['avc1.42E01E', 'mp4a.40.2', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'VP6', 'mp3', 'AAC'], + canPlayContainer: ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'jwplayer/jwplayer'] + } + ; + + m.add('jwPlayer', 'video', jwMM); + m.add('jwPlayer', 'audio', jwMM); + +})(jQuery); +/**! + * Part of the jMediaelement-Project | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ + +(function($){ + var doc = document, + $m = $.multimediaSupport, + rep = /^jwPlayer-/ + ; + + function getAPI(id){ + if(!id){return;} + id = id.replace(rep, ''); + return $.data(doc.getElementById(id), 'mediaElemSupport').apis.jwPlayer; + } + + window.jwEvents = { + View: { + PLAY: function(obj){ + var api = obj.state && getAPI(obj.id); + if(!api){return;} + api._trigger('play'); + api._$isPlaystate = true; + } + }, + Model: { + BUFFER: function(obj){ + var api = getAPI(obj.id); + if(!api){return;} + + if( api._$timeProgress && obj.percentage + api._$startBuffer + 1 < api._$timeProgress ){ + api._$startBuffer = api._$timeProgress; + } + var evt = { + type: 'progresschange', + relLoaded: obj.percentage + api._$startBuffer, + relStart: 0 + }; + api._$buffered = evt.relLoaded; + api._trigger(evt); + }, + STATE: function(obj){ + var state = privJwEvents.Model.STATE(obj); + if(state === 'playing'){ + var api = getAPI(obj.id); + if(!api){return;} + api._trigger('playing'); + api._$isPlaystate = true; + } + }, + META: function(obj){ + if(obj.type === 'metadata'){ + var api = getAPI(obj.id); + if(!api){return;} + api._trigger({ + type: 'loadedmeta', + duration: obj.duration + }); + } + + }, + TIME: function(obj){ + var api = getAPI(obj.id), + e = { + type: 'timechange', + time: obj.position + } + ; + if(!api){return;} + + //workaround: meta isn´t triggered on audio | ToDo: Is this needed with jwplayer 5.1.x? + if(!api.loadedmeta){ + api._trigger({ + type: 'loadedmeta', + duration: obj.duration + }); + } + + api._$currentPos = obj.position; + if(obj.duration){ + e.duration = obj.duration; + e.timeProgress = obj.position / obj.duration * 100; + api._$timeProgress = e.timeProgress; + } + api._trigger(e); + }, + STATE: function(obj){ + if(obj.newstate === 'IDLE'){ + return false; + } + var api = getAPI(obj.id), + type + ; + if(!api){return false;} + switch(obj.newstate) { + case 'PLAYING': + type = 'playing'; + break; + case 'PAUSED': + api._$isPlaystate = false; + type = 'pause'; + break; + case 'COMPLETED': + api._$isPlaystate = false; + type = 'ended'; + api._adjustPluginLoop( (api.apiElem.getConfig().repeat == 'single') ); + break; + case 'BUFFERING': + type = 'waiting'; + break; + } + + if(type){ + api._trigger(type); + } + return type; + } + }, + Controller: { + VOLUME: function(obj){ + var api = getAPI(obj.id); + if(!api || api._$lastMuteState !== api.muted() ){return;} + api._trigger({type: 'volumelevelchange', volumelevel: obj.percentage}); + }, + MUTE: function(obj){ + var api = getAPI(obj.id); + if(!api){return;} + api._$lastMuteState = obj.state; + api._trigger({type: 'mute', isMuted: obj.state}); + } + } + }; + + window.playerReady = function (obj) { + + var api = getAPI(obj.id); + if(!api){return;} + //https://bugzilla.mozilla.org/show_bug.cgi?id=90268 every html5video shim has this problem fix it!!! + if(api.isAPIReady){ + if(!api.apiElem.sendEvent){ + api._$reInit(); + return; + } else { + setTimeout(function(){ + if( api._lastLoad ){ + api._mmload(api._lastLoad.file, api._lastLoad.image); + } + if(api._$isPlaystate && !(api.apiElem.getConfig() || {}).autostart){ + api.play(); + } + }, 8); + } + setTimeout(function(){ + api._trigger('jmeflashRefresh'); + }, 8); + } else if(!api.apiElem.sendEvent){ + api._$reInit(); + return; + } + + //add events + $.each(jwEvents, function(mvcName, evts){ + $.each(evts, function(evtName){ + api.apiElem['add'+ mvcName +'Listener'](evtName, 'jwEvents.'+ mvcName +'.'+ evtName); + }); + }); + + //preload workaround + setTimeout(function(){ + api._$lastMuteState = api.muted(); + var cfg = $.attr(api.element, 'getConfig'); + api._trigger('mmAPIReady'); + if(!cfg.autoplay && !api._$isPlaystate && (api.apiElem.getConfig() || {}).state === 'IDLE'){ + if( api.nodeName === 'audio' && cfg.preload === 'auto' ){ + api.apiElem.sendEvent('PLAY', 'true'); + api.apiElem.sendEvent('PLAY', 'false'); + } else if( api.nodeName === 'video' && cfg.preload !== 'none' && !cfg.poster ){ + api.apiElem.sendEvent('PLAY', 'true'); + api.apiElem.sendEvent('PLAY', 'false'); + api.currentTime(0); + } + } + }, 9); + }; + + var jwAPI = { + _init: function(){ + this._$resetStates(); + }, + _$resetStates: function(){ + this._$buffered = 0; + this._$startBuffer = 0; + this._$timeProgress = 0; + this._$currentPos = 0; + }, + _$reInitCount: 0, + _$reInitTimer: false, + _$reInit: function(){ + var that = this; + if(this._$reInitCount < 5){ + this.visualElem[0].style.overflow = 'visible'; + setTimeout(function(){ + that.visualElem[0].style.overflow = 'hidden'; + }, 0); + } + this._$reInitCount++; + this._$resetStates(); + if(!this._$reInitTimer){ + this._$reInitTimer = true; + setTimeout(function(){ + that._$reInitCount = 0; + that._$reInitTimer = false; + }, 20000); + } + }, + play: function(){ + this.apiElem.sendEvent('PLAY', 'true'); + this._$isPlaystate = true; + this._trigger('play'); + }, + pause: function(){ + this.apiElem.sendEvent('PLAY', 'false'); + }, + _isPlaying: function(){ + var cfg = this.apiElem.getConfig(); + return (cfg) ? (cfg.state === 'PLAYING' ) : undefined; + }, + _mmload: function(src, poster, jwExtras){ + var playing = this._isPlaying(); + this._lastLoad = {file: src}; + if(poster){ + this._lastLoad.image = poster; + } + this._$resetStates(); + this._extendJWLoad(src, this._lastLoad); + if(typeof jwExtras == 'object'){ + $.extend(this._lastLoad, jwExtras); + } + if(!this.apiElem.sendEvent){return;} + this.apiElem.sendEvent('LOAD', this._lastLoad); + if( this.isAPIActive && ($.attr(this.element, 'autoplay') || playing) ){ + this.apiElem.sendEvent('PLAY', 'true'); + } else { + this.apiElem.sendEvent('PLAY', 'false'); + } + }, + muted: function(state){ + if(typeof state !== 'boolean'){ + var cfg = this.apiElem.getConfig(); + return (cfg || {}).mute; + } + this.apiElem.sendEvent('mute', ''+state); + }, + currentTime: function(t){ + if(!isFinite(t)){ + return this._$currentPos || 0; + } + this._$currentPos = t; + var playing = this._isPlaying(); + this.apiElem.sendEvent('SEEK', t); + if(!playing){ + this.pause(); + } + this._trigger({type: 'timechange', time: t}); + }, + getDuration: function(){ + var t = this.apiElem.getPlaylist()[0].duration || 0; + return t < 0 ? 0 : t; + }, + volume: function(v){ + if(!isFinite(v)){ + return parseInt(this.apiElem.getConfig().volume, 10); + } + var wasMuted = this.muted(); + this.apiElem.sendEvent('VOLUME', ''+v); + if(wasMuted){ + this.apiElem.sendEvent('mute', 'true'); + } + }, + getCurrentSrc: function(){ + return (this.apiElem.getConfig() || {}).file || ''; + } + }; + + // ff flash refreshbug https://bugzilla.mozilla.org/show_bug.cgi?id=90268 + // opera also has some problems here + $.extend(jwAPI, { + isJMEReady: function(){ + var ret = false; + if(this.isAPIReady && this.apiElem.sendEvent && this.apiElem.getConfig){ + // seems stupid, but helps :-) + ( $.browser.mozilla && this.apiElem.getConfig() ); + ret = true; + } + return ret; + } + }); + + + $m.add('jwPlayer', 'video', $.extend({}, jwAPI, { + exitFullScreen: function(){ + if(this.apiElem.jmeExitFullScreen){ + try { + this.apiElem.jmeExitFullScreen(); + return true; + } catch(e){} + } + return false; + } + })); + + $m.add('jwPlayer', 'audio', jwAPI); + +})(jQuery); diff --git a/chimere/static/jme/packages/mm.full.min.js b/chimere/static/jme/packages/mm.full.min.js new file mode 100644 index 0000000..0afaf63 --- /dev/null +++ b/chimere/static/jme/packages/mm.full.min.js @@ -0,0 +1,90 @@ +/**! + * Part of the jMediaelement-Project v1.3.5 | http://github.com/aFarkas/jMediaelement + * @author Alexander Farkas + * Copyright 2010, Alexander Farkas + * Dual licensed under the MIT or GPL Version 2 licenses. + */ +(function(a){function w(){a.event.special.mediaerror.handler.apply(a(this).closest("video, audio")[0],arguments)}function x(b){if(a.support.mediaElements){var e=a.data(this,"mediaElemSupport");if(e&&e.apis){b&&b.type&&a.data(this,"calledMediaError",false);e=e.apis;b=this;var g=a.attr(this,"srces");if(b.error||g.length&&!e.nativ.canPlaySrces(g)){a.event.special.mediaerror.handler.call(this,a.Event("mediaerror"));try{b.pause()}catch(m){}}a("source",this).unbind("error",w).filter(":last").bind("error", +w)}}}function y(b,e){var g=b.nodeName.toLowerCase();e=r.getSuitedPlayers(b,e.apiOrder);var m=a.data(b,"mediaElemSupport");if(e)if(e==="noSource")m.noSource=true;else if(r._setAPIActive(b,e.name))m.apis[e.name]._mmload&&m.apis[e.name]._mmload(e.src,a.attr(b,"poster"));else r._embedApi(b,e,m,g);else{m.apis.nativ._trigger({type:"totalerror"});try{b.pause()}catch(n){}}}a.multimediaSupport={};var r=a.multimediaSupport,i=(new Date).getTime(),f=document,c=a("<video />")[0],h=!("webkitPreservesPitch"in c&& +parseFloat(a.browser.version,10)<535&&(navigator.userAgent.indexOf("Chrome")!==-1||navigator.userAgent.indexOf("Mac")===-1));a.support.video=!!c.canPlayType;a.support.autoBuffer=!!("autobuffer"in c);a.support.audio=!!a("<audio />")[0].canPlayType;c=null;a("<source />");a("<track />");a.support.mediaElements=a.support.video&&a.support.audio;a.support.dynamicHTML5=!!a("<video><div></div></video>")[0].innerHTML;a.support.mediaLoop="loop"in a("<video />")[0];a.browser.deprecatedPoster=!h;a.fixHTML5=function(){var b, +e;return a.support.dynamicHTML5?function(g){return g}:function(g){if(!b){e=document.body;b=document.createElement("div");b.style.display="none"}var m=b.cloneNode(false);e.appendChild(m);m.innerHTML=g;e.removeChild(m);return m.childNodes}}();var k=["float"];a.each(["Top","Left","Right","Bottom"],function(b,e){k.push("margin"+e);k.push("padding"+e);k.push("border"+e+"Width");setTimeout(function(){r._transferStyles.push("border"+e+"Color");r._transferStyles.push("border"+e+"Style")},1)});a.fn.getDimensions= +function(){var b={width:0,height:0};if(this[0]){var e=this,g=this[0].style;b.height=g.height||this.height();b.width=g.width||this.width();a.each(k,function(m,n){b[n]=g[n]||e.css(n)})}return b};var d=a.attr,j=/video|audio|source/i,l={src:1,poster:1},p={loop:1,autoplay:1,controls:1},o={srces:1,getConfig:1,preload:1},s={auto:1,metadata:1,none:1},u={change:function(b,e,g){if(a.support.mediaElements){var m=b.getAttribute("preload")||"metadata";if(g||e!==m)if(h){if(a.support.autoBuffer)b.autobuffer=e=== +"auto"}else if(e==="none"||m==="none"&&(e==="auto"||!b.getAttribute("poster"))){a(b).unbind("play",u.changePlayMode);e==="none"&&a(b).bind("play",u.changePlayMode);a.attr(b,"srces",a.attr(b,"srces"),e)}}},changeAutoplay:function(b,e){if(a.support.mediaElements&&!h&&a.attr(b,"preload")==="none"&&e!==a.attr(b,"autoplay")){var g=a.attr(b,"srces");a.attr(b,"srces",g,"auto");g.length&&e&&setTimeout(function(){b.play&&a(b).getMediaAPI()==="nativ"&&b.play()},9)}},changePlayMode:function(){u.changeAutoplay(this, +true)},addSrces:function(b,e,g){if(h||!a.support.mediaElements)return false;g=g||a.attr(b,"preload");a(b).unbind("play",u.changePlayMode);if(g==="auto"||a.attr(b,"autoplay"))return a.data(b,"jme-srces",false);a(b).bind("play",u.changePlayMode);a.data(b,"jme-srces",e);return true}};a.attr=function(b,e,g,m){if(!(b.nodeName&&j.test(b.nodeName)&&(o[e]||p[e]||l[e])))return d(b,e,g,m);var n;if(g===undefined){if(p[e])return typeof b[e]==="boolean"?b[e]:!!(b.attributes[e]||{}).specified;if(l[e])return a.support.video&& +b[e]||r.makeAbsURI(b.getAttribute(e));switch(e){case "srces":if(n=a.data(b,"jme-srces"))break;if(n=a.attr(b,"src"))n=[{src:n,type:b.getAttribute("type"),media:b.getAttribute("media")}];else{n=[];a("source",b).each(function(){n.push({src:a.attr(this,"src"),type:this.getAttribute("type"),media:this.getAttribute("media")})});n.length||a("a.source",b).each(function(){n.push({src:this.href,type:this.getAttribute("type"),media:this.getAttribute("data-media")})})}break;case "getConfig":n={};a.each(["autoplay", +"loop","controls","poster","preload"],function(q,t){n[t]=a.attr(b,t)});break;case "preload":n=b.preload||b.getAttribute("preload");if(n==="")n="auto";s[n]||(n="metadata");break}return n}else if(p[e]){g=!!g;b[e]=g;e==="autoplay"&&u.changeAutoplay(b,g);if(g){b[e]=g;b.setAttribute(e,e)}else{b[e]=g;b.removeAttribute(e)}}else if(l[e])b.setAttribute(e,g);else if(e==="srces"){a("source, a.source",b).remove();b.removeAttribute("src");g=a.isArray(g)?g:[g];u.addSrces(b,g,m)||a.each(g,function(q,t){n=f.createElement("source"); +if(typeof t==="string")t={src:t};n.setAttribute("src",t.src);t.type&&n.setAttribute("type",t.type);t.media&&n.setAttribute("media",t.media);b.appendChild(n)})}else if(e==="getConfig")a.each(g,function(q,t){a.attr(b,q,t)});else if(e==="preload"){if(g==="")g="auto";else s[g]||(g="metadata");u.change(b,g,m);b.setAttribute(e,g)}};a.event.special.mediaerror={setup:function(){var b=a(this).bind("error",a.event.special.mediaerror.handler).bind("native_mediareset",x);setTimeout(function(){b.each(x)},0)}, +teardown:function(){a(this).unbind("error",a.event.special.mediaerror.handler).find("source").unbind("error",w)},handler:function(b){if(!a.data(this,"calledMediaError")){b=a.extend({},b||{},{type:"mediaerror"});a.data(this,"calledMediaError",true);return a.event.handle.apply(this,arguments)}}};r.getExt=function(b){var e=b.indexOf("?"),g="";b=e>0?b.substring(0,e):b;e=b.lastIndexOf(".")+1;return(g=b.substr(e))&&g.toLowerCase?g.toLowerCase():g};var A=r.getExt,z={audio:{"audio/ogg":["ogg","oga","ogm"], +"audio/mpeg":["mp2","mp3","mpga","mpega"],"audio/mp4":["mp4","mpg4","m4r"],"audio/wav":["wav"],"audio/x-m4a":["m4a"],"audio/x-m4p":["m4p"],"audio/3gpp":["3gp","3gpp"],"audio/webm":["webm"]},video:{"video/ogg":["ogg","ogv","ogm"],"video/mpeg":["mpg","mpeg","mpe"],"video/mp4":["mp4","mpg4","m4v"],"video/quicktime":["mov","qt"],"video/x-msvideo":["avi"],"video/x-ms-asf":["asf","asx"],"video/flv":["flv","f4v"],"video/3gpp":["3gp","3gpp"],"video/webm":["webm"]}};a.extend(r,{jsPath:function(){var b=a("script"); +b=b[b.length-1].src.split("?")[0];return b.slice(0,b.lastIndexOf("/")+1)}(),extendWithData:function(){var b={string:1,number:1,"boolean":1};return function(e,g,m){m||(m=g);a.each(m,a.isArray(m)?function(n,q){r.getData(e,q,g)}:function(n,q){b[typeof q]&&r.getData(e,n,g)});return g}}(),getData:function(){var b=function(e,g){e=e.getAttribute("data-"+g);if(!(!e&&e!==""))return e*1==e?parseFloat(e,10):e==="false"?false:e==="true"?true:e};return function(e,g,m){var n=g;m=m||{};if(typeof g==="string")g= +[n];a.each(g,a.isArray(g)?function(q,t){q=b(e,t);if(q!==undefined)m[t]=q}:function(q){var t=b(e,q);if(t!==undefined)m[q]=t});return m}}(),registerMimetype:function(b,e){arguments.length===1?a.each(z,function(g){r.registerMimetype(g,b)}):a.each(e,function(g,m){if(z[b][g])z[b][g]=[];z[b][g]=z[b][g].concat(m)})},_showMimeTypes:function(){window.console&&console.log(z)},add:function(b,e,g){if(!this.apis[e][b]){this.apis[e][b]=r.beget(this.fn);b!=="nativ"&&a.inArray(b,a.fn.jmeEmbed.defaults.apiOrder)=== +-1&&a.fn.jmeEmbed.defaults.apiOrder.push(b)}a.extend(true,this.apis[e][b],g)},fn:{_init:a.noop,canPlayType:function(b){var e=this.apiElem,g;if(e&&e.canPlayType){g=e.canPlayType(b);return g==="no"?"":g}b=r.extractContainerCodecsFormType(b);var m=this;g="probably";if(!b[1])return this.canPlayContainer&&a.inArray(b[0],this.canPlayContainer)!==-1?"maybe":"";a.each(b[1],function(n,q){if(!m.canPlayCodecs||a.inArray(q,m.canPlayCodecs)===-1){g="";return false}});return g},canPlaySrc:function(b){var e=this; +if(typeof b!=="string"){if(b.type)return this.canPlayType(b.type);b=b.src}var g=A(b),m="";a.each(z[this.nodeName],function(n,q){if(a.inArray(g,q)!==-1){m=e.canPlayType(n);return false}});return m},canPlaySrces:function(b){b=b||a.attr(this.element,"srces");a.isArray(b)||(b=[b]);var e=this,g=false,m="";a.each(b,function(n,q){if(g=e.canPlaySrc(q)){m=q;return false}});return m},_setActive:a.noop,_setInactive:a.noop,_trigger:function(b){a(this.element).triggerHandler(b,b)}},apis:{audio:{},video:{}},extractContainerCodecsFormType:function(b){b= +b.split(/\s*;\s*/g);if(b[1]&&b[1].indexOf("codecs")!==-1)b[1]=b[1].replace(/["|']$/,"").replace(/^\s*codecs=('|")/,"").split(/\s*,\s*/g);return b},makeAbsURI:function(){return function(b){if(b&&typeof b==="string")b=a('<a href="'+b+'"></a>')[0].href;return b}}(),beget:function(b){var e=function(){};e.prototype=b;return new e},_create:function(b,e,g,m){var n=a.data(g,"mediaElemSupport")||a.data(g,"mediaElemSupport",{apis:{},nodeName:b});if(!n.apis[e]){n.apis[e]=r.beget(r.apis[b][e]);n.apis[e].element= +g;n.apis[e].nodeName=b;n.apis[e].name=e;n.apis[e].data={};n.apis[e].embedOpts=m}return n},_transferStyles:["backgroundColor","backgroundPosition","backgroundImage","backgroundRepeat","background-attachment"],_setAPIActive:function(b,e){var g=a.data(b,"mediaElemSupport"),m=g.name;if(m===e)return true;var n=g.apis[m].apiElem,q=g.apis[e]&&g.apis[e].apiElem,t=false;if(q&&q.nodeName){if(g.nodeName!=="audio"||a.attr(b,"controls"))e==="nativ"?g.apis[e].visualElem.css({display:""}):g.apis[e].visualElem.css(a.extend({visibility:""}, +g.apis[m].visualElem.getDimensions()));g.apis[e]._setActive(m);t=true;g.apis[e]._trigger({type:"apiActivated",api:e});if(g.apis[m]){g.apis[m]._volumelevelState!==undefined&&a(b).volumelevel(g.apis[m]._volumelevelState);g.apis[m]._muteState!==undefined&&a(b).muted(g.apis[m]._muteState);g.apis[m].visualElem&&a.each(r._transferStyles,function(v,C){g.apis[e].visualElem.css(C,g.apis[m].visualElem.css(C))})}}g.apis[e].isAPIActive=true;if(n&&n.nodeName){if(m==="nativ")n.style.display="none";else g.apis[m].visualElem.css({height:0, +width:0,visibility:"hidden"});g.apis[m]._setInactive(e);g.apis[m].isAPIActive=false;g.apis[e]._trigger({type:"apiDeActivated",api:m})}g.name=e;return t},getSuitedPlayers:function(b,e){var g=a.data(b,"mediaElemSupport");if(g&&g.apis){g=g.apis;var m=a.attr(b,"srces"),n=false,q=function(t,v){if(!(typeof v.isTechAvailable==="boolean"&&!v.isTechAvailable||a.isFunction(v.isTechAvailable)&&!v.isTechAvailable())){if(v=v.canPlaySrces(m))n={src:v.src||v,name:t};return n}};if(!m.length)return"noSource";e?a.each(e, +function(t,v){return!q(v,g[v])}):a.each(g,function(t,v){return!q(t,v)});return n}},_embedApi:function(b,e,g){var m=a.attr(b,"getConfig"),n=a(b),q=b.id,t=n.attr("aria-labelledby");if(!q){i++;q=g.nodeName+"-"+i;b.id=q}g.apis[e.name].visualElem=a('<div class="media-element-box mm-'+g.nodeName+'-box" style="position: relative;" />').insertBefore(b);t&&g.apis[e.name].visualElem.attr({role:"group","aria-labelledby":t});if(g.nodeName==="audio"&&!m.controls)g.apis[e.name].visualElem.css({height:0,width:0}); +else{g.apis[e.name].visualElem.css(n.getDimensions());a.each(r._transferStyles,function(v,C){g.apis[e.name].visualElem.css(C,n.css(C))})}g.apis[e.name]._embed(e.src,g.name+"-"+q,m,function(v){g.apis[e.name].apiElem=v;a(v).addClass(g.nodeName);m.controls||a(v).attr({tabindex:"-1",role:"presentation"});g.apis[e.name]._init();g.apis[e.name]._trigger({type:"apiActivated",api:e.name})})},getPluginVersion:function(b,e){e=e||navigator.plugins&&navigator.plugins[b];b=[-1,0];if(e)if((e=(e.description||"").replace(/,/g, +".").match(/(\d+)/g)||["0"])&&e[0]){b[0]=e[0];if(e[1])b[0]+="."+e[1];b[0]=parseFloat(b[0],10);if(e[2])b[1]=parseInt(e[2],10)}return b},embedObject:function(b,e,g,m,n){b.style.overflow="hidden";b=a("<div />").prependTo(b)[0];var q;if(navigator.plugins&&navigator.plugins.length){q=f.createElement("object");a.each(g,function(t,v){q.setAttribute(t,v)});a.each(m,function(t,v){var C=f.createElement("param");C.setAttribute("name",t);C.setAttribute("value",v);q.appendChild(C)});q.setAttribute("id",e);q.setAttribute("name", +e);if(m.wmode==="transparent"){q.style.minHeight="1px";q.style.minWidth="1px"}b.parentNode.replaceChild(q,b)}else if(window.ActiveXObject){q='<object style="width: 100%; height: 100%; width="100%" height="100%"';a.each(a.extend({},g,n),function(t,v){q+=" "+t+'="'+v+'"'});q+=' name="'+e+'"';q+=' id="'+e+'"';q+=">";a.each(m,function(t,v){q+=' <param name="'+t+'" value="'+v+'" />'});q+="</object>";b.outerHTML=q;q=f.getElementById(e)}if(q){q.setAttribute("width","100%");q.setAttribute("height","100%")}a(window).unload(function(){jQuery.cleanData([q]); +q=null});setTimeout(function(){if(q&&q.style){q.style.width="100%";q.style.height="100%"}},0);return q}});r.add("nativ","video",{});r.add("nativ","audio",{});var B=function(){var b=a(this).hide().children(":not(source, track)").clone().insertAfter(this);a(this).one("mediareset",function(){a(this).show();b.remove()})};a.fn.jmeEmbed=function(b){b=a.extend(true,{},a.fn.jmeEmbed.defaults,b);b.showFallback&&a.support.mediaElements&&this.bind("totalerror",B);return this.each(function(){var e=this.nodeName.toLowerCase(), +g=false,m=this;if(!(e!=="video"&&e!=="audio"||a.support.flash9&&a.nodeName(m.parentNode,"object"))){a("object, embed",this).each(function(){a("> *:not(param, embed, object)",this).appendTo(m)}).remove();a(this).trigger("jmeBeforeEmbed",{options:b,nodeName:e});b.removeControls&&a.attr(this,"controls",false);var n=r._create(e,"nativ",this,b);n.name="nativ";n.apis.nativ.apiElem=this;n.apis.nativ.visualElem=a(this);n.apis.nativ.isAPIActive=true;a.each(r.apis[e],function(q){q!=="nativ"&&r._create(e,q, +m,b)});a(this).bind("mediaerror",function(){n.name==="nativ"&&y(this,b)});if(a.support.flash9&&b.activateFlash&&b.flashPlayer){g=r.getSuitedPlayers(m,[b.flashPlayer]);if(g=="noSource")g={name:b.flashPlayer};n.apis.nativ.isAPIReady=true;if(g.name==b.flashPlayer&&!r._setAPIActive(this,b.flashPlayer))r._embedApi(this,g,n,e);else g=false}if(!g)if(b.debug||!a.support.mediaElements){y(this,b);n.apis.nativ.isAPIReady=true}else n.apis.nativ._init();a.attr(this,"preload",a.attr(this,"preload"),true);a(this).trigger("jmeEmbed", +{options:b,nodeName:e,data:n})}})};a.fn.jmeEmbed.defaults={debug:false,removeControls:false,showFallback:false,apiOrder:[],activateFlash:false,flashPlayer:""};a.fn.mediaElementEmbed=a.fn.jmeEmbed;if(a.cleanData&&window.ActiveXObject){var D=a.cleanData;a.cleanData=function(b){D(b);for(var e=0,g=b.length;e<g;e++)if(b[e].nodeName==="OBJECT")try{for(var m in b[e])if(typeof b[e][m]==="function")b[e][m]=null}catch(n){}}}})(jQuery); +(function(a){var w=document.createElement("video"),x=a.multimediaSupport,y={apiActivated:1,apiDeActivated:1,mediareset:1,native_mediareset:1,totalerror:1,jmeflashRefresh:1,flashblocker:1},r={native_mediareset:1,apiDeActivated:1,native_mediareset:1,apiActivated:1,timechange:1,progresschange:1,mmAPIReady:1,jmeflashRefresh:1},i={};if("enterFullScreen"in w&&w.supportsFullscreen){a.support.videoFullscreen=true;i.enter="enterFullScreen";i.exit="exitFullScreen"}else a.each(["webkit","moz","o","ms"],function(d, +j){if(j+"EnterFullScreen"in w&&j+"SupportsFullscreen"in w){a.support.videoFullscreen=true;i.enter=j+"EnterFullScreen";i.exit=j+"ExitFullScreen";return false}});w=null;a.extend(x,{capturingEvents:function(d){if(document.addEventListener){if(typeof d=="string")d=[d];a.each(d,function(j,l){var p=function(o){o=a.event.fix(o);return a.event.handle.call(this,o)};a.event.special[l]=a.event.special[l]||{};a.extend(a.event.special[l],{setup:function(){this.addEventListener(l,p,true)},teardown:function(){this.removeEventListener(l, +p,true)}})})}},formatTime:function(d){return a.map([parseInt(d/60,10),parseInt(d%60,10)],function(j){return isNaN(j)?"--":j<10?"0"+j:j}).join(":")}});x.capturingEvents("play pause playing waiting ended".split(" "));a.event.special.loadedmeta={add:function(d){var j=a(this).getJMEAPI();if(j&&j.loadedmeta){j=a.extend({},j.loadedmeta);d.handler.call(this,j,j)}}};a.extend(x.fn,{_trigger:function(d){var j=d.type?d:{type:d},l=j.type;switch(l){case "mmAPIReady":if(this.isAPIReady)return;this.isAPIReady=true; +break;case "loadedmeta":this.loadedmeta=j;break;case "totalerror":this.totalerror=true;break;case "mute":this._muteState=d.isMuted;break;case "volumelevelchange":this._volumelevelState=d.volumelevel;break;case "mediareset":this._bufferLoaded=this.totalerror=this.loadedmeta=false;break}if(!(!this.isAPIActive||this.totalerror&&!y[l]||this._stoppedEvents[l])){!this.isAPIReady&&!y[l]&&this._trigger("mmAPIReady");if(d.type==="progresschange")this._bufferLoaded=d.relLoaded;d.target=this.element;d=a.Event(d); +d.preventDefault();j.mediaAPI=this.name;if(a.fn.on)a.event.trigger(d,j,this.element,!!r[l]);else{r[l]&&d.stopPropagation();a.event.trigger(d,j,this.element)}}},_stoppedEvents:{},_stopEvent:function(d,j){this._stoppedEvents[d]=true;if(j){var l=this;setTimeout(function(){l._allowEvent(d)},9)}},_allowEvent:function(d){this._stoppedEvents[d]=false},supportsFullScreen:function(){return this._videoFullscreen||false},enterFullscreen:a.noop,exitFullscreen:a.noop,isAPIReady:false,isJMEReady:function(){return this.isAPIReady}, +relCurrentTime:function(d){var j=this.getDuration()||Number.MIN_VALUE;d&&isFinite(d)&&this.currentTime(j*d/100);return this.currentTime()/j*100},getMediaAPI:function(){return this.name},togglePlay:function(){this[this.isPlaying()?"pause":"play"]()},toggleMuted:function(){this.muted(!this.muted())},getJMEVisual:function(){return this.visualElem},jmeReady:function(d,j){var l={type:"mmAPIReady"};if(this.isJMEReady()&&(this.name!=="nativ"||a.support.mediaElements))d.call(this.element,l,l);else{j=j||"jmediaelement"; +var p=this,o=function(){a(p.element).unbind("mmAPIReady."+j,o).unbind("jmeflashRefresh."+j,o);d.call(p.element,l,l)};a(this.element).bind("mmAPIReady."+j,o).bind("jmeflashRefresh."+j,o)}},unAPIReady:function(d){a(this.element).unbind("mmAPIReady."+d)},_adjustPluginLoop:function(d){var j=a.attr(this.element,"loop"),l=this;j!==d&&setTimeout(function(){l[j?"play":"pause"]()},0)},_format:x.formatTime,getFormattedDuration:function(){return this._format(this.getDuration())},getFormattedTime:function(){return this._format(this.currentTime())}, +loadSrc:function(d,j,l,p){if(d){a.attr(this.element,"srces",d);d=a.isArray(d)?d:[d]}else d=a.attr(this.element,"srces");if(j!==undefined)j?a.attr(this.element,"poster",j):a(this.element).removeAttr("poster");else j=a.attr(this.element,"poster");var o=a.data(this.element,"mediaElemSupport");typeof l=="string"&&o.mediaName&&o.mediaName.text(l);o.noSource=!!d.length;this._isResetting=true;d=this.canPlaySrces(d);this._trigger("mediareset");if(d){d=d.src||d;this._mmload(d,j,p)}else{x._setAPIActive(this.element, +"nativ");this._trigger("native_mediareset");a(this.element).data("mediaElemSupport").apis.nativ._mmload()}this._isResetting=false},isPlaying:function(){return this._isResetting?false:this._isPlaying()},_makenum:function(d){var j=false;if(d==d*1)j=parseFloat(d,10);return j}});var f=function(d){var j=function(){for(var s=d.element.currentTime||0,u=d.element.buffered,A=u.length,z={},B=0;B<A;B++){z.start=u.start(B);z.end=u.end(B);if(z.start<=s&&z.end>=s)break}return z},l=function(s){var u={type:"progresschange"}, +A;if(this.buffered&&this.buffered.length){if(s=this.duration){A=j();u.relStart=A.start/s*100;u.relLoaded=A.end/s*100}d._trigger(u)}else if(s.originalEvent&&"lengthComputable"in s.originalEvent&&s.originalEvent.loaded){if(s.originalEvent.lengthComputable&&s.originalEvent.total){u.relStart=0;u.relLoaded=s.originalEvent.loaded/s.originalEvent.total*100}d._trigger(u)}if(!u.relLoaded&&this.readyState===4){u.relStart=0;u.relLoaded=100;d._trigger(u)}return u.relLoaded},p=function(){if(l.call(d.element,{type:"ipadprogress"})>= +100||d.element.readyState===1)clearInterval(o)},o;a(d.element).bind("progress load",l);"buffered"in d.element&&a(d.element).bind("play waiting loadstart",function(){clearInterval(o);if(d.isAPIActive){o=setInterval(p,333);p()}})},c={isTechAvailable:a.support.mediaElements,_init:function(){var d=this,j=this.apiElem.muted,l=false,p=function(o){clearInterval(l);if(!d.element.error&&d.element.mozLoadFrom&&d.isAPIActive&&!d.element.readyState&&d.element.networkState===2&&a.support.flash9)if(o===true)d.element.load(); +else l=setTimeout(function(){p(true)},o==="initial"?2E4:9E3)};f(this);a(this.element).bind({volumechange:function(){if(j!==d.apiElem.muted){j=d.apiElem.muted;d._trigger.call(d,{type:"mute",isMuted:j})}else d._trigger.call(d,{type:"volumelevelchange",volumelevel:d.apiElem.volume*100})},ended:function(){if(d.isAPIActive&&this.ended&&!this.paused&&!a.attr(this,"loop")){d._stopEvent("pause",true);this.pause()}},timeupdate:function(){var o={type:"timechange",time:this.currentTime};if(this.duration){o.duration= +this.duration;o.timeProgress=o.time/o.duration*100}d._trigger(o)},progress:function(){!d.loadedmeta&&this.duration&&d._trigger({type:"loadedmeta",duration:this.duration})},loadedmetadata:function(){d._trigger({type:"loadedmeta",duration:this.duration})}}).bind("play playing",function(o){if(!d.isAPIActive&&o.originalEvent&&!d.element.paused&&!d.element.ended)try{d.element.pause()}catch(s){}}).bind("mediareset",p).bind("ended play pause waiting playing",function(o){if(!d.isAPIActive&&o.originalEvent&& +(o.originalEvent.mediaAPI==="nativ"||!o.originalEvent.mediaAPI)||d._stoppedEvents[o.type])o.stopImmediatePropagation()});p("initial");a.support.mediaLoop||a(this.element).bind("ended",function(){if(d.isAPIActive&&a.attr(this,"loop")){var o=this;setTimeout(function(){a.attr(o,"loop")&&o.play()},0)}});if(!this.element.error)if(this.element.readyState>0)this._trigger({type:"loadedmeta",duration:this.element.duration});else if(this.element.networkState!==2||"webkitPreservesPitch"in this.element)this._trigger("mmAPIReady")}, +play:function(){this.element.play()},pause:function(){this._allowEvent("pause");this.element.pause()},muted:function(d){if(typeof d!=="boolean")return this.element.muted;this.element.muted=d},volume:function(d){if(!isFinite(d))return this.element.volume*100;this.element.volume=d/100},currentTime:function(d){if(!isFinite(d))return this.element.currentTime;try{this.element.currentTime=d}catch(j){}},_mmload:function(){this.element.load?this.element.load():a(this.element).triggerHandler("error")},_isPlaying:function(){return!this.element.paused&& +this.element.readyState>1&&!this.element.error&&!this.element.ended},getDuration:function(){return this.element.duration},getCurrentSrc:function(){return this.element.currentSrc}};x.add("nativ","video",a.extend({_videoFullscreen:a.support.videoFullscreen,enterFullScreen:function(){if(!this._videoFullscreen)return false;try{this.element[i.enter]()}catch(d){return false}return true},exitFullScreen:function(){if(!this._videoFullscreen)return false;try{this.element[i.exit]()}catch(d){return false}return true}}, +c));x.add("nativ","audio",c);a.fn.getJMEAPI=function(d){if(this[0]){var j=a.data(this[0],"mediaElemSupport");return d||!j||!j.name||!j.apis?j:j.apis[j.name]}};var h={jmeReady:1,getJMEVisual:1,jmeReady:1,isJMEReady:1,getMediaAPI:1,supportsFullScreen:1};x.registerAPI=function(d){if(typeof d==="string")d=[d];a.each(d,function(j,l){if((j=x.apis.video.nativ[l])&&!a.fn[l]&&a.isFunction(j)&&l.indexOf("_")!==0)a.fn[l]=function(){var p=arguments,o;this.each(function(){var s=a(this).getJMEAPI();if(s)if(h[l]|| +l=="loadSrc"&&a.data(this,"mediaElemSupport").noSource||s.isJMEReady()&&!s.totalerror&&(s.name!=="nativ"||a.support.mediaElements)){o=s[l].apply(s,p);return o===undefined}else{s.unAPIReady(l+"queue");s.jmeReady.call(s,function(){s[l].apply(s,p)},l+"queue")}});return o===undefined?this:o}})};var k=[];a.each(x.apis.video.nativ,function(d){k.push(d)});x.registerAPI(k);a.fn.onAPIReady=a.fn.jmeReady;a.fn.getMMAPI=a.fn.getJMEAPI;x.fn._extend=function(d,j){var l=[];a.each(d,function(p,o){x.fn[p]=o;l.push(p); +if(j)h[p]=true});x.registerAPI(l)}})(jQuery); +(function(a){function w(i,f){i=a(i);var c={},h=i.attr("data-controls");c.mm=h?a("#"+h):a("video, audio",i).filter(":first");c.api=c.mm.getJMEAPI(true)||c.mm.jmeEmbed(f.embed).getJMEAPI(true);if(!c.api)return c;if(i.is(f.controlSel))c.controls=i;if(!c.controls||c.controls.hasClass(f.classPrefix+"media-controls")){if(i[0]&&!c.api.controlWrapper&&a.contains(i[0],c.mm[0]))c.api.controlWrapper=i;c.controls=c.controls?a(f.controlSel,i).add(c.controls):a(f.controlSel,i)}return c}function x(i,f,c,h){if(!i.data("jmePlayer")){r.addStateClasses(i, +f,h.classPrefix);i.data("jmePlayer",{mediaelement:f,api:c});a.fn.videoOverlay&&i.videoOverlay({video:f,startCSS:{width:"auto",height:"auto",zIndex:99998,padding:0,margin:0,borderWidth:0},position:{bottom:0,left:0,right:0,top:0,width:0,height:0}});a.ui&&a.ui.keyCode&&i.bind("keydown",function(k){if(!k.jmeHandledEvent){k.jmeHandledEvent=true;if({40:1,37:1,39:1,38:1}[k.keyCode]){if(!a(k.target).is(".ui-slider-handle")){var d=5;switch(k.keyCode){case a.ui.keyCode.UP:if(k.ctrlKey)d+=5;f.volume(Math.min(100, +f.volume()+d));break;case a.ui.keyCode.DOWN:if(k.ctrlKey)d+=5;f.volume(Math.max(0,f.volume()-d));break;case a.ui.keyCode.LEFT:if(k.ctrlKey)d+=55;f.currentTime(Math.max(0,f.currentTime()-d));break;case a.ui.keyCode.RIGHT:if(k.ctrlKey)d+=55;f.currentTime(Math.min(f.getDuration(),f.currentTime()+d));break}k.preventDefault()}}else if(k.keyCode===a.ui.keyCode.SPACE&&(!a.nodeName(k.target,"button")&&a.attr(k.target,"role")!=="button"||i.hasClass("wraps-fullscreen"))){f.togglePlay();k.preventDefault()}}})}} +a.event.special.ariaclick||function(){var i=false,f=function(c){if(!i&&(!c.keyCode||c.keyCode===13||c.keyCode===32&&a.attr(c.target,"role")==="button")){i=true;setTimeout(function(){i=false},1);return a.event.special.ariaclick.handler.apply(this,arguments)}else if(i&&c.type=="click"){c.preventDefault();return false}};a.event.special.ariaclick={setup:function(){a(this).bind("click keydown",f);return true},teardown:function(){a(this).unbind("click keydown",f);return true},handler:function(c){c.type= +"ariaclick";return a.event.handle.apply(this,arguments)}}}();var y={},r=a.multimediaSupport;a.fn.jmeControl=function(i){function f(){var c=w(this,i);if(c.api){c.api.controls=c.api.controls||[];if(c.api){c.controls.each(function(){var h=a(this);if(a.inArray(this,c.api.controls)===-1){c.api.controls.push(this);a.each(y,function(k,d){if(h.hasClass(i.classPrefix+k)){k=a.extend(true,{},i);k[d.optionsName]=r.extendWithData(h[0],k[d.optionsName],i[d.optionsName]);d(h,c.mm,c.api,k);return false}})}});c.api.controlWrapper&& +c.api.controlWrapper[0]&&x(c.api.controlWrapper,c.mm,c.api,i)}}}i=a.extend(true,{},a.fn.jmeControl.defaults,i);i.controlSel=[];a.each(y,function(c){c!=="media-controls"&&i.controlSel.push("."+i.classPrefix+c)});i.controlSel.push("."+i.classPrefix+"media-controls");i.controlSel=i.controlSel.join(", ");return this.each(f)};a.fn.jmeControl.defaults={embed:{removeControls:true},classPrefix:"",addThemeRoller:true};a.support.waiaria=!a.browser.msie||a.browser.version>7;a.fn.jmeControl.getBtn=function(){var i= +/\s*\/\s*|\s*\|\s*|\s*\,\s*/g;return function(f){var c={icon:a(".ui-icon",f),text:a(".button-text",f),title:f};if(!f.is(":button")&&!f.attr("role")){a.support.waiaria&&f.removeAttr("href");f.attr({role:"button",tabindex:0})}if(!c.icon[0]&&!c.text[0]&&!a("*",f)[0]){c.icon=f;c.text=f}c.names=c.text.text().split(i);c.titleText=(f.attr("title")||"").split(i);if(c.names.length!==2)c.text=a([]);if(c.titleText.length!==2)c.title=a([]);return c}}();r.camelCase=function(){var i=/-([a-z])/ig,f=function(c,h){return h.toUpperCase()}; +return function(c){return c.replace(i,f)}}();a.fn.jmeControl.addControl=function(i,f,c,h){c=c||{};h=h||r.camelCase(i);a.fn.jmeControl.defaults[h]=c;f.optionsName=h;y[i]=f};a.fn.jmeControl.addControls=function(i){a.each(i,function(f,c){a.fn.jmeControl.addControl(c.name,c.fn,c.options,c.optionName)})};a.fn.registerMMControl=a.fn.jmeControl;a.each({"play-pause":{stateMethod:"isPlaying",actionMethod:"togglePlay",evts:"play playing pause ended loadedmeta mediareset",trueClass:"ui-icon-pause",falseClass:"ui-icon-play"}, +"mute-unmute":{stateMethod:"muted",actionMethod:"toggleMuted",evts:"mute loadedmeta",trueClass:"ui-icon-volume-off",falseClass:"ui-icon-volume-on"}},function(i,f){a.fn.jmeControl.addControl(i,function(c,h,k,d){function j(p){if(i=="play-pause"&&p&&p.type=="playing"?true:h[f.stateMethod]()){l.text.text(l.names[1]);l.title.attr("title",l.titleText[1]);l.icon.addClass(f.trueClass).removeClass(f.falseClass)}else{l.text.text(l.names[0]);l.title.attr("title",l.titleText[0]);l.icon.addClass(f.falseClass).removeClass(f.trueClass)}} +var l=a.fn.jmeControl.getBtn(c);d.addThemeRoller&&c.addClass("ui-state-default ui-corner-all");j();h.bind(f.evts,j).jmeReady(j);c.bind("ariaclick",function(p){h[f.actionMethod]();p.preventDefault()})})});a.each(["current-time","remaining-time"],function(i,f){a.fn.jmeControl.addControl(f,function(c,h,k,d){var j=f=="remaining-time"?function(p,o){c.html(k.apis[k.name]._format(l-o.time))}:function(p,o){c.html(k.apis[k.name]._format(o.time))},l=Number.MIN_VALUE;d.addThemeRoller&&c.addClass("ui-widget-content ui-corner-all"); +c.html("00:00").attr("role","timer");f=="remaining-time"&&h.bind("loadedmeta",function(p,o){l=o.duration||Number.MIN_VALUE;j(false,{time:0})});h.bind("timechange",j).bind("mediareset",function(){c.html("00:00")})})});a.fn.jmeControl.addControls([{name:"duration",fn:function(i,f,c,h){h.addThemeRoller&&i.addClass("ui-widget-content ui-corner-all");i.html("00:00");f.bind("loadedmeta",function(k,d){i.html(c.apis[c.name]._format(d.duration))}).bind("mediareset",function(){i.html("00:00")})}},{name:"media-controls", +options:{dynamicTimeslider:false,timeSliderAdjust:0,excludeSel:false,fullWindowOverlay:false},fn:function(i,f,c,h){function k(){var l=i.width()+h.mediaControls.timeSliderAdjust,p=d.outerWidth(true)-d.innerWidth();a("> *",i).each(function(){if(d[0]!==this&&this.offsetWidth&&a.curCSS(this,"position")!=="absolute"&&(!h.excludeSel||!a(this).is(h.excludeSel)))p+=a(this).outerWidth(true)});d.css("width",l-p)}h.addThemeRoller&&i.addClass("ui-widget ui-widget-header ui-corner-all");i.attr("role","toolbar"); +if(h.mediaControls.dynamicTimeslider){var d=a("."+h.classPrefix+"timeline-slider",i),j=setTimeout(k,0);f.jmeReady(function(){clearInterval(j);setTimeout(k,0)});a(window).bind("resize",k);f.bind("resize emchange",k)}h.mediaControls.fullWindowOverlay&&a.fn.videoOverlay&&i.videoOverlay({fullscreenClass:h.classPrefix+"controls-fullscreenvideo",video:f,startCSS:{width:"auto"},position:{bottom:0,left:0,right:0}})}},{name:"media-label",fn:function(){var i=0;return function(f,c,h,k){if(!(!h.controlWrapper|| +h.controlWrapper.attr("role"))){c=f.attr("id");var d=a("."+k.classPrefix+"media-name",f);if(!c){i++;c=k.classPrefix+"media-label-"+i;f.attr("id",c)}h.mediaName=d[0]?d:f;h.controlWrapper.attr({role:"group","aria-labelledby":c})}}}()},{name:"fallback",fn:function(i,f,c,h){if(!(h.embed.showFallback||!a.support.mediaElements)){var k=i.clone(true);f.bind("totalerror",function(){f.after(k).hide();a(this).one("mediareset",function(){f.show();k.detach()})})}}},{name:"media-state",options:{click:"togglePlay"}, +fn:function(i,f,c,h){r.addStateClasses(i,f,h.classPrefix);h.mediaState.click&&f[h.mediaState.click]&&i.click(function(){f[h.mediaState.click]()})}}]);r.addStateClasses=function(i,f,c){c=c||"";var h=c+"playing "+c+"totalerror "+c+"waiting "+c+"idle "+c+"flashblocker",k=function(){i.removeClass(h)};f.jmeReady(function(){var d=f.isPlaying();if(typeof d==="boolean")i.addClass(c+d?"idle":"playing")});i.addClass(c+f.getMediaAPI());f.bind({apiActivated:function(d,j){i.addClass(c+j.api)},apiDeActivated:function(d, +j){i.removeClass(c+j.api)}}).bind("playing totalerror waiting flashblocker",function(d){k();i.addClass(c+d.type)}).bind("play",function(){i.removeClass(c+"idle")}).bind("pause ended mediareset",function(){k();i.addClass(c+"idle")}).bind("canplay",function(){i.removeClass(c+"waiting")})};(function(){var i=a.fn.a11ySlider?"a11ySlider":"slider",f={range:false,animate:false};a(function(){i=a.fn.a11ySlider?"a11ySlider":"slider"});a.fn.jmeControl.addControls([{name:"timeline-slider",optionName:"timeSlider", +options:f,fn:function(c,h,k,d){var j=false,l=function(){if(k.apis[k.name].loadedmeta&&k.apis[k.name].loadedmeta.duration){c[i]("option","step",100/Math.max(100,c[0].offsetWidth));c[i]("option","disabled",false)}else c[i]("option","disabled",true)};c[i](d.timeSlider)[i]("option","disabled",true);a(window).bind("resize",l);a(document).bind("emchange",l);h.bind("loadedmeta resize",l).bind("timechange",function(p,o){parseInt(o.timeProgress,10);o.timeProgress!==undefined&&!j&&c[i]("value",o.timeProgress)}).bind("mediareset", +function(){c[i]("value",0);l()}).bind("ended",function(){c[i]("value",100)});c.bind("slidestart",function(p){if(p.originalEvent)j=true}).bind("slidestop",function(){j=false}).bind("slide",function(p,o){p.originalEvent&&k.apis[k.name].isAPIReady&&k.apis[k.name].relCurrentTime(o.value)})}},{name:"volume-slider",options:a.extend({mutestate:false},f),fn:function(c,h,k,d){function j(p,o){l||(p.type=="volumelevelchange"?c[i]("value",o.volumelevel):c[i]("value",h.muted()?0:h.volume()))}var l=false;c[i](d.volumeSlider)[i]("option", +"disabled",true);c.bind("slidestart",function(p){if(p.originalEvent)l=true}).bind("slidestop",function(){l=false}).bind("slide",function(p,o){if(p.originalEvent&&k.apis[k.name].isAPIReady){k.apis[k.name].volume(o.value);d.volumeSlider.mutestate&&k.apis[k.name].muted()&&k.apis[k.name].muted(false)}});h.bind("volumelevelchange loadedmeta",j).jmeReady(function(){c[i]("option","disabled",false);j({type:"ready"})});d.volumeSlider.mutestate&&h.bind("mute",j)}},{name:"progressbar",fn:function(c,h,k,d){function j(p, +o){"relLoaded"in o?c.progressbar("option","disabled",false).progressbar("value",o.relLoaded):c.progressbar("option","disabled",true)}function l(){c.progressbar("option","disabled",true).progressbar("value",0)}c.progressbar(d.progressbar).progressbar("option","disabled",true);h.bind("progresschange",j).bind("mediareset",l)}}])})()})(jQuery); +(function(a){var w={type:"application/x-shockwave-flash"},x={classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},y=a.multimediaSupport;a.extend(a.fn.jmeEmbed.defaults,{flashPlayer:"jwPlayer",jwPlayer:{path:y.jsPath+"player.swf",hideIcons:"auto",vars:{},attrs:{},plugins:{},params:{allowscriptaccess:"always",allowfullscreen:"true"}}});a(function(){var h=(a("script.jwPlayer")[0]||{}).src;if(h)a.fn.jmeEmbed.defaults.jwPlayer.path=h});var r={A:/&/g,a:/&/g,e:/\=/g,q:/\?/g},i={audio:"sound",video:"video"}, +f=function(h){return h.replace?h.replace(r.A,"%26").replace(r.a,"%26").replace(r.e,"%3D").replace(r.q,"%3F"):h};(function(){a.support.flash9=false;a.support.flashVersion=0;var h=y.getPluginVersion("Shockwave Flash"),k=function(j){a.support.flash9=false;try{if(j&&typeof j.GetVariable!=="undefined"){var l=j.GetVariable("$version");j=y.getPluginVersion("",{description:l});a.support.flashVersion=j[0];a.support.flash9=!!(j[0]>9||j[0]===9&&j[1]>=115)}}catch(p){}};if(h&&h[0])a.support.flashVersion=h[0]; +if(h[0]>9||h[0]===9&&h[1]>=115){a.support.flash9=true;a(function(){h=a("<object />",w).appendTo("body");k(h[0]);h.remove()})}else if(window.ActiveXObject)try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");k(h);h=null}catch(d){}})();var c={isTechAvailable:function(){return a.support.flash9},_extendJWLoad:function(h,k,d){if(h){d=d||this.element;var j=this.embedOpts.jwPlayer.changeVars;y.extendWithData(d,k,["type","provider","stretching","bufferlength","streamer"]);k.file=(d.getAttribute("data-jwprefixsrc")|| +"")+k.file;var l=y.getExt(h),p=l=="m4r"?"video":this.nodeName;if(l=="m4r"||!this.canPlaySrc(h)){if(!k.provider)k.provider=i[p];if(!k.type)k.type=i[p]}j&&j(h,k,d,this);return k}},_embed:function(h,k,d,j){var l=this.embedOpts.jwPlayer,p=a.extend({},l.vars,{file:h,id:k}),o=a.extend({name:k},l.attrs,w,!window.ActiveXObject?{data:l.path}:{}),s=a.extend({movie:l.path},l.params),u=[],A=this;this._extendJWLoad(h,p);if(d.poster)p.image=d.poster;p.autostart=""+d.autoplay;p.repeat=d.loop?"single":"false";p.controlbar= +d.controls?"bottom":"none";if(!d.controls&&this.nodeName!=="audio"&&s.wmode===undefined)s.wmode="transparent";if(!d.controls&&l.hideIcons&&s.wmode==="transparent"||l.hideIcons===true){p.icons="false";p.showicons="false"}if(s.wmode==="transparent"&&!p.screencolor&&!o.bgcolor){p.screencolor="ffffffff";o.bgcolor="#000000"}s.flashvars=[];a.each(p,function(z,B){s.flashvars.push(f(z)+"="+f(B))});a.each(l.plugins,function(z,B){u.push(B)});u.length&&s.flashvars.push("plugins="+u.join(","));s.flashvars=s.flashvars.join("&"); +j(y.embedObject(this.visualElem[0],k,o,s,x,"Shockwave Flash"));setTimeout(function(){var z=a("object",A.visualElem)[0];if(!z||z.style.display==="none"&&a("> *",A.visualElem).length>1){a("div[bgactive]",A.visualElem).css({width:"100%",height:"100%"});A._trigger("flashblocker")}},9)},canPlaySrc:function(h){var k=y.fn.canPlaySrc.apply(this,arguments),d=-1;d=h.src||h;if(!k&&typeof d==="string"){d=d.indexOf("youtube.com/");if(d<15&&d>6)k="maybe"}return k},canPlayCodecs:["avc1.42E01E","mp4a.40.2","avc1.58A01E", +"avc1.4D401E","avc1.64001E","VP6","mp3","AAC"],canPlayContainer:["video/3gpp","video/x-msvideo","video/quicktime","video/x-m4v","video/mp4","video/m4p","video/x-flv","video/flv","audio/mpeg","audio/aac","audio/mp4","audio/x-m4a","audio/m4a","audio/mp3","audio/x-fla","audio/fla","youtube/flv","jwplayer/jwplayer"]};y.add("jwPlayer","video",c);y.add("jwPlayer","audio",c)})(jQuery); +(function(a){function w(f){if(f){f=f.replace(r,"");return a.data(x.getElementById(f),"mediaElemSupport").apis.jwPlayer}}var x=document,y=a.multimediaSupport,r=/^jwPlayer-/;window.jwEvents={View:{PLAY:function(f){if(f=f.state&&w(f.id)){f._trigger("play");f._$isPlaystate=true}}},Model:{BUFFER:function(f){var c=w(f.id);if(c){if(c._$timeProgress&&f.percentage+c._$startBuffer+1<c._$timeProgress)c._$startBuffer=c._$timeProgress;f={type:"progresschange",relLoaded:f.percentage+c._$startBuffer,relStart:0}; +c._$buffered=f.relLoaded;c._trigger(f)}},STATE:function(f){if(privJwEvents.Model.STATE(f)==="playing")if(f=w(f.id)){f._trigger("playing");f._$isPlaystate=true}},META:function(f){if(f.type==="metadata"){var c=w(f.id);c&&c._trigger({type:"loadedmeta",duration:f.duration})}},TIME:function(f){var c=w(f.id),h={type:"timechange",time:f.position};if(c){c.loadedmeta||c._trigger({type:"loadedmeta",duration:f.duration});c._$currentPos=f.position;if(f.duration){h.duration=f.duration;h.timeProgress=f.position/ +f.duration*100;c._$timeProgress=h.timeProgress}c._trigger(h)}},STATE:function(f){if(f.newstate==="IDLE")return false;var c=w(f.id),h;if(!c)return false;switch(f.newstate){case "PLAYING":h="playing";break;case "PAUSED":c._$isPlaystate=false;h="pause";break;case "COMPLETED":c._$isPlaystate=false;h="ended";c._adjustPluginLoop(c.apiElem.getConfig().repeat=="single");break;case "BUFFERING":h="waiting";break}h&&c._trigger(h);return h}},Controller:{VOLUME:function(f){var c=w(f.id);!c||c._$lastMuteState!== +c.muted()||c._trigger({type:"volumelevelchange",volumelevel:f.percentage})},MUTE:function(f){var c=w(f.id);if(c){c._$lastMuteState=f.state;c._trigger({type:"mute",isMuted:f.state})}}}};window.playerReady=function(f){var c=w(f.id);if(c){if(c.isAPIReady){if(c.apiElem.sendEvent)setTimeout(function(){c._lastLoad&&c._mmload(c._lastLoad.file,c._lastLoad.image);if(c._$isPlaystate&&!(c.apiElem.getConfig()||{}).autostart)c.play()},8);else{c._$reInit();return}setTimeout(function(){c._trigger("jmeflashRefresh")}, +8)}else if(!c.apiElem.sendEvent){c._$reInit();return}a.each(jwEvents,function(h,k){a.each(k,function(d){c.apiElem["add"+h+"Listener"](d,"jwEvents."+h+"."+d)})});setTimeout(function(){c._$lastMuteState=c.muted();var h=a.attr(c.element,"getConfig");c._trigger("mmAPIReady");if(!h.autoplay&&!c._$isPlaystate&&(c.apiElem.getConfig()||{}).state==="IDLE")if(c.nodeName==="audio"&&h.preload==="auto"){c.apiElem.sendEvent("PLAY","true");c.apiElem.sendEvent("PLAY","false")}else if(c.nodeName==="video"&&h.preload!== +"none"&&!h.poster){c.apiElem.sendEvent("PLAY","true");c.apiElem.sendEvent("PLAY","false");c.currentTime(0)}},9)}};var i={_init:function(){this._$resetStates()},_$resetStates:function(){this._$currentPos=this._$timeProgress=this._$startBuffer=this._$buffered=0},_$reInitCount:0,_$reInitTimer:false,_$reInit:function(){var f=this;if(this._$reInitCount<5){this.visualElem[0].style.overflow="visible";setTimeout(function(){f.visualElem[0].style.overflow="hidden"},0)}this._$reInitCount++;this._$resetStates(); +if(!this._$reInitTimer){this._$reInitTimer=true;setTimeout(function(){f._$reInitCount=0;f._$reInitTimer=false},2E4)}},play:function(){this.apiElem.sendEvent("PLAY","true");this._$isPlaystate=true;this._trigger("play")},pause:function(){this.apiElem.sendEvent("PLAY","false")},_isPlaying:function(){var f=this.apiElem.getConfig();return f?f.state==="PLAYING":undefined},_mmload:function(f,c,h){var k=this._isPlaying();this._lastLoad={file:f};if(c)this._lastLoad.image=c;this._$resetStates();this._extendJWLoad(f, +this._lastLoad);typeof h=="object"&&a.extend(this._lastLoad,h);if(this.apiElem.sendEvent){this.apiElem.sendEvent("LOAD",this._lastLoad);this.isAPIActive&&(a.attr(this.element,"autoplay")||k)?this.apiElem.sendEvent("PLAY","true"):this.apiElem.sendEvent("PLAY","false")}},muted:function(f){if(typeof f!=="boolean")return(this.apiElem.getConfig()||{}).mute;this.apiElem.sendEvent("mute",""+f)},currentTime:function(f){if(!isFinite(f))return this._$currentPos||0;this._$currentPos=f;var c=this._isPlaying(); +this.apiElem.sendEvent("SEEK",f);c||this.pause();this._trigger({type:"timechange",time:f})},getDuration:function(){var f=this.apiElem.getPlaylist()[0].duration||0;return f<0?0:f},volume:function(f){if(!isFinite(f))return parseInt(this.apiElem.getConfig().volume,10);var c=this.muted();this.apiElem.sendEvent("VOLUME",""+f);c&&this.apiElem.sendEvent("mute","true")},getCurrentSrc:function(){return(this.apiElem.getConfig()||{}).file||""}};a.extend(i,{isJMEReady:function(){var f=false;if(this.isAPIReady&& +this.apiElem.sendEvent&&this.apiElem.getConfig){a.browser.mozilla&&this.apiElem.getConfig();f=true}return f}});y.add("jwPlayer","video",a.extend({},i,{exitFullScreen:function(){if(this.apiElem.jmeExitFullScreen)try{this.apiElem.jmeExitFullScreen();return true}catch(f){}return false}}));y.add("jwPlayer","audio",i)})(jQuery); diff --git a/chimere/static/jme/packages/player-swf-readme.html b/chimere/static/jme/packages/player-swf-readme.html new file mode 100644 index 0000000..3ce3606 --- /dev/null +++ b/chimere/static/jme/packages/player-swf-readme.html @@ -0,0 +1,58 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + + <title>JW Player for Flash</title> + + <style type="text/css"> + body { background-color: #fff; padding: 0 20px; color:#000; font: 13px/18px Arial, sans-serif; } + a { color: #360; } + h3 { padding-top: 20px; } + ol { margin:5px 0 15px 16px; padding:0; list-style-type:square; } + </style> + +</head> +<body> + + <h1>Welcome to the World of LongTail Video</h1> + <p>Thanks for downloading the JW FLV Player, just one of many products created by Jeroen "JW" Wijering and his company, <a href="http://www.longtailvideo.com">LongTail Video</a>. Before you get started, let us tell you about a few other products that might interest you:</p> + +<ul> +<li><a href="http://www.longtailvideo.com/players/jw-desktop-player/">Desktop Player</a> - Our sleek new desktop player is the best way to watch all your music and video files. Plus, you can even search the web for videos without ever opening your browser. <a href="http://www.longtailvideo.com/players/jw-desktop-player/">Download it now</a>.</li> +<li><a href="http://www.longtailvideo.com/referral.aspx?page=pubreferral&ref=oryixfvlxlptwph">AdSolution</a> - Monetize your videos with LongTail's AdSolution. Integrate pre-roll, overlay mid-roll and post-roll ads into your site and starting making money today. <a href="http://www.longtailvideo.com/referral.aspx?page=pubreferral&ref=oryixfvlxlptwph">Sign up now</a>.</li> +<li><a href="http://www.bitsontherun.com/via/longtailvideo">Bits on the Run</a> - Upload, encode, store, manage and stream your videos with Bits on the Run, LongTail's end-to-end video content management system. <a href="http://www.bitsontherun.com/via/longtailvideo">Sign up now</a>.</li> +<li><a href="http://www.longtailvideo.com/addons/plugins">Plugins</a> - Add functionality to your player, like analytics tracking, embed links, sharing and more. <a href="http://www.longtailvideo.com/addons/plugins">Find one for you</a>.</li> +<li><a href="http://www.longtailvideo.com/addons/skins">Skins</a> - Change the look of your player to match your site. <a href="http://www.longtailvideo.com/addons/skins">View our library</a>.</li> +</ul> + + + <h3>Licensing</h3> + <p>The player is licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/">Creative Commons License</a>. It allows you to use, modify and redistribute the script, but only for <b>noncommercial</b> purposes. Examples of <b>commercial use</b> include: + + <ul> + <li>websites with any advertisements; </li> + <li>websites owned or operated by corporations; </li> + <li>websites designed to promote other products, such as a band or artist;</li> + <li>products (e.g. a CMS) that bundle LongTail products into its offering. </li> + </ul> + + If any of the above conditions apply to you, <a href="http://www.longtailvideo.com/players/order" title="Order commercial licenses">please apply for a commercial license</a> now. If you are still unsure whether you need to purchase a license, please <a href="http://www.longtailvideo.com/forum/">post your question</a> in the forum. </p> + + <h3>Quickstart</h3> + <p>The easiest way to get to know the player is by using our <a href="http://www.longtailvideo.com/support/jw-player-setup-wizard">setup wizard</a>. Select an example, set the file or playlist you want to play and copy-paste the embed code to your site. If you want to play Youtube content in the player, you also have to copy the <b>yt.swf</b> file along with the player.swf or player-viral.swf.</p> + + <p>If you need any help, please visit our extensive support section, including <a href="http://www.longtailvideo.com/support/faq">FAQs</a>, a string of <a href="http://www.longtailvideo.com/support/tutorials">tutorials</a> and a very active <a href="http://www.longtailvideo.com/support/forum">support forum</a>.</p> + + <h3>Wiki and Source Code</h3> + <p>The <a href="http://developer.longtailvideo.com">Developer Wiki</a> contains a wealth of info about the player, including:</p> + <ol> + <li><a href="http://developer.longtailvideo.com/trac/wiki/FlashFormats">Supported file formats</a> (and playlists).</li> + <li><a href="http://developer.longtailvideo.com/trac/wiki/FlashVars">Supported flashvars</a> (for customizing the player).</li> + <li><a href="http://developer.longtailvideo.com/trac/wiki/FlashAPI">Supported API calls</a> (for actionscript / javascript interaction).</li> + <li><a href="http://developer.longtailvideo.com/trac/wiki/FlashSkinning">Supported skinning elements</a> (for creating your own graphics).</li> + <li><a href="http://developer.longtailvideo.com/trac/roadmap/">Roadmap with full changelogs</a> for each version.</li> + </ol> + <p>The source code of all different versions of the player can <a href="http://developer.longtailvideo.com/trac/browser/tags">be found here</a>. You can click a version and download the ZIP files (the links are at the bottom).</p> + +</body> +</html>
\ No newline at end of file diff --git a/chimere/static/jme/packages/player.swf b/chimere/static/jme/packages/player.swf Binary files differnew file mode 100644 index 0000000..2a6cb0b --- /dev/null +++ b/chimere/static/jme/packages/player.swf diff --git a/chimere/static/jme/packages/yt.swf b/chimere/static/jme/packages/yt.swf Binary files differnew file mode 100644 index 0000000..881ec8b --- /dev/null +++ b/chimere/static/jme/packages/yt.swf |
