1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

We can add a skip intro button on video

This commit is contained in:
Daniel Neto 2024-05-15 09:33:59 -03:00
parent f712438ec1
commit f9c735b2bb
196 changed files with 6055 additions and 3586 deletions

178
node_modules/video.js/core.js generated vendored
View file

@ -1,6 +1,6 @@
/**
* @license
* Video.js 8.13.0 <http://videojs.com/>
* Video.js 8.14.0 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/main/LICENSE>
@ -28,7 +28,7 @@ var safeParseTuple__default = /*#__PURE__*/_interopDefaultLegacy(safeParseTuple)
var XHR__default = /*#__PURE__*/_interopDefaultLegacy(XHR);
var vtt__default = /*#__PURE__*/_interopDefaultLegacy(vtt);
var version = "8.13.0";
var version = "8.14.0";
/**
* An Object that contains lifecycle hooks as keys which point to an array
@ -1471,7 +1471,13 @@ function getPointerPosition(el, event) {
translated.x += values[12];
translated.y += values[13];
}
item = item.parentNode;
if (item.assignedSlot && item.assignedSlot.parentElement && window__default["default"].WebKitCSSMatrix) {
const transformValue = window__default["default"].getComputedStyle(item.assignedSlot.parentElement).transform;
const matrix = new window__default["default"].WebKitCSSMatrix(transformValue);
translated.x += matrix.m41;
translated.y += matrix.m42;
}
item = item.parentNode || item.host;
}
}
const position = {};
@ -1654,6 +1660,11 @@ function isSingleLeftClick(event) {
if (event.type === 'mouseup' && event.button === 0 && event.buttons === 0) {
return true;
}
// MacOS Sonoma trackpad when "tap to click enabled"
if (event.type === 'mousedown' && event.button === 0 && event.buttons === 0) {
return true;
}
if (event.button !== 0 || event.buttons !== 1) {
// This is the reason we have those if else block above
// if any special case we can catch and let it slide
@ -7340,75 +7351,18 @@ class Track extends EventTarget {
* @module url
*/
/**
* @typedef {Object} url:URLObject
*
* @property {string} protocol
* The protocol of the url that was parsed.
*
* @property {string} hostname
* The hostname of the url that was parsed.
*
* @property {string} port
* The port of the url that was parsed.
*
* @property {string} pathname
* The pathname of the url that was parsed.
*
* @property {string} search
* The search query of the url that was parsed.
*
* @property {string} hash
* The hash of the url that was parsed.
*
* @property {string} host
* The host of the url that was parsed.
*/
/**
* Resolve and parse the elements of a URL.
*
* @function
* @param {String} url
* @param {string} url
* The url to parse
*
* @return {url:URLObject}
* @return {URL}
* An object of url details
*/
const parseUrl = function (url) {
// This entire method can be replace with URL once we are able to drop IE11
const props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host'];
// add the url to an anchor and let the browser parse the URL
const a = document__default["default"].createElement('a');
a.href = url;
// Copy the specific URL properties to a new object
// This is also needed for IE because the anchor loses its
// properties when it's removed from the dom
const details = {};
for (let i = 0; i < props.length; i++) {
details[props[i]] = a[props[i]];
}
// IE adds the port to the host property unlike everyone else. If
// a port identifier is added for standard ports, strip it.
if (details.protocol === 'http:') {
details.host = details.host.replace(/:80$/, '');
}
if (details.protocol === 'https:') {
details.host = details.host.replace(/:443$/, '');
}
if (!details.protocol) {
details.protocol = window__default["default"].location.protocol;
}
/* istanbul ignore if */
if (!details.host) {
details.host = window__default["default"].location.host;
}
return details;
return new URL(url, document__default["default"].baseURI);
};
/**
@ -7420,18 +7374,9 @@ const parseUrl = function (url) {
*
* @return {string}
* Absolute URL
*
* @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
*/
const getAbsoluteURL = function (url) {
// Check if absolute URL
if (!url.match(/^https?:\/\//)) {
// Add the url to an anchor and let the browser parse it to convert to an absolute url
const a = document__default["default"].createElement('a');
a.href = url;
url = a.href;
}
return url;
return new URL(url, document__default["default"].baseURI).href;
};
/**
@ -7464,28 +7409,14 @@ const getFileExtension = function (path) {
* @param {string} url
* The url to check.
*
* @param {Object} [winLoc]
* @param {URL} [winLoc]
* the domain to check the url against, defaults to window.location
*
* @param {string} [winLoc.protocol]
* The window location protocol defaults to window.location.protocol
*
* @param {string} [winLoc.host]
* The window location host defaults to window.location.host
*
* @return {boolean}
* Whether it is a cross domain request or not.
*/
const isCrossOrigin = function (url, winLoc = window__default["default"].location) {
const urlInfo = parseUrl(url);
// IE8 protocol relative urls will return ':' for protocol
const srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol;
// Check if url is for another domain/origin
// IE8 doesn't know location.origin, so we won't rely on it here
const crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;
return crossOrigin;
return parseUrl(url).origin !== winLoc.origin;
};
var Url = /*#__PURE__*/Object.freeze({
@ -13391,7 +13322,8 @@ class SeekBar extends Slider {
setEventHandlers_() {
this.update_ = bind_(this, this.update);
this.update = throttle(this.update_, UPDATE_REFRESH_INTERVAL);
this.on(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);
this.on(this.player_, ['durationchange', 'timeupdate'], this.update);
this.on(this.player_, ['ended'], this.update_);
if (this.player_.liveTracker) {
this.on(this.player_.liveTracker, 'liveedgechange', this.update);
}
@ -13773,7 +13705,8 @@ class SeekBar extends Slider {
}
dispose() {
this.disableInterval_();
this.off(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);
this.off(this.player_, ['durationchange', 'timeupdate'], this.update);
this.off(this.player_, ['ended'], this.update_);
if (this.player_.liveTracker) {
this.off(this.player_.liveTracker, 'liveedgechange', this.update);
}
@ -18121,19 +18054,19 @@ const selectConfigs = {
},
edgeStyle: {
selector: '.vjs-edge-style > select',
id: '%s',
id: '',
label: 'Text Edge Style',
options: [['none', 'None'], ['raised', 'Raised'], ['depressed', 'Depressed'], ['uniform', 'Uniform'], ['dropshadow', 'Drop shadow']]
},
fontFamily: {
selector: '.vjs-font-family > select',
id: 'captions-font-family-%s',
id: '',
label: 'Font Family',
options: [['proportionalSansSerif', 'Proportional Sans-Serif'], ['monospaceSansSerif', 'Monospace Sans-Serif'], ['proportionalSerif', 'Proportional Serif'], ['monospaceSerif', 'Monospace Serif'], ['casual', 'Casual'], ['script', 'Script'], ['small-caps', 'Small Caps']]
},
fontPercent: {
selector: '.vjs-font-percent > select',
id: 'captions-font-size-%s',
id: '',
label: 'Font Size',
options: [['0.50', '50%'], ['0.75', '75%'], ['1.00', '100%'], ['1.25', '125%'], ['1.50', '150%'], ['1.75', '175%'], ['2.00', '200%'], ['3.00', '300%'], ['4.00', '400%']],
default: 2,
@ -21491,6 +21424,7 @@ class Player extends Component {
this.boundHandleTechTouchMove_ = e => this.handleTechTouchMove_(e);
this.boundHandleTechTouchEnd_ = e => this.handleTechTouchEnd_(e);
this.boundHandleTechTap_ = e => this.handleTechTap_(e);
this.boundUpdatePlayerHeightOnAudioOnlyMode_ = e => this.updatePlayerHeightOnAudioOnlyMode_(e);
// default isFullscreen_ to false
this.isFullscreen_ = false;
@ -21528,6 +21462,7 @@ class Player extends Component {
// Init state audioOnlyCache_
this.audioOnlyCache_ = {
controlBarHeight: null,
playerHeight: null,
hiddenChildren: []
};
@ -25358,6 +25293,14 @@ class Player extends Component {
}
return !!this.isAudio_;
}
updatePlayerHeightOnAudioOnlyMode_() {
const controlBar = this.getChild('ControlBar');
if (!controlBar || this.audioOnlyCache_.controlBarHeight === controlBar.currentHeight()) {
return;
}
this.audioOnlyCache_.controlBarHeight = controlBar.currentHeight();
this.height(this.audioOnlyCache_.controlBarHeight);
}
enableAudioOnlyUI_() {
// Update styling immediately to show the control bar so we can get its height
this.addClass('vjs-audio-only-mode');
@ -25377,6 +25320,8 @@ class Player extends Component {
}
});
this.audioOnlyCache_.playerHeight = this.currentHeight();
this.audioOnlyCache_.controlBarHeight = controlBarHeight;
this.on('playerresize', this.boundUpdatePlayerHeightOnAudioOnlyMode_);
// Set the player height the same as the control bar
this.height(controlBarHeight);
@ -25384,6 +25329,7 @@ class Player extends Component {
}
disableAudioOnlyUI_() {
this.removeClass('vjs-audio-only-mode');
this.off('playerresize', this.boundUpdatePlayerHeightOnAudioOnlyMode_);
// Show player components that were previously hidden
this.audioOnlyCache_.hiddenChildren.forEach(child => child.show());
@ -26861,34 +26807,20 @@ function deprecateForMajor(major, oldName, newName, fn) {
}
var VjsErrors = {
UnsupportedSidxContainer: 'unsupported-sidx-container-error',
DashManifestSidxParsingError: 'dash-manifest-sidx-parsing-error',
HlsPlaylistRequestError: 'hls-playlist-request-error',
SegmentUnsupportedMediaFormat: 'segment-unsupported-media-format-error',
UnsupportedMediaInitialization: 'unsupported-media-initialization-error',
SegmentSwitchError: 'segment-switch-error',
SegmentExceedsSourceBufferQuota: 'segment-exceeds-source-buffer-quota-error',
SegmentAppendError: 'segment-append-error',
VttLoadError: 'vtt-load-error',
VttCueParsingError: 'vtt-cue-parsing-error',
// Errors used in contrib-ads:
AdsBeforePrerollError: 'ads-before-preroll-error',
AdsPrerollError: 'ads-preroll-error',
AdsMidrollError: 'ads-midroll-error',
AdsPostrollError: 'ads-postroll-error',
AdsMacroReplacementFailed: 'ads-macro-replacement-failed',
AdsResumeContentFailed: 'ads-resume-content-failed',
// Errors used in contrib-eme:
EMEFailedToRequestMediaKeySystemAccess: 'eme-failed-request-media-key-system-access',
EMEFailedToCreateMediaKeys: 'eme-failed-create-media-keys',
EMEFailedToAttachMediaKeysToVideoElement: 'eme-failed-attach-media-keys-to-video',
EMEFailedToCreateMediaKeySession: 'eme-failed-create-media-key-session',
EMEFailedToSetServerCertificate: 'eme-failed-set-server-certificate',
EMEFailedToGenerateLicenseRequest: 'eme-failed-generate-license-request',
EMEFailedToUpdateSessionWithReceivedLicenseKeys: 'eme-failed-update-session',
EMEFailedToCloseSession: 'eme-failed-close-session',
EMEFailedToRemoveKeysFromSession: 'eme-failed-remove-keys',
EMEFailedToLoadSessionBySessionId: 'eme-failed-load-session'
NetworkBadStatus: 'networkbadstatus',
NetworkRequestFailed: 'networkrequestfailed',
NetworkRequestAborted: 'networkrequestaborted',
NetworkRequestTimeout: 'networkrequesttimeout',
NetworkBodyParserFailed: 'networkbodyparserfailed',
StreamingHlsPlaylistParserError: 'streaminghlsplaylistparsererror',
StreamingDashManifestParserError: 'streamingdashmanifestparsererror',
StreamingContentSteeringParserError: 'streamingcontentsteeringparsererror',
StreamingVttParserError: 'streamingvttparsererror',
StreamingFailedToSelectNextSegment: 'streamingfailedtoselectnextsegment',
StreamingFailedToDecryptSegment: 'streamingfailedtodecryptsegment',
StreamingFailedToTransmuxSegment: 'streamingfailedtotransmuxsegment',
StreamingFailedToAppendSegment: 'streamingfailedtoappendsegment',
StreamingCodecsChangeError: 'streamingcodecschangeerror'
};
/**
@ -27017,7 +26949,7 @@ function videojs(id, options, ready) {
// Store a copy of the el before modification, if it is to be restored in destroy()
// If div ingest, store the parent div
if (options.restoreEl === true) {
options.restoreEl = (el.parentNode && el.parentNode.hasAttribute('data-vjs-player') ? el.parentNode : el).cloneNode(true);
options.restoreEl = (el.parentNode && el.parentNode.hasAttribute && el.parentNode.hasAttribute('data-vjs-player') ? el.parentNode : el).cloneNode(true);
}
hooks('beforesetup').forEach(hookFunction => {
const opts = hookFunction(el, merge(options));