|
|
|
@ -151,6 +151,7 @@ player.vttThumbnails({
|
|
|
|
|
|
|
|
|
|
// Enable annotations
|
|
|
|
|
if (!video_data.params.listen && video_data.params.annotations) {
|
|
|
|
|
window.addEventListener('load', function (e) {
|
|
|
|
|
var video_container = document.getElementById('player');
|
|
|
|
|
let xhr = new XMLHttpRequest();
|
|
|
|
|
xhr.responseType = 'text';
|
|
|
|
@ -190,6 +191,7 @@ if (!video_data.params.listen && video_data.params.annotations) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
xhr.send();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function increase_volume(delta) {
|
|
|
|
@ -234,25 +236,25 @@ function toggle_play() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const toggle_captions = (function() {
|
|
|
|
|
const toggle_captions = (function () {
|
|
|
|
|
let toggledTrack = null;
|
|
|
|
|
const onChange = function(e) {
|
|
|
|
|
const onChange = function (e) {
|
|
|
|
|
toggledTrack = null;
|
|
|
|
|
};
|
|
|
|
|
const bindChange = function(onOrOff) {
|
|
|
|
|
const bindChange = function (onOrOff) {
|
|
|
|
|
player.textTracks()[onOrOff]('change', onChange);
|
|
|
|
|
};
|
|
|
|
|
// Wrapper function to ignore our own emitted events and only listen
|
|
|
|
|
// to events emitted by Video.js on click on the captions menu items.
|
|
|
|
|
const setMode = function(track, mode) {
|
|
|
|
|
const setMode = function (track, mode) {
|
|
|
|
|
bindChange('off');
|
|
|
|
|
track.mode = mode;
|
|
|
|
|
window.setTimeout(function() {
|
|
|
|
|
window.setTimeout(function () {
|
|
|
|
|
bindChange('on');
|
|
|
|
|
}, 0);
|
|
|
|
|
};
|
|
|
|
|
bindChange('on');
|
|
|
|
|
return function() {
|
|
|
|
|
return function () {
|
|
|
|
|
if (toggledTrack !== null) {
|
|
|
|
|
if (toggledTrack.mode !== 'showing') {
|
|
|
|
|
setMode(toggledTrack, 'showing');
|
|
|
|
@ -422,7 +424,7 @@ window.addEventListener('keydown', e => {
|
|
|
|
|
|
|
|
|
|
// Add support for controlling the player volume by scrolling over it. Adapted from
|
|
|
|
|
// https://github.com/ctd1500/videojs-hotkeys/blob/bb4a158b2e214ccab87c2e7b95f42bc45c6bfd87/videojs.hotkeys.js#L292-L328
|
|
|
|
|
(function() {
|
|
|
|
|
(function () {
|
|
|
|
|
const volumeStep = 0.05;
|
|
|
|
|
const enableVolumeScroll = true;
|
|
|
|
|
const enableHoverScroll = true;
|
|
|
|
@ -432,8 +434,8 @@ window.addEventListener('keydown', e => {
|
|
|
|
|
var volumeHover = false;
|
|
|
|
|
var volumeSelector = pEl.querySelector('.vjs-volume-menu-button') || pEl.querySelector('.vjs-volume-panel');
|
|
|
|
|
if (volumeSelector != null) {
|
|
|
|
|
volumeSelector.onmouseover = function() { volumeHover = true; };
|
|
|
|
|
volumeSelector.onmouseout = function() { volumeHover = false; };
|
|
|
|
|
volumeSelector.onmouseover = function () { volumeHover = true; };
|
|
|
|
|
volumeSelector.onmouseout = function () { volumeHover = false; };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var mouseScroll = function mouseScroll(event) {
|
|
|
|
|