Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
johndyer committed Mar 13, 2013
2 parents 1837dea + 769dd1b commit f70e455
Show file tree
Hide file tree
Showing 17 changed files with 3,833 additions and 76 deletions.
1 change: 1 addition & 0 deletions src/js/me-mediaelements.js
Expand Up @@ -322,5 +322,6 @@ mejs.PluginMediaElement.prototype = {

remove: function() {
mejs.Utility.removeSwf(this.pluginElement.id);
mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id);
}
};
4 changes: 2 additions & 2 deletions src/js/me-namespace.js
Expand Up @@ -17,9 +17,9 @@ mejs.plugins = {
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
],
youtube: [
{version: null, types: ['video/youtube', 'video/x-youtube']}
{version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']}
],
vimeo: [
{version: null, types: ['video/vimeo', 'video/x-vimeo']}
]
};
};
24 changes: 15 additions & 9 deletions src/js/me-shim.js
Expand Up @@ -9,6 +9,11 @@ mejs.MediaPluginBridge = {
this.htmlMediaElements[id] = htmlMediaElement;
},

unregisterPluginElement: function (id) {
delete this.pluginMediaElements[id];
delete this.htmlMediaElements[id];
},

// when Flash/Silverlight is ready, it calls out to this method
initPlugin: function (id) {

Expand Down Expand Up @@ -504,7 +509,7 @@ mejs.HtmlMediaElementShim = {
switch (playback.method) {
case 'silverlight':
container.innerHTML =
'<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '">' +
'<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' +
'<param name="initParams" value="' + initVars.join(',') + '" />' +
'<param name="windowless" value="true" />' +
'<param name="background" value="black" />' +
Expand All @@ -521,7 +526,7 @@ mejs.HtmlMediaElementShim = {
container.appendChild(specialIEContainer);
specialIEContainer.outerHTML =
'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' +
'id="' + pluginid + '" width="' + width + '" height="' + height + '">' +
'id="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' +
'<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date()) + '" />' +
'<param name="flashvars" value="' + initVars.join('&amp;') + '" />' +
'<param name="quality" value="high" />' +
Expand All @@ -546,7 +551,8 @@ mejs.HtmlMediaElementShim = {
'src="' + options.pluginPath + options.flashName + '" ' +
'flashvars="' + initVars.join('&') + '" ' +
'width="' + width + '" ' +
'height="' + height + '"></embed>';
'height="' + height + '" ' +
'class="mejs-shim"></embed>';
}
break;

Expand Down Expand Up @@ -579,16 +585,16 @@ mejs.HtmlMediaElementShim = {

pluginMediaElement.vimeoid = playback.url.substr(playback.url.lastIndexOf('/')+1);

container.innerHTML ='<iframe src="http://player.vimeo.com/video/' + pluginMediaElement.vimeoid + '?portrait=0&byline=0&title=0" width="' + width +'" height="' + height +'" frameborder="0"></iframe>';
container.innerHTML ='<iframe src="http://player.vimeo.com/video/' + pluginMediaElement.vimeoid + '?portrait=0&byline=0&title=0" width="' + width +'" height="' + height +'" frameborder="0" class="mejs-shim"></iframe>';

/*
container.innerHTML =
'<object width="' + width + '" height="' + height + '">' +
'<object width="' + width + '" height="' + height + '" class="mejs-shim">' +
'<param name="allowfullscreen" value="true" />' +
'<param name="allowscriptaccess" value="always" />' +
'<param name="flashvars" value="api=1" />' +
'<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + pluginMediaElement.vimeoid + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" />' +
'<embed src="//vimeo.com/moogaloop.swf?api=1&amp;clip_id=' + pluginMediaElement.vimeoid + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + width + '" height="' + height + '"></embed>' +
'<embed src="//vimeo.com/moogaloop.swf?api=1&amp;clip_id=' + pluginMediaElement.vimeoid + '&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + width + '" height="' + height + '" class="mejs-shim"></embed>' +
'</object>';
*/

Expand Down Expand Up @@ -772,7 +778,7 @@ mejs.YouTubeApi = {
/*
settings.container.innerHTML =
'<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="//www.youtube.com/apiplayer?enablejsapi=1&amp;playerapiid=' + settings.pluginId + '&amp;version=3&amp;autoplay=0&amp;controls=0&amp;modestbranding=1&loop=0" ' +
'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; ">' +
'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' +
'<param name="allowScriptAccess" value="always">' +
'<param name="wmode" value="transparent">' +
'</object>';
Expand All @@ -786,7 +792,7 @@ mejs.YouTubeApi = {
specialIEContainer = document.createElement('div');
settings.container.appendChild(specialIEContainer);
specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' +
'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '">' +
'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '" class="mejs-shim">' +
'<param name="movie" value="' + youtubeUrl + '" />' +
'<param name="wmode" value="transparent" />' +
'<param name="allowScriptAccess" value="always" />' +
Expand All @@ -795,7 +801,7 @@ mejs.YouTubeApi = {
} else {
settings.container.innerHTML =
'<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + youtubeUrl + '" ' +
'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; ">' +
'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' +
'<param name="allowScriptAccess" value="always">' +
'<param name="wmode" value="transparent">' +
'</object>';
Expand Down
2 changes: 1 addition & 1 deletion src/js/me-utility.js
Expand Up @@ -110,7 +110,7 @@ mejs.Utility = {
/* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */
removeSwf: function(id) {
var obj = document.getElementById(id);
if (obj && obj.nodeName == "OBJECT") {
if (obj && /object|embed/i.test(obj.nodeName)) {
if (mejs.MediaFeatures.isIE) {
obj.style.display = "none";
(function(){
Expand Down
4 changes: 4 additions & 0 deletions src/js/mep-feature-contextmenu.js
Expand Up @@ -92,6 +92,10 @@ $.extend(mejs.MepDefaults,

});
},

cleancontextmenu: function(player) {
player.contextMenu.remove();
},

isContextMenuEnabled: true,
enableContextMenu: function() {
Expand Down
31 changes: 17 additions & 14 deletions src/js/mep-feature-fullscreen.js
Expand Up @@ -27,15 +27,7 @@
if (mejs.MediaFeatures.hasTrueNativeFullScreen) {

// chrome doesn't alays fire this in an iframe
var target = null;

if (mejs.MediaFeatures.hasMozNativeFullScreen) {
target = $(document);
} else {
target = player.container;
}

target.bind(mejs.MediaFeatures.fullScreenEventName, function(e) {
var func = function(e) {

if (mejs.MediaFeatures.isFullScreen()) {
player.isNativeFullScreen = true;
Expand All @@ -47,7 +39,13 @@
// make sure to put the player back into place
player.exitFullScreen();
}
});
};

if (mejs.MediaFeatures.hasMozNativeFullScreen) {
player.globalBind(mejs.MediaFeatures.fullScreenEventName, func);
} else {
player.container.bind(mejs.MediaFeatures.fullScreenEventName, func);
}
}

var t = this,
Expand Down Expand Up @@ -153,7 +151,7 @@
left: fullScreenBtnOffset + fullScreenBtnWidth});
};

$(document).resize(function() {
t.globalBind('resize', function() {
positionHoverDivs();
});

Expand Down Expand Up @@ -193,7 +191,7 @@
// the mouseout event doesn't work on the fullscren button, because we already killed the pointer-events
// so we use the document.mousemove event to restore controls when the mouse moves outside the fullscreen button
/*
$(document).mousemove(function(e) {
t.globalBind('mousemove', function(e) {
// if the mouse is anywhere but the fullsceen button, then restore it all
if (fullscreenIsDisabled) {
Expand Down Expand Up @@ -251,13 +249,18 @@

player.fullscreenBtn = fullscreenBtn;

$(document).bind('keydown',function (e) {
t.globalBind('keydown',function (e) {
if (((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen) && e.keyCode == 27) {
player.exitFullScreen();
}
});

},

cleanfullscreen: function(player) {
player.exitFullScreen();
},

enterFullScreen: function() {

var t = this;
Expand Down Expand Up @@ -361,7 +364,7 @@
.width('100%')
.height('100%');
} else {
t.container.find('object, embed, iframe')
t.container.find('.mejs-shim')
.width('100%')
.height('100%');

Expand Down
21 changes: 10 additions & 11 deletions src/js/mep-feature-progress.js
Expand Up @@ -71,21 +71,20 @@
if (e.which === 1) {
mouseIsDown = true;
handleMouseMove(e);
$(document)
.bind('mousemove.dur', function(e) {
handleMouseMove(e);
})
.bind('mouseup.dur', function (e) {
mouseIsDown = false;
timefloat.hide();
$(document).unbind('.dur');
});
t.globalBind('mousemove.dur', function(e) {
handleMouseMove(e);
});
t.globalBind('mouseup.dur', function (e) {
mouseIsDown = false;
timefloat.hide();
t.globalUnbind('.dur');
});
return false;
}
})
.bind('mouseenter', function(e) {
mouseIsOver = true;
$(document).bind('mousemove.dur', function(e) {
t.globalBind('mousemove.dur', function(e) {
handleMouseMove(e);
});
if (!mejs.MediaFeatures.hasTouch) {
Expand All @@ -95,7 +94,7 @@
.bind('mouseleave',function(e) {
mouseIsOver = false;
if (!mouseIsDown) {
$(document).unbind('.dur');
t.globalUnbind('.dur');
timefloat.hide();
}
});
Expand Down
21 changes: 10 additions & 11 deletions src/js/mep-feature-volume.js
Expand Up @@ -170,18 +170,17 @@
})
.bind('mousedown', function (e) {
handleVolumeMove(e);
$(document)
.bind('mousemove.vol', function(e) {
handleVolumeMove(e);
})
.bind('mouseup.vol', function () {
mouseIsDown = false;
$(document).unbind('.vol');
t.globalBind('mousemove.vol', function(e) {
handleVolumeMove(e);
});
t.globalBind('mouseup.vol', function () {
mouseIsDown = false;
t.globalUnbind('.vol');

if (!mouseIsOver && mode == 'vertical') {
volumeSlider.hide();
}
});
if (!mouseIsOver && mode == 'vertical') {
volumeSlider.hide();
}
});
mouseIsDown = true;

return false;
Expand Down

0 comments on commit f70e455

Please sign in to comment.