mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-58530 media_videojs: upgrade videojs to 5.18.4
This commit is contained in:
parent
bd99cb9021
commit
4aaaabb0da
12 changed files with 9035 additions and 6924 deletions
File diff suppressed because one or more lines are too long
17
media/player/videojs/amd/build/video-lazy.min.js
vendored
17
media/player/videojs/amd/build/video-lazy.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -33,7 +33,8 @@ THE SOFTWARE. */
|
|||
}(this, function(videojs) {
|
||||
'use strict';
|
||||
|
||||
var Tech = videojs.getComponent('Tech');
|
||||
var _isOnMobile = videojs.browser.IS_IOS || videojs.browser.IS_ANDROID;
|
||||
var Tech = videojs.getTech('Tech');
|
||||
|
||||
var Youtube = videojs.extend(Tech, {
|
||||
|
||||
|
@ -77,7 +78,7 @@ THE SOFTWARE. */
|
|||
this.el_.parentNode.className = this.el_.parentNode.className
|
||||
.replace(' vjs-youtube', '')
|
||||
.replace(' vjs-youtube-mobile', '');
|
||||
this.el_.remove();
|
||||
this.el_.parentNode.removeChild(this.el_);
|
||||
|
||||
//Needs to be called after the YouTube player is destroyed, otherwise there will be a null reference exception
|
||||
Tech.prototype.dispose.call(this);
|
||||
|
@ -206,6 +207,14 @@ THE SOFTWARE. */
|
|||
playerVars.theme = this.options_.theme;
|
||||
}
|
||||
|
||||
// Allow undocumented options to be passed along via customVars
|
||||
if (typeof this.options_.customVars !== 'undefined') {
|
||||
var customVars = this.options_.customVars;
|
||||
Object.keys(customVars).forEach(function(key) {
|
||||
playerVars[key] = customVars[key];
|
||||
});
|
||||
}
|
||||
|
||||
this.activeVideoId = this.url ? this.url.videoId : null;
|
||||
this.activeList = playerVars.list;
|
||||
|
||||
|
@ -215,6 +224,7 @@ THE SOFTWARE. */
|
|||
events: {
|
||||
onReady: this.onPlayerReady.bind(this),
|
||||
onPlaybackQualityChange: this.onPlayerPlaybackQualityChange.bind(this),
|
||||
onPlaybackRateChange: this.onPlayerPlaybackRateChange.bind(this),
|
||||
onStateChange: this.onPlayerStateChange.bind(this),
|
||||
onError: this.onPlayerError.bind(this)
|
||||
}
|
||||
|
@ -222,13 +232,22 @@ THE SOFTWARE. */
|
|||
},
|
||||
|
||||
onPlayerReady: function() {
|
||||
if (this.options_.muted) {
|
||||
this.ytPlayer.mute();
|
||||
}
|
||||
|
||||
var playbackRates = this.ytPlayer.getAvailablePlaybackRates();
|
||||
if (playbackRates.length > 1) {
|
||||
this.featuresPlaybackRate = true;
|
||||
}
|
||||
|
||||
this.playerReady_ = true;
|
||||
this.triggerReady();
|
||||
|
||||
if (this.playOnReady) {
|
||||
this.play();
|
||||
} else if (this.cueOnReady) {
|
||||
this.ytPlayer.cueVideoById(this.url.videoId);
|
||||
this.cueVideoById_(this.url.videoId);
|
||||
this.activeVideoId = this.url.videoId;
|
||||
}
|
||||
},
|
||||
|
@ -237,6 +256,10 @@ THE SOFTWARE. */
|
|||
|
||||
},
|
||||
|
||||
onPlayerPlaybackRateChange: function() {
|
||||
this.trigger('ratechange');
|
||||
},
|
||||
|
||||
onPlayerStateChange: function(e) {
|
||||
var state = e.data;
|
||||
|
||||
|
@ -251,6 +274,7 @@ THE SOFTWARE. */
|
|||
this.trigger('loadstart');
|
||||
this.trigger('loadedmetadata');
|
||||
this.trigger('durationchange');
|
||||
this.trigger('ratechange');
|
||||
break;
|
||||
|
||||
case YT.PlayerState.ENDED:
|
||||
|
@ -286,26 +310,55 @@ THE SOFTWARE. */
|
|||
|
||||
onPlayerError: function(e) {
|
||||
this.errorNumber = e.data;
|
||||
this.trigger('pause');
|
||||
this.trigger('error');
|
||||
|
||||
this.ytPlayer.stopVideo();
|
||||
},
|
||||
|
||||
error: function() {
|
||||
var code = 1000 + this.errorNumber; // as smaller codes are reserved
|
||||
switch (this.errorNumber) {
|
||||
case 5:
|
||||
return { code: 'Error while trying to play the video' };
|
||||
return { code: code, message: 'Error while trying to play the video' };
|
||||
|
||||
case 2:
|
||||
case 100:
|
||||
return { code: 'Unable to find the video' };
|
||||
return { code: code, message: 'Unable to find the video' };
|
||||
|
||||
case 101:
|
||||
case 150:
|
||||
return { code: 'Playback on other Websites has been disabled by the video owner.' };
|
||||
return {
|
||||
code: code,
|
||||
message: 'Playback on other Websites has been disabled by the video owner.'
|
||||
};
|
||||
}
|
||||
|
||||
return { code: 'YouTube unknown error (' + this.errorNumber + ')' };
|
||||
return { code: code, message: 'YouTube unknown error (' + this.errorNumber + ')' };
|
||||
},
|
||||
|
||||
loadVideoById_: function(id) {
|
||||
var options = {
|
||||
videoId: id
|
||||
};
|
||||
if (this.options_.start) {
|
||||
options.startSeconds = this.options_.start;
|
||||
}
|
||||
if (this.options_.end) {
|
||||
options.endEnd = this.options_.end;
|
||||
}
|
||||
this.ytPlayer.loadVideoById(options);
|
||||
},
|
||||
|
||||
cueVideoById_: function(id) {
|
||||
var options = {
|
||||
videoId: id
|
||||
};
|
||||
if (this.options_.start) {
|
||||
options.startSeconds = this.options_.start;
|
||||
}
|
||||
if (this.options_.end) {
|
||||
options.endEnd = this.options_.end;
|
||||
}
|
||||
this.ytPlayer.cueVideoById(options);
|
||||
},
|
||||
|
||||
src: function(src) {
|
||||
|
@ -358,7 +411,7 @@ THE SOFTWARE. */
|
|||
}
|
||||
} else if (this.activeVideoId !== this.url.videoId) {
|
||||
if (this.isReady_) {
|
||||
this.ytPlayer.cueVideoById(this.url.videoId);
|
||||
this.cueVideoById_(this.url.videoId);
|
||||
this.activeVideoId = this.url.videoId;
|
||||
} else {
|
||||
this.cueOnReady = true;
|
||||
|
@ -402,7 +455,7 @@ THE SOFTWARE. */
|
|||
if (this.activeVideoId === this.url.videoId) {
|
||||
this.ytPlayer.playVideo();
|
||||
} else {
|
||||
this.ytPlayer.loadVideoById(this.url.videoId);
|
||||
this.loadVideoById_(this.url.videoId);
|
||||
this.activeVideoId = this.url.videoId;
|
||||
}
|
||||
} else {
|
||||
|
@ -463,24 +516,11 @@ THE SOFTWARE. */
|
|||
},
|
||||
|
||||
seekable: function () {
|
||||
if(!this.ytPlayer || !this.ytPlayer.getVideoLoadedFraction) {
|
||||
return {
|
||||
length: 0,
|
||||
start: function() {
|
||||
throw new Error('This TimeRanges object is empty');
|
||||
},
|
||||
end: function() {
|
||||
throw new Error('This TimeRanges object is empty');
|
||||
}
|
||||
};
|
||||
if(!this.ytPlayer) {
|
||||
return videojs.createTimeRange();
|
||||
}
|
||||
var end = this.ytPlayer.getDuration();
|
||||
|
||||
return {
|
||||
length: this.ytPlayer.getDuration(),
|
||||
start: function() { return 0; },
|
||||
end: function() { return end; }
|
||||
};
|
||||
return videojs.createTimeRange(0, this.ytPlayer.getDuration());
|
||||
},
|
||||
|
||||
onSeeked: function() {
|
||||
|
@ -504,7 +544,6 @@ THE SOFTWARE. */
|
|||
}
|
||||
|
||||
this.ytPlayer.setPlaybackRate(suggestedRate);
|
||||
this.trigger('ratechange');
|
||||
},
|
||||
|
||||
duration: function() {
|
||||
|
@ -559,24 +598,12 @@ THE SOFTWARE. */
|
|||
|
||||
buffered: function() {
|
||||
if(!this.ytPlayer || !this.ytPlayer.getVideoLoadedFraction) {
|
||||
return {
|
||||
length: 0,
|
||||
start: function() {
|
||||
throw new Error('This TimeRanges object is empty');
|
||||
},
|
||||
end: function() {
|
||||
throw new Error('This TimeRanges object is empty');
|
||||
}
|
||||
};
|
||||
return videojs.createTimeRange();
|
||||
}
|
||||
|
||||
var end = this.ytPlayer.getVideoLoadedFraction() * this.ytPlayer.getDuration();
|
||||
var bufferedEnd = this.ytPlayer.getVideoLoadedFraction() * this.ytPlayer.getDuration();
|
||||
|
||||
return {
|
||||
length: this.ytPlayer.getDuration(),
|
||||
start: function() { return 0; },
|
||||
end: function() { return end; }
|
||||
};
|
||||
return videojs.createTimeRange(0, bufferedEnd);
|
||||
},
|
||||
|
||||
// TODO: Can we really do something with this on YouTUbe?
|
||||
|
@ -626,8 +653,6 @@ THE SOFTWARE. */
|
|||
return (e === 'video/youtube');
|
||||
};
|
||||
|
||||
var _isOnMobile = videojs.browser.IS_IOS || useNativeControlsOnAndroid();
|
||||
|
||||
Youtube.parseUrl = function(url) {
|
||||
var result = {
|
||||
videoId: null
|
||||
|
@ -701,14 +726,6 @@ THE SOFTWARE. */
|
|||
head.appendChild(style);
|
||||
}
|
||||
|
||||
function useNativeControlsOnAndroid() {
|
||||
var stockRegex = window.navigator.userAgent.match(/applewebkit\/(\d*).*Version\/(\d*.\d*)/i);
|
||||
//True only Android Stock Browser on OS versions 4.X and below
|
||||
//where a Webkit version and a "Version/X.X" String can be found in
|
||||
//user agent.
|
||||
return videojs.browser.IS_ANDROID && videojs.browser.ANDROID_VERSION < 5 && stockRegex && stockRegex[2] > 0;
|
||||
}
|
||||
|
||||
Youtube.apiReadyQueue = [];
|
||||
|
||||
loadScript('https://www.youtube.com/iframe_api', apiLoaded);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMid meet">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<font id="VideoJS" horiz-adv-x="1792">
|
||||
<font-face font-family="VideoJS"
|
||||
|
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
@ -1,4 +1,4 @@
|
|||
VideoJS 5.12.6
|
||||
VideoJS 5.18.4
|
||||
--------------
|
||||
https://github.com/videojs/video.js
|
||||
|
||||
|
|
|
@ -402,6 +402,9 @@ body.vjs-full-window {
|
|||
.vjs-error .vjs-big-play-button {
|
||||
display: none; }
|
||||
|
||||
.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {
|
||||
display: block; }
|
||||
|
||||
.video-js button {
|
||||
background: none;
|
||||
border: none;
|
||||
|
@ -453,8 +456,8 @@ body.vjs-full-window {
|
|||
text-align: center;
|
||||
text-transform: lowercase; }
|
||||
|
||||
.vjs-menu li:focus,
|
||||
.vjs-menu li:hover {
|
||||
.vjs-menu li.vjs-menu-item:focus,
|
||||
.vjs-menu li.vjs-menu-item:hover {
|
||||
outline: 0;
|
||||
background-color: #73859f;
|
||||
background-color: rgba(115, 133, 159, 0.5); }
|
||||
|
@ -932,9 +935,6 @@ body.vjs-full-window {
|
|||
.vjs-audio.vjs-has-started .vjs-poster {
|
||||
display: block; }
|
||||
|
||||
.vjs-controls-disabled .vjs-poster {
|
||||
display: none; }
|
||||
|
||||
.vjs-using-native-controls .vjs-poster {
|
||||
display: none; }
|
||||
|
||||
|
|
|
@ -4,21 +4,21 @@
|
|||
<location>amd/src/video-lazy.js</location>
|
||||
<name>VideoJS</name>
|
||||
<license>Apache</license>
|
||||
<version>5.12.6</version>
|
||||
<version>5.18.4</version>
|
||||
<licenseversion></licenseversion>
|
||||
</library>
|
||||
<library>
|
||||
<location>amd/src/Youtube-lazy.js</location>
|
||||
<name>YouTube Playback Technology for Video.js</name>
|
||||
<license>MIT</license>
|
||||
<version>2.1.1</version>
|
||||
<version>2.3.2</version>
|
||||
<licenseversion></licenseversion>
|
||||
</library>
|
||||
<library>
|
||||
<location>videojs</location>
|
||||
<name>VideoJS support files</name>
|
||||
<license>Apache</license>
|
||||
<version>5.12.6</version>
|
||||
<version>5.18.4</version>
|
||||
<licenseversion></licenseversion>
|
||||
</library>
|
||||
</libraries>
|
||||
|
|
|
@ -18,9 +18,23 @@ videojs.addLanguage("ru",{
|
|||
"Captions": "Подписи",
|
||||
"captions off": "Подписи выкл.",
|
||||
"Chapters": "Главы",
|
||||
"Close Modal Dialog": "Закрыть модальное окно",
|
||||
"Descriptions": "Описания",
|
||||
"descriptions off": "описания выкл.",
|
||||
"Audio Track": "Звуковая дорожка",
|
||||
"You aborted the media playback": "Вы прервали воспроизведение видео",
|
||||
"A network error caused the media download to fail part-way.": "Ошибка сети вызвала сбой во время загрузки видео.",
|
||||
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Невозможно загрузить видео из-за сетевого или серверного сбоя либо формат не поддерживается.",
|
||||
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Воспроизведение видео было приостановлено из-за повреждения либо в связи с тем, что видео использует функции, неподдерживаемые вашим браузером.",
|
||||
"No compatible source was found for this media.": "Совместимые источники для этого видео отсутствуют."
|
||||
"No compatible source was found for this media.": "Совместимые источники для этого видео отсутствуют.",
|
||||
"The media is encrypted and we do not have the keys to decrypt it.": "Видео в зашифрованном виде, и у нас нет ключей для расшифровки.",
|
||||
"Play Video": "Воспроизвести видео",
|
||||
"Close": "Закрыть",
|
||||
"Modal Window": "Модальное окно",
|
||||
"This is a modal window": "Это модальное окно.",
|
||||
"This modal can be closed by pressing the Escape key or activating the close button.": "Модальное окно можно закрыть нажав Esc или кнопку закрытия окна.",
|
||||
", opens captions settings dialog": ", откроется диалог настройки подписей",
|
||||
", opens subtitles settings dialog": ", откроется диалог настройки субтитров",
|
||||
", opens descriptions settings dialog": ", откроется диалог настройки описаний",
|
||||
", selected": ", выбрано"
|
||||
});
|
|
@ -18,9 +18,23 @@ videojs.addLanguage("uk",{
|
|||
"Captions": "Підписи",
|
||||
"captions off": "Без підписів",
|
||||
"Chapters": "Розділи",
|
||||
"Close Modal Dialog": "Закрити модальний діалог",
|
||||
"Descriptions": "Описи",
|
||||
"descriptions off": "Без описів",
|
||||
"Audio Track": "Аудіодоріжка",
|
||||
"You aborted the media playback": "Ви припинили відтворення відео",
|
||||
"A network error caused the media download to fail part-way.": "Помилка мережі викликала збій під час завантаження відео.",
|
||||
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Неможливо завантажити відео через мережевий чи серверний збій або формат не підтримується.",
|
||||
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Відтворення відео було припинено через пошкодження або у зв'язку з тим, що відео використовує функції, які не підтримуються вашим браузером.",
|
||||
"No compatible source was found for this media.": "Сумісні джерела для цього відео відсутні."
|
||||
"No compatible source was found for this media.": "Сумісні джерела для цього відео відсутні.",
|
||||
"The media is encrypted and we do not have the keys to decrypt it.": "Відео в зашифрованому вигляді, і ми не маємо ключі для розшифровки.",
|
||||
"Play Video": "Відтворити відео",
|
||||
"Close": "Закрити",
|
||||
"Modal Window": "Модальне вікно",
|
||||
"This is a modal window": "Це модальне вікно.",
|
||||
"This modal can be closed by pressing the Escape key or activating the close button.": "Модальне вікно можна закрити, натиснувши клавішу Esc або кнопку закриття вікна.",
|
||||
", opens captions settings dialog": ", відкриється діалогове вікно налаштування підписів",
|
||||
", opens subtitles settings dialog": ", відкриється діалогове вікно налаштування субтитрів",
|
||||
", opens descriptions settings dialog": ", відкриється діалогове вікно налаштування описів",
|
||||
", selected": ", обраний"
|
||||
});
|
|
@ -18,10 +18,23 @@ videojs.addLanguage("zh-TW",{
|
|||
"Captions": "內嵌字幕",
|
||||
"captions off": "關閉內嵌字幕",
|
||||
"Chapters": "章節",
|
||||
"Close Modal Dialog": "關閉對話框",
|
||||
"Descriptions": "描述",
|
||||
"descriptions off": "關閉描述",
|
||||
"Audio Track": "音軌",
|
||||
"You aborted the media playback": "影片播放已終止",
|
||||
"A network error caused the media download to fail part-way.": "網路錯誤導致影片下載失敗。",
|
||||
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "影片因格式不支援或者伺服器或網路的問題無法載入。",
|
||||
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由於影片檔案損毀或是該影片使用了您的瀏覽器不支援的功能,播放終止。",
|
||||
"No compatible source was found for this media.": "無法找到相容此影片的來源。",
|
||||
"The media is encrypted and we do not have the keys to decrypt it.": "影片已加密,無法解密。"
|
||||
"The media is encrypted and we do not have the keys to decrypt it.": "影片已加密,無法解密。",
|
||||
"Play Video": "播放影片",
|
||||
"Close": "關閉",
|
||||
"Modal Window": "對話框",
|
||||
"This is a modal window": "這是一個對話框",
|
||||
"This modal can be closed by pressing the Escape key or activating the close button.": "可以按ESC按鍵或啟用關閉按鈕來關閉此對話框。",
|
||||
", opens captions settings dialog": ", 開啟標題設定對話框",
|
||||
", opens subtitles settings dialog": ", 開啟字幕設定對話框",
|
||||
", opens descriptions settings dialog": ", 開啟描述設定對話框",
|
||||
", selected": ", 選擇"
|
||||
});
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue