Skip to content

Commit

Permalink
2.10.0 release files
Browse files Browse the repository at this point in the history
  • Loading branch information
johndyer committed Nov 23, 2012
1 parent 1da259a commit 7f11343
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 128 deletions.
1 change: 1 addition & 0 deletions build/bigplay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build/controls.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 25 additions & 12 deletions build/mediaelement-and-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var mejs = mejs || {};

// version number
mejs.version = '2.9.5';
mejs.version = '2.10.0';

// player number (for missing, same id attr)
mejs.meIndex = 0;
Expand All @@ -33,7 +33,7 @@ mejs.plugins = {
{version: null, types: ['video/youtube', 'video/x-youtube']}
],
vimeo: [
{version: null, types: ['video/vimeo']}
{version: null, types: ['video/vimeo', 'video/x-vimeo']}
]
};

Expand Down Expand Up @@ -303,6 +303,10 @@ mejs.MediaFeatures = {
t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit;
t.isOpera = (ua.match(/opera/gi) !== null);
t.hasTouch = ('ontouchstart' in window);

// borrowed from Modernizr
t.svg = !! document.createElementNS &&
!! document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect;

// create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection
for (i=0; i<html5Elements.length; i++) {
Expand Down Expand Up @@ -899,7 +903,8 @@ mejs.HtmlMediaElementShim = {
pluginName,
pluginVersions,
pluginInfo,
dummy;
dummy,
media;

// STEP 1: Get URL and type from <video src> or <source src>

Expand Down Expand Up @@ -929,7 +934,11 @@ mejs.HtmlMediaElementShim = {
if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') {
src = n.getAttribute('src');
type = this.formatType(src, n.getAttribute('type'));
mediaFiles.push({type:type, url:src});
media = n.getAttribute('media');

if (!media || !window.matchMedia || (window.matchMedia && window.matchMedia(media).matches)) {
mediaFiles.push({type:type, url:src});
}
}
}
}
Expand Down Expand Up @@ -1060,6 +1069,7 @@ mejs.HtmlMediaElementShim = {
},

getTypeFromFile: function(url) {
url = url.split('?')[0];
var ext = url.substring(url.lastIndexOf('.') + 1);
return (/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + this.getTypeFromExtension(ext);
},
Expand Down Expand Up @@ -1097,7 +1107,7 @@ mejs.HtmlMediaElementShim = {

errorContainer.innerHTML = (poster !== '') ?
'<a href="' + playback.url + '"><img src="' + poster + '" width="100%" height="100%" /></a>' :
'<a href="' + playback.url + '"><span>Download File</span></a>';
'<a href="' + playback.url + '"><span>' + mejs.i18n.t('Download File') + '</span></a>';

htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
htmlMediaElement.style.display = 'none';
Expand Down Expand Up @@ -1277,6 +1287,9 @@ 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 =
'<object width="' + width + '" height="' + height + '">' +
'<param name="allowfullscreen" value="true" />' +
Expand All @@ -1285,7 +1298,8 @@ mejs.HtmlMediaElementShim = {
'<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>' +
'</object>';

*/

break;
}
// hide original element
Expand Down Expand Up @@ -2058,7 +2072,7 @@ if (typeof jQuery != 'undefined') {

// build container
t.container =
$('<div id="' + t.id + '" class="mejs-container">'+
$('<div id="' + t.id + '" class="mejs-container ' + (mejs.MediaFeatures.svg ? 'svg' : 'no-svg') + '">'+
'<div class="mejs-inner">'+
'<div class="mejs-mediaelement"></div>'+
'<div class="mejs-layers"></div>'+
Expand Down Expand Up @@ -2528,8 +2542,8 @@ if (typeof jQuery != 'undefined') {

// do we have the native dimensions yet?
var
nativeWidth = (t.media.videoWidth && t.media.videoWidth > 0) ? t.media.videoWidth : t.options.defaultVideoWidth,
nativeHeight = (t.media.videoHeight && t.media.videoHeight > 0) ? t.media.videoHeight : t.options.defaultVideoHeight,
nativeWidth = t.isVideo ? ((t.media.videoWidth && t.media.videoWidth > 0) ? t.media.videoWidth : t.options.defaultVideoWidth) : t.options.defaultAudioWidth,
nativeHeight = t.isVideo ? ((t.media.videoHeight && t.media.videoHeight > 0) ? t.media.videoHeight : t.options.defaultVideoHeight) : t.options.defaultAudioHeight,
parentWidth = t.container.parent().width(),
newHeight = parseInt(parentWidth * nativeHeight/nativeWidth, 10);

Expand All @@ -2544,7 +2558,7 @@ if (typeof jQuery != 'undefined') {
.width(parentWidth)
.height(newHeight);

// set native <video>
// set native <video> or <audio>
t.$media
.width('100%')
.height('100%');
Expand Down Expand Up @@ -3261,7 +3275,7 @@ if (typeof jQuery != 'undefined') {

positionVolumeHandle = function(volume, secondTry) {

if (!volumeSlider.is(':visible') && typeof secondTry != 'undefined') {
if (!volumeSlider.is(':visible') && typeof secondTry == 'undefined') {
volumeSlider.show();
positionVolumeHandle(volume, true);
volumeSlider.hide()
Expand Down Expand Up @@ -3432,7 +3446,6 @@ if (typeof jQuery != 'undefined') {
});

})(mejs.$);

(function($) {

$.extend(mejs.MepDefaults, {
Expand Down
Loading

0 comments on commit 7f11343

Please sign in to comment.