2020-07-16 22:17:05 +03:00
|
|
|
// https://docs.videojs.com/player
|
|
|
|
|
2021-10-21 21:23:41 +03:00
|
|
|
import videojs from '/js/web_modules/videojs/dist/video.min.js';
|
2020-10-06 23:46:07 +03:00
|
|
|
import { getLocalStorage, setLocalStorage } from '../utils/helpers.js';
|
2021-01-05 09:30:18 +03:00
|
|
|
import { PLAYER_VOLUME, URL_STREAM } from '../utils/constants.js';
|
2022-03-17 03:34:44 +03:00
|
|
|
import PlaybackMetrics from '../metrics/playback.js';
|
2022-03-17 09:34:17 +03:00
|
|
|
import LatencyCompensator from './latencyCompensator.js';
|
2020-10-05 04:43:31 +03:00
|
|
|
|
2020-08-06 20:55:33 +03:00
|
|
|
const VIDEO_ID = 'video';
|
2022-04-07 04:32:50 +03:00
|
|
|
const LATENCY_COMPENSATION_ENABLED = 'latencyCompensatorEnabled';
|
2020-08-06 20:55:33 +03:00
|
|
|
|
|
|
|
// Video setup
|
|
|
|
const VIDEO_SRC = {
|
|
|
|
src: URL_STREAM,
|
|
|
|
type: 'application/x-mpegURL',
|
|
|
|
};
|
|
|
|
const VIDEO_OPTIONS = {
|
|
|
|
autoplay: false,
|
2020-09-22 00:28:12 +03:00
|
|
|
liveui: true,
|
2020-08-06 20:55:33 +03:00
|
|
|
preload: 'auto',
|
2020-09-22 00:28:12 +03:00
|
|
|
controlBar: {
|
|
|
|
progressControl: {
|
|
|
|
seekBar: false,
|
|
|
|
},
|
|
|
|
},
|
2020-08-06 20:55:33 +03:00
|
|
|
html5: {
|
|
|
|
vhs: {
|
|
|
|
// used to select the lowest bitrate playlist initially. This helps to decrease playback start time. This setting is false by default.
|
|
|
|
enableLowInitialPlaylist: true,
|
2021-05-20 03:39:12 +03:00
|
|
|
experimentalBufferBasedABR: true,
|
2022-04-12 07:20:38 +03:00
|
|
|
useNetworkInformationApi: true,
|
2022-01-28 01:25:48 +03:00
|
|
|
maxPlaylistRetries: 30,
|
2020-09-22 00:28:12 +03:00
|
|
|
},
|
2020-08-06 20:55:33 +03:00
|
|
|
},
|
|
|
|
liveTracker: {
|
|
|
|
trackingThreshold: 0,
|
2022-04-07 04:32:50 +03:00
|
|
|
liveTolerance: 15,
|
2020-08-06 20:55:33 +03:00
|
|
|
},
|
|
|
|
sources: [VIDEO_SRC],
|
|
|
|
};
|
|
|
|
|
2020-08-21 01:51:11 +03:00
|
|
|
export const POSTER_DEFAULT = `/img/logo.png`;
|
|
|
|
export const POSTER_THUMB = `/thumbnail.jpg`;
|
2020-08-06 20:55:33 +03:00
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
class OwncastPlayer {
|
|
|
|
constructor() {
|
|
|
|
window.VIDEOJS_NO_DYNAMIC_STYLE = true; // style override
|
|
|
|
|
|
|
|
this.vjsPlayer = null;
|
2022-03-17 03:34:44 +03:00
|
|
|
this.latencyCompensator = null;
|
2022-03-30 03:33:32 +03:00
|
|
|
this.playbackMetrics = null;
|
2020-07-16 22:17:05 +03:00
|
|
|
|
|
|
|
this.appPlayerReadyCallback = null;
|
|
|
|
this.appPlayerPlayingCallback = null;
|
|
|
|
this.appPlayerEndedCallback = null;
|
2022-04-06 02:48:18 +03:00
|
|
|
|
2022-03-26 00:21:07 +03:00
|
|
|
this.hasStartedPlayback = false;
|
2022-04-06 02:48:18 +03:00
|
|
|
this.latencyCompensatorEnabled = false;
|
2020-07-16 22:17:05 +03:00
|
|
|
|
|
|
|
// bind all the things because safari
|
|
|
|
this.startPlayer = this.startPlayer.bind(this);
|
|
|
|
this.handleReady = this.handleReady.bind(this);
|
|
|
|
this.handlePlaying = this.handlePlaying.bind(this);
|
2020-10-06 22:53:08 +03:00
|
|
|
this.handleVolume = this.handleVolume.bind(this);
|
2020-07-16 22:17:05 +03:00
|
|
|
this.handleEnded = this.handleEnded.bind(this);
|
|
|
|
this.handleError = this.handleError.bind(this);
|
2022-04-06 02:48:18 +03:00
|
|
|
this.addQualitySelector = this.addVideoSettingsMenu.bind(this);
|
|
|
|
this.addQualitySelector = this.addVideoSettingsMenu.bind(this);
|
|
|
|
this.toggleLatencyCompensator = this.toggleLatencyCompensator.bind(this);
|
|
|
|
this.startLatencyCompensator = this.startLatencyCompensator.bind(this);
|
|
|
|
this.stopLatencyCompensator = this.stopLatencyCompensator.bind(this);
|
2021-03-11 23:51:43 +03:00
|
|
|
this.qualitySelectionMenu = null;
|
2022-04-06 02:48:18 +03:00
|
|
|
this.latencyCompensatorToggleButton = null;
|
2020-07-16 22:17:05 +03:00
|
|
|
}
|
2020-07-23 05:52:53 +03:00
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
init() {
|
2021-03-11 23:51:43 +03:00
|
|
|
this.addAirplay();
|
2022-04-06 02:48:18 +03:00
|
|
|
this.addVideoSettingsMenu();
|
2021-03-11 23:51:43 +03:00
|
|
|
|
2022-03-17 03:34:44 +03:00
|
|
|
// Add a cachebuster param to playlist URLs.
|
2021-03-11 23:51:43 +03:00
|
|
|
videojs.Vhs.xhr.beforeRequest = (options) => {
|
2021-01-02 22:30:29 +03:00
|
|
|
if (options.uri.match('m3u8')) {
|
2022-03-11 23:22:50 +03:00
|
|
|
const cachebuster = Math.random().toString(16).substr(2, 8);
|
2021-01-02 22:30:29 +03:00
|
|
|
options.uri = `${options.uri}?cachebust=${cachebuster}`;
|
|
|
|
}
|
2022-03-17 03:34:44 +03:00
|
|
|
|
2020-07-23 05:52:53 +03:00
|
|
|
return options;
|
|
|
|
};
|
|
|
|
|
2021-01-02 22:30:29 +03:00
|
|
|
this.vjsPlayer = videojs(VIDEO_ID, VIDEO_OPTIONS);
|
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
this.vjsPlayer.ready(this.handleReady);
|
|
|
|
}
|
|
|
|
|
|
|
|
setupPlayerCallbacks(callbacks) {
|
|
|
|
const { onReady, onPlaying, onEnded, onError } = callbacks;
|
|
|
|
|
|
|
|
this.appPlayerReadyCallback = onReady;
|
|
|
|
this.appPlayerPlayingCallback = onPlaying;
|
|
|
|
this.appPlayerEndedCallback = onEnded;
|
|
|
|
this.appPlayerErrorCallback = onError;
|
|
|
|
}
|
|
|
|
|
|
|
|
// play
|
|
|
|
startPlayer() {
|
|
|
|
this.log('Start playing');
|
2020-10-05 04:43:31 +03:00
|
|
|
const source = { ...VIDEO_SRC };
|
2020-10-06 23:03:15 +03:00
|
|
|
|
2021-09-18 00:04:09 +03:00
|
|
|
try {
|
|
|
|
this.vjsPlayer.volume(getLocalStorage(PLAYER_VOLUME) || 1);
|
|
|
|
} catch (err) {
|
|
|
|
console.warn(err);
|
|
|
|
}
|
2020-07-17 05:54:12 +03:00
|
|
|
this.vjsPlayer.src(source);
|
2022-03-30 03:33:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
setupPlaybackMetrics() {
|
|
|
|
this.playbackMetrics = new PlaybackMetrics(this.vjsPlayer, videojs);
|
|
|
|
}
|
|
|
|
|
2022-04-07 04:32:50 +03:00
|
|
|
setupLatencyCompensator() {
|
|
|
|
const tech = this.vjsPlayer.tech({ IWillNotUseThisInPlugins: true });
|
|
|
|
|
|
|
|
// VHS is required.
|
|
|
|
if (!tech || !tech.vhs) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const latencyCompensatorEnabledSaved = getLocalStorage(
|
|
|
|
LATENCY_COMPENSATION_ENABLED
|
|
|
|
);
|
|
|
|
|
|
|
|
if (latencyCompensatorEnabledSaved === 'true' && tech && tech.vhs) {
|
|
|
|
this.startLatencyCompensator();
|
|
|
|
} else {
|
|
|
|
this.stopLatencyCompensator();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-06 02:48:18 +03:00
|
|
|
startLatencyCompensator() {
|
2022-03-30 03:33:32 +03:00
|
|
|
this.latencyCompensator = new LatencyCompensator(this.vjsPlayer);
|
2022-04-06 02:48:18 +03:00
|
|
|
this.latencyCompensator.enable();
|
|
|
|
this.latencyCompensatorEnabled = true;
|
2022-04-07 04:32:50 +03:00
|
|
|
this.setLatencyCompensatorItemTitle('disable minimized latency');
|
2022-04-06 02:48:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
stopLatencyCompensator() {
|
|
|
|
if (this.latencyCompensator) {
|
|
|
|
this.latencyCompensator.disable();
|
|
|
|
}
|
|
|
|
this.LatencyCompensator = null;
|
|
|
|
this.latencyCompensatorEnabled = false;
|
|
|
|
this.setLatencyCompensatorItemTitle(
|
2022-04-09 09:14:10 +03:00
|
|
|
'<span style="font-size: 0.8em">enable minimized latency (experimental)</span>'
|
2022-04-06 02:48:18 +03:00
|
|
|
);
|
2020-10-05 04:43:31 +03:00
|
|
|
}
|
2020-07-16 22:17:05 +03:00
|
|
|
|
|
|
|
handleReady() {
|
2022-03-30 03:33:32 +03:00
|
|
|
console.log('handleReady');
|
2020-07-16 22:17:05 +03:00
|
|
|
this.vjsPlayer.on('error', this.handleError);
|
|
|
|
this.vjsPlayer.on('playing', this.handlePlaying);
|
2020-10-06 22:53:08 +03:00
|
|
|
this.vjsPlayer.on('volumechange', this.handleVolume);
|
2020-07-16 22:17:05 +03:00
|
|
|
this.vjsPlayer.on('ended', this.handleEnded);
|
|
|
|
|
2022-03-30 03:33:32 +03:00
|
|
|
this.vjsPlayer.on('loadeddata', () => {
|
|
|
|
this.setupPlaybackMetrics();
|
2022-04-07 04:32:50 +03:00
|
|
|
this.setupLatencyCompensator();
|
2022-03-17 03:34:44 +03:00
|
|
|
});
|
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
if (this.appPlayerReadyCallback) {
|
|
|
|
// start polling
|
|
|
|
this.appPlayerReadyCallback();
|
|
|
|
}
|
2022-03-17 03:34:44 +03:00
|
|
|
|
|
|
|
this.vjsPlayer.log.level('debug');
|
2020-07-16 22:17:05 +03:00
|
|
|
}
|
|
|
|
|
2020-10-06 23:51:30 +03:00
|
|
|
handleVolume() {
|
2021-03-11 23:51:43 +03:00
|
|
|
setLocalStorage(
|
|
|
|
PLAYER_VOLUME,
|
|
|
|
this.vjsPlayer.muted() ? 0 : this.vjsPlayer.volume()
|
|
|
|
);
|
2020-10-06 22:53:08 +03:00
|
|
|
}
|
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
handlePlaying() {
|
|
|
|
if (this.appPlayerPlayingCallback) {
|
|
|
|
// start polling
|
|
|
|
this.appPlayerPlayingCallback();
|
|
|
|
}
|
2022-03-17 03:34:44 +03:00
|
|
|
|
2022-03-27 04:34:57 +03:00
|
|
|
if (this.latencyCompensator && !this.hasStartedPlayback) {
|
2022-03-26 00:21:07 +03:00
|
|
|
this.latencyCompensator.enable();
|
|
|
|
}
|
2022-03-19 23:17:37 +03:00
|
|
|
|
2022-03-27 04:34:57 +03:00
|
|
|
this.hasStartedPlayback = true;
|
2022-03-19 23:17:37 +03:00
|
|
|
}
|
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
handleEnded() {
|
|
|
|
if (this.appPlayerEndedCallback) {
|
|
|
|
this.appPlayerEndedCallback();
|
|
|
|
}
|
2022-03-27 04:34:57 +03:00
|
|
|
|
2022-04-06 02:48:18 +03:00
|
|
|
this.stopLatencyCompensator();
|
2020-07-16 22:17:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
handleError(e) {
|
|
|
|
this.log(`on Error: ${JSON.stringify(e)}`);
|
|
|
|
if (this.appPlayerEndedCallback) {
|
|
|
|
this.appPlayerEndedCallback();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-06 02:48:18 +03:00
|
|
|
toggleLatencyCompensator() {
|
|
|
|
if (this.latencyCompensatorEnabled) {
|
|
|
|
this.stopLatencyCompensator();
|
2022-04-07 04:32:50 +03:00
|
|
|
setLocalStorage(LATENCY_COMPENSATION_ENABLED, false);
|
2022-04-06 02:48:18 +03:00
|
|
|
} else {
|
|
|
|
this.startLatencyCompensator();
|
2022-04-07 04:32:50 +03:00
|
|
|
setLocalStorage(LATENCY_COMPENSATION_ENABLED, true);
|
2022-04-06 02:48:18 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setLatencyCompensatorItemTitle(title) {
|
|
|
|
const item = document.querySelector(
|
|
|
|
'.latency-toggle-item > .vjs-menu-item-text'
|
|
|
|
);
|
2022-04-07 04:32:50 +03:00
|
|
|
if (!item) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-04-06 02:48:18 +03:00
|
|
|
item.innerHTML = title;
|
|
|
|
}
|
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
log(message) {
|
2020-09-24 04:18:15 +03:00
|
|
|
// console.log(`>>> Player: ${message}`);
|
2020-07-16 22:17:05 +03:00
|
|
|
}
|
|
|
|
|
2022-04-06 02:48:18 +03:00
|
|
|
async addVideoSettingsMenu() {
|
2021-03-11 23:51:43 +03:00
|
|
|
if (this.qualityMenuButton) {
|
2021-03-11 23:52:18 +03:00
|
|
|
player.controlBar.removeChild(this.qualityMenuButton);
|
2021-03-11 23:51:43 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
videojs.hookOnce(
|
|
|
|
'setup',
|
|
|
|
async function (player) {
|
|
|
|
var qualities = [];
|
2021-03-11 23:52:18 +03:00
|
|
|
|
2021-03-11 23:51:43 +03:00
|
|
|
try {
|
2021-03-11 23:52:18 +03:00
|
|
|
const response = await fetch('/api/video/variants');
|
2021-03-11 23:51:43 +03:00
|
|
|
qualities = await response.json();
|
2021-03-11 23:52:18 +03:00
|
|
|
} catch (e) {
|
2021-07-20 05:22:29 +03:00
|
|
|
console.error(e);
|
2021-03-11 23:51:43 +03:00
|
|
|
}
|
2021-03-11 23:52:18 +03:00
|
|
|
|
2021-03-11 23:51:43 +03:00
|
|
|
var MenuItem = videojs.getComponent('MenuItem');
|
|
|
|
var MenuButtonClass = videojs.getComponent('MenuButton');
|
2022-04-06 02:48:18 +03:00
|
|
|
|
|
|
|
const lowLatencyItem = new MenuItem(player, {
|
|
|
|
selectable: true,
|
|
|
|
});
|
|
|
|
lowLatencyItem.setAttribute('class', 'latency-toggle-item');
|
|
|
|
lowLatencyItem.on('click', () => {
|
|
|
|
this.toggleLatencyCompensator();
|
|
|
|
});
|
|
|
|
this.latencyCompensatorToggleButton = lowLatencyItem;
|
|
|
|
|
2022-04-07 04:32:50 +03:00
|
|
|
const separator = new MenuSeparator(player, {
|
|
|
|
selectable: false,
|
|
|
|
});
|
|
|
|
|
2021-03-11 23:51:43 +03:00
|
|
|
var MenuButton = videojs.extend(MenuButtonClass, {
|
|
|
|
// The `init()` method will also work for constructor logic here, but it is
|
|
|
|
// deprecated. If you provide an `init()` method, it will override the
|
|
|
|
// `constructor()` method!
|
|
|
|
constructor: function () {
|
|
|
|
MenuButtonClass.call(this, player);
|
|
|
|
},
|
|
|
|
|
|
|
|
createItems: function () {
|
2022-04-06 02:48:18 +03:00
|
|
|
const tech = this.player_.tech({ IWillNotUseThisInPlugins: true });
|
|
|
|
|
2021-03-11 23:51:43 +03:00
|
|
|
const defaultAutoItem = new MenuItem(player, {
|
|
|
|
selectable: true,
|
|
|
|
label: 'Auto',
|
|
|
|
});
|
|
|
|
|
|
|
|
const items = qualities.map(function (item) {
|
|
|
|
var newMenuItem = new MenuItem(player, {
|
|
|
|
selectable: true,
|
|
|
|
label: item.name,
|
|
|
|
});
|
|
|
|
|
|
|
|
// Quality selected
|
|
|
|
newMenuItem.on('click', function () {
|
2022-04-22 20:49:13 +03:00
|
|
|
// If for some reason tech doesn't exist, then don't do anything
|
|
|
|
if (!tech) {
|
|
|
|
console.warn('Invalid attempt to access null player tech');
|
|
|
|
return;
|
|
|
|
}
|
2021-03-11 23:51:43 +03:00
|
|
|
// Only enable this single, selected representation.
|
2022-04-06 02:48:18 +03:00
|
|
|
tech.vhs.representations().forEach(function (rep, index) {
|
|
|
|
rep.enabled(index === item.index);
|
|
|
|
});
|
2021-03-11 23:52:18 +03:00
|
|
|
newMenuItem.selected(false);
|
2021-03-11 23:51:43 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
return newMenuItem;
|
|
|
|
});
|
|
|
|
|
|
|
|
defaultAutoItem.on('click', function () {
|
|
|
|
// Re-enable all representations.
|
2022-04-06 02:48:18 +03:00
|
|
|
tech.vhs.representations().forEach(function (rep, index) {
|
|
|
|
rep.enabled(true);
|
|
|
|
});
|
2021-03-11 23:52:18 +03:00
|
|
|
defaultAutoItem.selected(false);
|
2021-03-11 23:51:43 +03:00
|
|
|
});
|
|
|
|
|
2022-04-07 04:32:50 +03:00
|
|
|
const supportsLatencyCompensator = !!tech && !!tech.vhs;
|
2022-04-06 02:48:18 +03:00
|
|
|
|
|
|
|
// Only show the quality selector if there is more than one option.
|
|
|
|
if (qualities.length < 2 && supportsLatencyCompensator) {
|
|
|
|
return [lowLatencyItem];
|
2022-04-07 04:32:50 +03:00
|
|
|
} else if (qualities.length > 1 && supportsLatencyCompensator) {
|
|
|
|
return [defaultAutoItem, ...items, separator, lowLatencyItem];
|
|
|
|
} else if (!supportsLatencyCompensator && qualities.length == 1) {
|
|
|
|
return [];
|
2022-04-06 02:48:18 +03:00
|
|
|
}
|
|
|
|
|
2021-03-11 23:51:43 +03:00
|
|
|
return [defaultAutoItem, ...items];
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-04-06 02:48:18 +03:00
|
|
|
// If none of the settings in this menu are applicable then don't show it.
|
|
|
|
const tech = player.tech({ IWillNotUseThisInPlugins: true });
|
|
|
|
|
|
|
|
if (qualities.length < 2 && (!tech || !tech.vhs)) {
|
2021-03-18 07:30:43 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-03-11 23:51:43 +03:00
|
|
|
var menuButton = new MenuButton();
|
|
|
|
menuButton.addClass('vjs-quality-selector');
|
2021-03-11 23:52:18 +03:00
|
|
|
player.controlBar.addChild(
|
|
|
|
menuButton,
|
|
|
|
{},
|
|
|
|
player.controlBar.children_.length - 2
|
|
|
|
);
|
2021-03-11 23:51:43 +03:00
|
|
|
this.qualityMenuButton = menuButton;
|
2022-04-06 02:48:18 +03:00
|
|
|
this.latencyCompensatorToggleButton = lowLatencyItem;
|
2021-03-11 23:51:43 +03:00
|
|
|
}.bind(this)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
addAirplay() {
|
|
|
|
videojs.hookOnce('setup', function (player) {
|
|
|
|
if (window.WebKitPlaybackTargetAvailabilityEvent) {
|
|
|
|
var videoJsButtonClass = videojs.getComponent('Button');
|
|
|
|
var concreteButtonClass = videojs.extend(videoJsButtonClass, {
|
2020-08-21 01:29:15 +03:00
|
|
|
// The `init()` method will also work for constructor logic here, but it is
|
2020-07-16 22:17:05 +03:00
|
|
|
// deprecated. If you provide an `init()` method, it will override the
|
|
|
|
// `constructor()` method!
|
|
|
|
constructor: function () {
|
|
|
|
videoJsButtonClass.call(this, player);
|
2020-08-21 01:29:15 +03:00
|
|
|
},
|
|
|
|
|
2020-07-16 22:17:05 +03:00
|
|
|
handleClick: function () {
|
|
|
|
const videoElement = document.getElementsByTagName('video')[0];
|
|
|
|
videoElement.webkitShowPlaybackTargetPicker();
|
2020-08-21 01:29:15 +03:00
|
|
|
},
|
2020-07-16 22:17:05 +03:00
|
|
|
});
|
2020-08-21 01:29:15 +03:00
|
|
|
|
2021-03-14 06:47:03 +03:00
|
|
|
var concreteButtonInstance = player.controlBar.addChild(
|
2020-10-05 04:43:31 +03:00
|
|
|
new concreteButtonClass()
|
|
|
|
);
|
|
|
|
concreteButtonInstance.addClass('vjs-airplay');
|
2020-07-16 22:17:05 +03:00
|
|
|
}
|
2020-08-21 01:29:15 +03:00
|
|
|
});
|
2020-07-16 22:17:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-21 01:29:15 +03:00
|
|
|
export { OwncastPlayer };
|
2022-04-06 02:48:18 +03:00
|
|
|
|
|
|
|
const VjsMenuItem = videojs.getComponent('MenuItem');
|
|
|
|
|
|
|
|
export default class MenuSeparator extends VjsMenuItem {
|
|
|
|
constructor(player, options) {
|
|
|
|
super(player, options);
|
|
|
|
}
|
|
|
|
|
|
|
|
createEl(tag = 'button', props = {}, attributes = {}) {
|
|
|
|
let el = super.createEl(tag, props, attributes);
|
|
|
|
el.innerHTML =
|
|
|
|
'<hr style="opacity: 0.3; margin-left: 10px; margin-right: 10px;" />';
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VjsMenuItem.registerComponent('MenuSeparator', MenuSeparator);
|