Permalink
Browse files

Update to MediaElement.js version 2.9.1

  • Loading branch information...
1 parent 533a400 commit 7b270067ea6774988957107a7e2a8d774c03c8d3 @nbibler nbibler committed Jun 18, 2012
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -7,15 +7,15 @@
* for browsers that don't understand HTML5 or can't play the provided codec
* Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3
*
-* Copyright 2010-2011, John Dyer (http://j.hn)
+* Copyright 2010-2012, John Dyer (http://j.hn)
* Dual licensed under the MIT or GPL Version 2 licenses.
*
*/
// Namespace
var mejs = mejs || {};
// version number
-mejs.version = '2.6.5';
+mejs.version = '2.9.1';
// player number (for missing, same id attr)
mejs.meIndex = 0;
@@ -26,11 +26,11 @@ mejs.plugins = {
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
],
flash: [
- {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg']}
+ {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']}
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
],
youtube: [
- {version: null, types: ['video/youtube']}
+ {version: null, types: ['video/youtube', 'video/x-youtube']}
],
vimeo: [
{version: null, types: ['video/vimeo']}
@@ -59,11 +59,13 @@ mejs.Utility = {
path = '',
name = '',
script,
- scripts = document.getElementsByTagName('script');
+ scripts = document.getElementsByTagName('script'),
+ il = scripts.length,
+ jl = scriptNames.length;
- for (; i < scripts.length; i++) {
+ for (; i < il; i++) {
script = scripts[i].src;
- for (j = 0; j < scriptNames.length; j++) {
+ for (j = 0; j < jl; j++) {
name = scriptNames[j];
if (script.indexOf(name) > -1) {
path = script.substring(0, script.indexOf(name));
@@ -436,6 +438,7 @@ mejs.PluginMediaElement.prototype = {
seeking: false,
duration: 0,
error: null,
+ tagName: '',
// HTML5 get/set properties, but only set (updated by event handlers)
muted: false,
@@ -650,6 +653,24 @@ mejs.PluginMediaElement.prototype = {
},
// end: fake events
+ // fake DOM attribute methods
+ attributes: {},
+ hasAttribute: function(name){
+ return (name in this.attributes);
+ },
+ removeAttribute: function(name){
+ delete this.attributes[name];
+ },
+ getAttribute: function(name){
+ if (this.hasAttribute(name)) {
+ return this.attributes[name];
+ }
+ return '';
+ },
+ setAttribute: function(name, value){
+ this.attributes[name] = value;
+ },
+
remove: function() {
mejs.Utility.removeSwf(this.pluginElement.id);
}
@@ -1021,7 +1042,7 @@ mejs.HtmlMediaElementShim = {
} catch (e) {}
errorContainer.innerHTML = (poster !== '') ?
- '<a href="' + playback.url + '"><img src="' + poster + '" /></a>' :
+ '<a href="' + playback.url + '"><img src="' + poster + '" width="100%" height="100%" /></a>' :
'<a href="' + playback.url + '"><span>Download File</span></a>';
htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
@@ -1042,6 +1063,17 @@ mejs.HtmlMediaElementShim = {
node,
initVars;
+ // copy tagName from html media element
+ pluginMediaElement.tagName = htmlMediaElement.tagName
+
+ // copy attributes from html media element to plugin media element
+ for (var i = 0; i < htmlMediaElement.attributes.length; i++) {
+ var attribute = htmlMediaElement.attributes[i];
+ if (attribute.specified == true) {
+ pluginMediaElement.setAttribute(attribute.name, attribute.value);
+ }
+ }
+
// check for placement inside a <p> tag (sometimes WYSIWYG editors do this)
node = htmlMediaElement.parentNode;
while (node !== null && node.tagName.toLowerCase() != 'body') {
@@ -1361,6 +1393,7 @@ mejs.YouTubeApi = {
iFrameReady: function() {
+ this.isLoaded = true;
this.isIframeLoaded = true;
while (this.iframeQueue.length > 0) {
Oops, something went wrong.

0 comments on commit 7b27006

Please sign in to comment.