Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Media** is a *presentation component* bundled with the [Adapt framework](https://github.com/adaptlearning/adapt_framework). This plugin is an HTML5 media playback component for both audio and video.

The component uses [MediaElement.js (v7.0.7)](http://mediaelementjs.com/), a player with a number of useful features including subtitles and accessible (and CSS-skinnable) controls. [MediaElement.js](https://github.com/johndyer/mediaelement) carries the MIT license compatible with Adapt.
The component uses [MediaElement.js (v7.1.0)](http://mediaelementjs.com/), a player with a number of useful features including subtitles and accessible (and CSS-skinnable) controls. [MediaElement.js](https://github.com/johndyer/mediaelement) carries the MIT license compatible with Adapt.

For playing YouTube and Vimeo videos, use the dedicated [YouTube](https://github.com/adaptlearning/adapt-youtube) or [Vimeo](https://github.com/adaptlearning/adapt-vimeo) plugins instead. These formats are no longer supported by the Media plugin.

Expand Down
12 changes: 12 additions & 0 deletions less/mediaelementplayer.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ Reference: http://blog.rrwd.nl/2015/04/04/the-screen-reader-text-class-why-and-h
z-index: 1000;
}

.mejs__container-fullscreen video {
height: 100vh !important;
left: 50% !important;
object-fit: contain;
position: fixed !important;
top: 50% !important;
-webkit-transform: translate(-50%, -50%) !important;
-ms-transform: translate(-50%, -50%) !important;
transform: translate(-50%, -50%) !important;
width: 100vw !important;
}

/* Start: LAYERS */
.mejs__background {
left: 0;
Expand Down
5 changes: 2 additions & 3 deletions libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

## mediaelement-and-player.js

*<https://github.com/mediaelement/mediaelement/blob/7.0.7/build/mediaelement-and-player.js>*
*<https://github.com/mediaelement/mediaelement/blob/7.1.0/build/mediaelement-and-player.js>*

Contains the following PRs that may or may not be currently part of the master branch.

* svg4everyone remove define variable for umd header: <https://github.com/mediaelement/mediaelement/pull/2969>
* Remove fullscreen fix for Chrome version <17. Original issue: <https://github.com/adaptlearning/adapt-contrib-media/issues/255> Applies fix from <https://github.com/mediaelement/mediaelement/pull/2971>
* svg4everyone remove define variable for umd header: <https://github.com/mediaelement/mediaelement/pull/2969>. Without it, the library fails to load wherever RequireJS is present, which includes every Adapt course.
51 changes: 29 additions & 22 deletions libraries/mediaelement-and-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de

var mejs = {};

mejs.version = '7.0.7';
mejs.version = '7.1.0';

mejs.html5media = {
properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'],
Expand Down Expand Up @@ -1253,10 +1253,6 @@ _mejs2.default.Renderers = renderer;
},{"8":8}],10:[function(_dereq_,module,exports){
'use strict';

var _window = _dereq_(3);

var _window2 = _interopRequireDefault(_window);

var _document = _dereq_(2);

var _document2 = _interopRequireDefault(_document);
Expand Down Expand Up @@ -1405,8 +1401,8 @@ Object.assign(_player2.default.prototype, {
return;
}

if (t.options.useFakeFullscreen === false && (Features.IS_IOS || Features.IS_SAFARI) && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) {
t.media.originalNode.webkitEnterFullscreen();
if (t.options.useFakeFullscreen === false && (Features.IS_IOS || Features.IS_SAFARI) && Features.HAS_IOS_FULLSCREEN && typeof t.node.webkitEnterFullscreen === 'function' && t.node.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) {
t.node.webkitEnterFullscreen();
return;
}

Expand All @@ -1423,16 +1419,7 @@ Object.assign(_player2.default.prototype, {
t.getElement(t.container).style.width = '100%';
t.getElement(t.container).style.height = '100%';

t.containerSizeTimeout = setTimeout(function () {
t.getElement(t.container).style.width = '100%';
t.getElement(t.container).style.height = '100%';
t.setControlsSize();
}, 500);

if (isNative) {
t.node.style.width = '100%';
t.node.style.height = '100%';
} else {
if (isNative) {} else {
var elements = t.getElement(t.container).querySelectorAll('embed, object, video'),
_total = elements.length;
for (var i = 0; i < _total; i++) {
Expand All @@ -1441,7 +1428,7 @@ Object.assign(_player2.default.prototype, {
}
}

if (t.options.setDimensions && typeof t.media.setSize === 'function') {
if (t.options.setDimensions && typeof t.media.setSize === 'function' && !isNative) {
t.media.setSize(screen.width, screen.height);
}

Expand All @@ -1457,8 +1444,14 @@ Object.assign(_player2.default.prototype, {
(0, _dom.addClass)(t.fullscreenBtn, t.options.classPrefix + 'unfullscreen');
}

t.setControlsSize();
t.isFullScreen = true;
t.setControlsSize();

if (!isNative) {
requestAnimationFrame(function () {
t.setPlayerSize(screen.width, screen.height);
});
}

var zoomFactor = Math.min(screen.width / t.width, screen.height / t.height),
captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text');
Expand Down Expand Up @@ -1523,6 +1516,8 @@ Object.assign(_player2.default.prototype, {
t.setControlsSize();
t.isFullScreen = false;

t.setPlayerSize(t.normalWidth, t.normalHeight);

var captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text');
if (captionText) {
captionText.style.fontSize = '';
Expand All @@ -1534,7 +1529,7 @@ Object.assign(_player2.default.prototype, {
}
});

},{"17":17,"2":2,"24":24,"25":25,"26":26,"27":27,"28":28,"3":3,"6":6}],11:[function(_dereq_,module,exports){
},{"17":17,"2":2,"24":24,"25":25,"26":26,"27":27,"28":28,"6":6}],11:[function(_dereq_,module,exports){
'use strict';

var _document = _dereq_(2);
Expand Down Expand Up @@ -4254,13 +4249,14 @@ var MediaElementPlayer = function () {
}, 0);

t.globalResizeCallback = function () {
if (!(t.isFullScreen || _constants.HAS_TRUE_NATIVE_FULLSCREEN && _document2.default.webkitIsFullScreen)) {
if (t.isFullScreen || _constants.HAS_TRUE_NATIVE_FULLSCREEN && _document2.default.webkitIsFullScreen) {
t.setPlayerSize(screen.width, screen.height);
} else {
t.setPlayerSize(t.width, t.height);
}

t.setControlsSize();
};

t.globalBind('resize', t.globalResizeCallback);
}

Expand Down Expand Up @@ -4347,6 +4343,11 @@ var MediaElementPlayer = function () {
t.height = height;
}

if (t.isFullScreen || _constants.HAS_TRUE_NATIVE_FULLSCREEN && _document2.default.webkitIsFullScreen) {
t.setDimensions(t.width, t.height);
return;
}

switch (t.options.stretching) {
case 'fill':
if (t.isVideo) {
Expand Down Expand Up @@ -4611,6 +4612,12 @@ var MediaElementPlayer = function () {
t.getElement(t.container).style.width = width;
t.getElement(t.container).style.height = height;

var isNative = t.media.rendererName !== null && /(html5|native)/i.test(t.media.rendererName);
if ((t.isFullScreen || _constants.HAS_TRUE_NATIVE_FULLSCREEN && _document2.default.webkitIsFullScreen) && !isNative) {
t.node.style.width = width;
t.node.style.height = height;
}

var layers = t.getElement(t.layers).children;
for (var i = 0, total = layers.length; i < total; i++) {
layers[i].style.width = width;
Expand Down
Loading