@gcorevideo/player 2.19.7 → 2.19.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +7 -9
- package/dist/index.css +417 -417
- package/dist/index.js +94 -54
- package/dist/player.d.ts +109 -55
- package/dist/plugins/index.css +1529 -1529
- package/dist/plugins/index.js +86 -42
- package/docs/api/player.bigmutebutton.md +0 -14
- package/docs/api/player.levelselector.md +1 -1
- package/docs/api/player.md +24 -9
- package/docs/api/player.mediacontrol._constructor_.md +5 -2
- package/docs/api/player.mediacontrol.attributes.md +3 -0
- package/docs/api/player.mediacontrol.bindcontainerevents.md +3 -0
- package/docs/api/player.mediacontrol.bindevents.md +3 -0
- package/docs/api/player.mediacontrol.container.md +3 -0
- package/docs/api/player.mediacontrol.destroy.md +3 -0
- package/docs/api/player.mediacontrol.disable.md +3 -0
- package/docs/api/player.mediacontrol.disabled.md +3 -0
- package/docs/api/player.mediacontrol.disabledcontrolbutton.md +5 -0
- package/docs/api/player.mediacontrol.enable.md +3 -0
- package/docs/api/player.mediacontrol.enablecontrolbutton.md +5 -0
- package/docs/api/player.mediacontrol.events.md +3 -0
- package/docs/api/player.mediacontrol.getelement.md +11 -2
- package/docs/api/player.mediacontrol.getexternalinterface.md +3 -0
- package/docs/api/player.mediacontrol.md +53 -570
- package/docs/api/player.mediacontrol.muted.md +5 -0
- package/docs/api/player.mediacontrol.name.md +3 -0
- package/docs/api/player.mediacontrol.pause.md +5 -0
- package/docs/api/player.mediacontrol.play.md +5 -0
- package/docs/api/player.mediacontrol.playback.md +3 -0
- package/docs/api/player.mediacontrol.render.md +3 -0
- package/docs/api/player.mediacontrol.setinitialvolume.md +20 -0
- package/docs/api/player.mediacontrol.setmuted.md +3 -0
- package/docs/api/player.mediacontrol.setvolume.md +12 -1
- package/docs/api/player.mediacontrol.stop.md +5 -0
- package/docs/api/player.mediacontrol.supportedversion.md +3 -0
- package/docs/api/player.mediacontrol.volume.md +5 -0
- package/docs/api/{player.bigmutebutton.unbindevents.md → player.mediacontrolelement.md} +4 -7
- package/docs/api/player.subtitles.buttonelement.md +1 -1
- package/docs/api/player.subtitles.levelelement.md +1 -1
- package/docs/api/player.zeptoresult.md +15 -0
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +3 -5
- package/lib/index.core.d.ts +1 -0
- package/lib/index.core.d.ts.map +1 -1
- package/lib/index.core.js +1 -0
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +4 -4
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.d.ts +3 -0
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +22 -2
- package/lib/plugins/kibo/index.d.ts +3 -0
- package/lib/plugins/kibo/index.d.ts.map +1 -1
- package/lib/plugins/kibo/index.js +3 -0
- package/lib/plugins/media-control/MediaControl.d.ts +95 -54
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +60 -37
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +3 -7
- package/lib/plugins/subtitles/Subtitles.d.ts +1 -1
- package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -1
- package/lib/plugins/vast-ads/roll.d.ts +1 -1
- package/lib/plugins/vast-ads/roll.d.ts.map +1 -1
- package/lib/plugins/vast-ads/rollmanager.d.ts +1 -1
- package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/types.d.ts +6 -0
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Player.ts +3 -5
- package/src/index.core.ts +1 -0
- package/src/playback/hls-playback/HlsPlayback.ts +10 -5
- package/src/plugins/audio-selector/AudioSelector.ts +1 -1
- package/src/plugins/big-mute-button/BigMuteButton.ts +2 -2
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +1 -1
- package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +1 -1
- package/src/plugins/clappr-stats/ClapprStats.ts +1 -1
- package/src/plugins/clips/Clips.ts +29 -3
- package/src/plugins/error-screen/ErrorScreen.ts +1 -1
- package/src/plugins/favicon/Favicon.ts +1 -1
- package/src/plugins/kibo/index.ts +3 -0
- package/src/plugins/level-selector/LevelSelector.ts +1 -1
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +1 -8
- package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +33 -0
- package/src/plugins/logo/Logo.ts +1 -1
- package/src/plugins/media-control/MediaControl.ts +114 -94
- package/src/plugins/multi-camera/MultiCamera.ts +1 -1
- package/src/plugins/playback-rate/PlaybackRate.ts +1 -1
- package/src/plugins/poster/Poster.ts +1 -1
- package/src/plugins/seek-time/SeekTime.ts +1 -1
- package/src/plugins/source-controller/SourceController.ts +4 -8
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +1 -1
- package/src/plugins/subtitles/Subtitles.ts +1 -1
- package/src/plugins/thumbnails/Thumbnails.ts +1 -1
- package/src/plugins/vast-ads/VastAds.ts +1 -1
- package/src/plugins/vast-ads/roll.ts +1 -1
- package/src/plugins/vast-ads/rollmanager.ts +1 -1
- package/src/plugins/volume-fade/VolumeFade.ts +1 -1
- package/src/types.ts +0 -2
- package/src/utils/types.ts +6 -0
- package/temp/player.api.json +587 -2743
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.kibo._constructor_.md +0 -49
- package/docs/api/player.kibo.delegate.md +0 -79
- package/docs/api/player.kibo.down.md +0 -65
- package/docs/api/player.kibo.lastkey.md +0 -51
- package/docs/api/player.kibo.lastmodifiersandkey.md +0 -15
- package/docs/api/player.kibo.md +0 -137
- package/docs/api/player.kibo.off.md +0 -49
- package/docs/api/player.kibo.up.md +0 -65
- package/docs/api/player.mediacontrol.applybuttonstyle.md +0 -49
- package/docs/api/player.mediacontrol.bigplaybutton.md +0 -11
- package/docs/api/player.mediacontrol.bindkeyandshow.md +0 -63
- package/docs/api/player.mediacontrol.bindkeyevents.md +0 -15
- package/docs/api/player.mediacontrol.configure.md +0 -15
- package/docs/api/player.mediacontrol.createcachedelements.md +0 -15
- package/docs/api/player.mediacontrol.drawdurationandposition.md +0 -15
- package/docs/api/player.mediacontrol.ended.md +0 -15
- package/docs/api/player.mediacontrol.getsettings.md +0 -15
- package/docs/api/player.mediacontrol.getvolumefromuievent.md +0 -49
- package/docs/api/player.mediacontrol.hide.md +0 -51
- package/docs/api/player.mediacontrol.hidecontrollads.md +0 -15
- package/docs/api/player.mediacontrol.hidevolumebar.md +0 -51
- package/docs/api/player.mediacontrol.highdefinitionupdate.md +0 -49
- package/docs/api/player.mediacontrol.initializeicons.md +0 -15
- package/docs/api/player.mediacontrol.isseekenabledforhtml5playback.md +0 -15
- package/docs/api/player.mediacontrol.isvisible.md +0 -15
- package/docs/api/player.mediacontrol.onactivecontainerchanged.md +0 -15
- package/docs/api/player.mediacontrol.onfinishad.md +0 -15
- package/docs/api/player.mediacontrol.onstartad.md +0 -15
- package/docs/api/player.mediacontrol.ontimeupdate.md +0 -49
- package/docs/api/player.mediacontrol.parsecolors.md +0 -15
- package/docs/api/player.mediacontrol.renderseekbar.md +0 -15
- package/docs/api/player.mediacontrol.resetindicators.md +0 -15
- package/docs/api/player.mediacontrol.resetkeepvisible.md +0 -15
- package/docs/api/player.mediacontrol.resetuserkeepvisible.md +0 -15
- package/docs/api/player.mediacontrol.seek.md +0 -49
- package/docs/api/player.mediacontrol.seekrelative.md +0 -49
- package/docs/api/player.mediacontrol.setcliptext.md +0 -49
- package/docs/api/player.mediacontrol.setkeepvisible.md +0 -15
- package/docs/api/player.mediacontrol.setseekpercentage.md +0 -49
- package/docs/api/player.mediacontrol.setsvgmask.md +0 -49
- package/docs/api/player.mediacontrol.setuserkeepvisible.md +0 -15
- package/docs/api/player.mediacontrol.show.md +0 -51
- package/docs/api/player.mediacontrol.showvolumebar.md +0 -15
- package/docs/api/player.mediacontrol.startseekdrag.md +0 -49
- package/docs/api/player.mediacontrol.startvolumedrag.md +0 -49
- package/docs/api/player.mediacontrol.stopdrag.md +0 -11
- package/docs/api/player.mediacontrol.template.md +0 -11
- package/docs/api/player.mediacontrol.togglefullscreen.md +0 -15
- package/docs/api/player.mediacontrol.togglemute.md +0 -15
- package/docs/api/player.mediacontrol.toggleplaypause.md +0 -15
- package/docs/api/player.mediacontrol.toggleplaystop.md +0 -15
- package/docs/api/player.mediacontrol.unbindkeyevents.md +0 -15
- package/docs/api/player.mediacontrol.updatecursorstyle.md +0 -49
- package/docs/api/player.mediacontrol.updatedrag.md +0 -11
- package/docs/api/player.mediacontrol.updateprogressbar.md +0 -49
- package/src/plugins/types.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -41803,11 +41803,11 @@ class HlsPlayback extends HTML5Video {
|
|
|
41803
41803
|
this._hls = null;
|
|
41804
41804
|
}
|
|
41805
41805
|
_createHLSInstance() {
|
|
41806
|
-
const config = {
|
|
41807
|
-
...this.options.playback.hlsjsConfig,
|
|
41806
|
+
const config = $.extend(true, {
|
|
41808
41807
|
maxBufferLength: 2,
|
|
41809
41808
|
maxMaxBufferLength: 4,
|
|
41810
|
-
};
|
|
41809
|
+
}, this.options.playback.hlsjsConfig);
|
|
41810
|
+
trace(`${T$b} _createHLSInstance`, { config });
|
|
41811
41811
|
this._hls = new Hls(config);
|
|
41812
41812
|
}
|
|
41813
41813
|
_attachHLSMedia() {
|
|
@@ -42779,11 +42779,10 @@ class Player {
|
|
|
42779
42779
|
sources,
|
|
42780
42780
|
});
|
|
42781
42781
|
this.rootNode = rootNode;
|
|
42782
|
-
const coreOptions = {
|
|
42783
|
-
...this.config, // plugin settings
|
|
42782
|
+
const coreOptions = $.extend(true, this.config, {
|
|
42784
42783
|
allowUserInteraction: true,
|
|
42785
42784
|
autoPlay: false,
|
|
42786
|
-
dash: this.config.dash,
|
|
42785
|
+
dash: this.config.dash,
|
|
42787
42786
|
debug: this.config.debug || 'none',
|
|
42788
42787
|
events: this.events,
|
|
42789
42788
|
height: rootNode.clientHeight,
|
|
@@ -42796,7 +42795,6 @@ class Player {
|
|
|
42796
42795
|
mute: this.config.mute,
|
|
42797
42796
|
crossOrigin: 'anonymous', // TODO
|
|
42798
42797
|
hlsjsConfig: {
|
|
42799
|
-
// TODO
|
|
42800
42798
|
debug: this.config.debug === 'all' || this.config.debug === 'hls',
|
|
42801
42799
|
},
|
|
42802
42800
|
},
|
|
@@ -42807,7 +42805,7 @@ class Player {
|
|
|
42807
42805
|
mimeType: source ? source.mimeType : undefined,
|
|
42808
42806
|
sources,
|
|
42809
42807
|
strings: this.config.strings,
|
|
42810
|
-
};
|
|
42808
|
+
});
|
|
42811
42809
|
return coreOptions;
|
|
42812
42810
|
}
|
|
42813
42811
|
configurePlaybacks() {
|
|
@@ -42865,7 +42863,7 @@ class Player {
|
|
|
42865
42863
|
}
|
|
42866
42864
|
}
|
|
42867
42865
|
|
|
42868
|
-
var version$1 = "2.19.
|
|
42866
|
+
var version$1 = "2.19.9";
|
|
42869
42867
|
|
|
42870
42868
|
var packages = {
|
|
42871
42869
|
"node_modules/@clappr/core": {
|
|
@@ -46238,6 +46236,7 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46238
46236
|
duration = 0;
|
|
46239
46237
|
durationGetting = false;
|
|
46240
46238
|
_oldContainer;
|
|
46239
|
+
svgMask = null;
|
|
46241
46240
|
get name() {
|
|
46242
46241
|
return 'clips';
|
|
46243
46242
|
}
|
|
@@ -46289,7 +46288,7 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46289
46288
|
}
|
|
46290
46289
|
for (const value of this.clips.values()) {
|
|
46291
46290
|
if (event.current >= value.start && event.current < value.end) {
|
|
46292
|
-
this.
|
|
46291
|
+
this.setClipText(value.text);
|
|
46293
46292
|
break;
|
|
46294
46293
|
}
|
|
46295
46294
|
}
|
|
@@ -46336,7 +46335,26 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
46336
46335
|
});
|
|
46337
46336
|
svg += `<rect x="${finishValue}" y="0" width="${widthOfSeek - finishValue}" height="30"/>\n`;
|
|
46338
46337
|
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
46338
|
+
this.setSVGMask(svg);
|
|
46339
|
+
}
|
|
46340
|
+
setSVGMask(svg) {
|
|
46339
46341
|
this.core.mediaControl.setSVGMask(svg);
|
|
46342
|
+
if (this.svgMask) {
|
|
46343
|
+
this.svgMask.remove();
|
|
46344
|
+
}
|
|
46345
|
+
const $seekBarContainer = this.core.mediaControl.getElement('seekBarContainer');
|
|
46346
|
+
if ($seekBarContainer?.get(0)) {
|
|
46347
|
+
$seekBarContainer.addClass('clips');
|
|
46348
|
+
}
|
|
46349
|
+
this.svgMask = $(svg);
|
|
46350
|
+
$seekBarContainer?.append(this.svgMask);
|
|
46351
|
+
}
|
|
46352
|
+
setClipText(text) {
|
|
46353
|
+
const $clipText = this.core.mediaControl.getElement('clipText');
|
|
46354
|
+
if ($clipText && text) {
|
|
46355
|
+
$clipText.show();
|
|
46356
|
+
$clipText.text(`${text}`);
|
|
46357
|
+
}
|
|
46340
46358
|
}
|
|
46341
46359
|
}
|
|
46342
46360
|
|
|
@@ -47019,6 +47037,9 @@ class GoogleAnalytics extends ContainerPlugin {
|
|
|
47019
47037
|
/* eslint-disable */
|
|
47020
47038
|
// Kibo is released under the MIT License. Copyright (c) 2013 marquete.
|
|
47021
47039
|
// see https://github.com/marquete/kibo
|
|
47040
|
+
/**
|
|
47041
|
+
* @internal
|
|
47042
|
+
*/
|
|
47022
47043
|
class Kibo {
|
|
47023
47044
|
element;
|
|
47024
47045
|
lastKeyCode = -1;
|
|
@@ -47715,9 +47736,14 @@ const fullscreenOnIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"
|
|
|
47715
47736
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
47716
47737
|
// Use of this source code is governed by a BSD-style
|
|
47717
47738
|
// license that can be found in the LICENSE file.
|
|
47718
|
-
|
|
47719
|
-
|
|
47720
|
-
|
|
47739
|
+
const LEFT_ORDER = [
|
|
47740
|
+
'playpause',
|
|
47741
|
+
'playstop',
|
|
47742
|
+
'live',
|
|
47743
|
+
'volume',
|
|
47744
|
+
'position',
|
|
47745
|
+
'duration',
|
|
47746
|
+
];
|
|
47721
47747
|
const { Config, Fullscreen, formatTime: formatTime$1, extend, removeArrayItem } = Utils;
|
|
47722
47748
|
function orderByOrderPattern(arr, order) {
|
|
47723
47749
|
const arrWithoutDuplicates = [...new Set(arr)];
|
|
@@ -47725,6 +47751,13 @@ function orderByOrderPattern(arr, order) {
|
|
|
47725
47751
|
const rest = arrWithoutDuplicates.filter((item) => !order.includes(item));
|
|
47726
47752
|
return [...ordered, ...rest];
|
|
47727
47753
|
}
|
|
47754
|
+
/**
|
|
47755
|
+
* The MediaControl is responsible for displaying the Player controls.
|
|
47756
|
+
* @beta
|
|
47757
|
+
* @remarks
|
|
47758
|
+
* This plugin provides a foundation for developing a media controls UI via additional plugins.
|
|
47759
|
+
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
47760
|
+
*/
|
|
47728
47761
|
class MediaControl extends UICorePlugin {
|
|
47729
47762
|
advertisementPlaying = false;
|
|
47730
47763
|
buttonsColor = null;
|
|
@@ -47777,6 +47810,7 @@ class MediaControl extends UICorePlugin {
|
|
|
47777
47810
|
$volumeBarScrubber = null;
|
|
47778
47811
|
$volumeContainer = null;
|
|
47779
47812
|
$volumeIcon = null;
|
|
47813
|
+
template = tmpl(mediaControlHTML);
|
|
47780
47814
|
get name() {
|
|
47781
47815
|
return 'media_control';
|
|
47782
47816
|
}
|
|
@@ -47828,14 +47862,17 @@ class MediaControl extends UICorePlugin {
|
|
|
47828
47862
|
'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible',
|
|
47829
47863
|
};
|
|
47830
47864
|
}
|
|
47831
|
-
|
|
47832
|
-
|
|
47833
|
-
|
|
47865
|
+
/**
|
|
47866
|
+
* Current volume
|
|
47867
|
+
*/
|
|
47834
47868
|
get volume() {
|
|
47835
47869
|
return this.container && this.container.isReady
|
|
47836
47870
|
? this.container.volume
|
|
47837
47871
|
: this.intendedVolume;
|
|
47838
47872
|
}
|
|
47873
|
+
/**
|
|
47874
|
+
* Muted state
|
|
47875
|
+
*/
|
|
47839
47876
|
get muted() {
|
|
47840
47877
|
return this.volume === 0;
|
|
47841
47878
|
}
|
|
@@ -47930,15 +47967,27 @@ class MediaControl extends UICorePlugin {
|
|
|
47930
47967
|
this.bindKeyEvents();
|
|
47931
47968
|
this.show();
|
|
47932
47969
|
}
|
|
47970
|
+
/**
|
|
47971
|
+
* Start the playback
|
|
47972
|
+
*/
|
|
47933
47973
|
play() {
|
|
47934
47974
|
this.container && this.container.play();
|
|
47935
47975
|
}
|
|
47976
|
+
/**
|
|
47977
|
+
* Pause the playback
|
|
47978
|
+
*/
|
|
47936
47979
|
pause() {
|
|
47937
47980
|
this.container && this.container.pause();
|
|
47938
47981
|
}
|
|
47982
|
+
/**
|
|
47983
|
+
* Stop the playback
|
|
47984
|
+
*/
|
|
47939
47985
|
stop() {
|
|
47940
47986
|
this.container && this.container.stop();
|
|
47941
47987
|
}
|
|
47988
|
+
/**
|
|
47989
|
+
* Set the initial volume, which is preserved when playback is interrupted by an advertisement
|
|
47990
|
+
*/
|
|
47942
47991
|
setInitialVolume() {
|
|
47943
47992
|
const initialVolume = this.persistConfig ? Config.restore('volume') : 100;
|
|
47944
47993
|
const options = (this.container && this.container.options) || this.options;
|
|
@@ -48138,6 +48187,13 @@ class MediaControl extends UICorePlugin {
|
|
|
48138
48187
|
toggleMute() {
|
|
48139
48188
|
this.setVolume(this.muted ? 100 : 0);
|
|
48140
48189
|
}
|
|
48190
|
+
/**
|
|
48191
|
+
* Set the volume
|
|
48192
|
+
* @param value - The volume value
|
|
48193
|
+
* @param isInitialVolume - save as the initial volume
|
|
48194
|
+
* @remarks
|
|
48195
|
+
* Initial volume can be restored later
|
|
48196
|
+
*/
|
|
48141
48197
|
setVolume(value, isInitialVolume = false) {
|
|
48142
48198
|
value = Math.min(100, Math.max(value, 0));
|
|
48143
48199
|
// this will hold the intended volume
|
|
@@ -48358,14 +48414,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48358
48414
|
default: [],
|
|
48359
48415
|
right: [],
|
|
48360
48416
|
});
|
|
48361
|
-
const LEFT_ORDER = [
|
|
48362
|
-
'playpause',
|
|
48363
|
-
'playstop',
|
|
48364
|
-
'live',
|
|
48365
|
-
'volume',
|
|
48366
|
-
'position',
|
|
48367
|
-
'duration',
|
|
48368
|
-
];
|
|
48369
48417
|
newSettings.left = orderByOrderPattern([...newSettings.left, 'clipsText', 'volume'], LEFT_ORDER);
|
|
48370
48418
|
newSettings.right = [
|
|
48371
48419
|
'fullscreen',
|
|
@@ -48432,12 +48480,20 @@ class MediaControl extends UICorePlugin {
|
|
|
48432
48480
|
this.resetIndicators();
|
|
48433
48481
|
this.initializeIcons();
|
|
48434
48482
|
}
|
|
48483
|
+
/**
|
|
48484
|
+
* Get a media control element DOM node
|
|
48485
|
+
* @param name - The name of the media control element
|
|
48486
|
+
* @returns The DOM node to render the media control element
|
|
48487
|
+
*/
|
|
48435
48488
|
getElement(name) {
|
|
48436
48489
|
switch (name) {
|
|
48490
|
+
case 'clipText':
|
|
48491
|
+
return this.$clipText;
|
|
48437
48492
|
case 'pip':
|
|
48438
48493
|
return this.$pip;
|
|
48494
|
+
case 'seekBarContainer':
|
|
48495
|
+
return this.$seekBarContainer;
|
|
48439
48496
|
}
|
|
48440
|
-
return null;
|
|
48441
48497
|
}
|
|
48442
48498
|
resetIndicators() {
|
|
48443
48499
|
assert.ok(this.$duration && this.$position, 'duration and position elements must be present');
|
|
@@ -48636,9 +48692,6 @@ class MediaControl extends UICorePlugin {
|
|
|
48636
48692
|
this.trigger(Events$1.MEDIACONTROL_RENDERED);
|
|
48637
48693
|
return this;
|
|
48638
48694
|
}
|
|
48639
|
-
get bigPlayButton() {
|
|
48640
|
-
return playIcon;
|
|
48641
|
-
}
|
|
48642
48695
|
handleFullScreenOnBtn() {
|
|
48643
48696
|
this.trigger(Events$1.MEDIACONTROL_FULLSCREEN, this.name);
|
|
48644
48697
|
this.container.fullscreen();
|
|
@@ -48656,37 +48709,24 @@ class MediaControl extends UICorePlugin {
|
|
|
48656
48709
|
}
|
|
48657
48710
|
this.resetUserKeepVisible();
|
|
48658
48711
|
}
|
|
48712
|
+
// TODO manage by the ads plugin
|
|
48659
48713
|
onStartAd() {
|
|
48660
48714
|
this.advertisementPlaying = true;
|
|
48661
48715
|
this.disable();
|
|
48662
48716
|
}
|
|
48717
|
+
// TODO manage by the ads plugin
|
|
48663
48718
|
onFinishAd() {
|
|
48664
48719
|
this.advertisementPlaying = false;
|
|
48665
48720
|
this.enable();
|
|
48666
48721
|
}
|
|
48667
|
-
|
|
48668
|
-
if (this.$clipText && txt) {
|
|
48669
|
-
this.$clipTextContainer?.show();
|
|
48670
|
-
this.$clipText.text(`${txt}`);
|
|
48671
|
-
}
|
|
48672
|
-
}
|
|
48722
|
+
// TODO remove
|
|
48673
48723
|
hideControllAds() {
|
|
48674
48724
|
if (this.container.advertisement &&
|
|
48675
48725
|
this.container.advertisement.type !== 'idle') {
|
|
48676
48726
|
this.hide();
|
|
48677
48727
|
}
|
|
48678
48728
|
}
|
|
48679
|
-
|
|
48680
|
-
if (this.svgMask) {
|
|
48681
|
-
this.svgMask.remove();
|
|
48682
|
-
}
|
|
48683
|
-
if (this.$seekBarContainer?.get(0)) {
|
|
48684
|
-
this.$seekBarContainer.addClass('clips');
|
|
48685
|
-
}
|
|
48686
|
-
this.svgMask = $(svg);
|
|
48687
|
-
this.$seekBarContainer?.append(this.svgMask);
|
|
48688
|
-
}
|
|
48689
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=109212
|
|
48729
|
+
// TODO
|
|
48690
48730
|
setMuted(value) {
|
|
48691
48731
|
this.container.options.mute = value;
|
|
48692
48732
|
}
|
|
@@ -48702,13 +48742,17 @@ class MediaControl extends UICorePlugin {
|
|
|
48702
48742
|
}
|
|
48703
48743
|
return 0;
|
|
48704
48744
|
}
|
|
48705
|
-
|
|
48706
|
-
|
|
48745
|
+
/**
|
|
48746
|
+
* Enable the control button
|
|
48747
|
+
*/
|
|
48707
48748
|
enableControlButton() {
|
|
48708
48749
|
this.disabledClickableList.forEach((element) => {
|
|
48709
48750
|
element.el.css({ 'pointer-events': element.pointerEventValue });
|
|
48710
48751
|
});
|
|
48711
48752
|
}
|
|
48753
|
+
/**
|
|
48754
|
+
* Disable the control button
|
|
48755
|
+
*/
|
|
48712
48756
|
disabledControlButton() {
|
|
48713
48757
|
this.disabledClickableList.forEach((element) => {
|
|
48714
48758
|
element.el.css({ 'pointer-events': 'none' });
|
|
@@ -51153,6 +51197,7 @@ class SourceController extends CorePlugin {
|
|
|
51153
51197
|
onReady() {
|
|
51154
51198
|
trace(`${T} onReady`, {
|
|
51155
51199
|
retrying: this.active,
|
|
51200
|
+
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51156
51201
|
});
|
|
51157
51202
|
const spinner = this.core.activeContainer?.getPlugin('spinner');
|
|
51158
51203
|
if (spinner) {
|
|
@@ -51163,6 +51208,7 @@ class SourceController extends CorePlugin {
|
|
|
51163
51208
|
else {
|
|
51164
51209
|
this.sync = noSync;
|
|
51165
51210
|
}
|
|
51211
|
+
// TODO bind to CORE_ACTIVE_CONTAINER_CHANGED
|
|
51166
51212
|
this.bindContainerEventListeners();
|
|
51167
51213
|
if (this.active) {
|
|
51168
51214
|
this.core.activeContainer?.getPlugin('poster_custom')?.disable();
|
|
@@ -51170,9 +51216,6 @@ class SourceController extends CorePlugin {
|
|
|
51170
51216
|
}
|
|
51171
51217
|
}
|
|
51172
51218
|
bindContainerEventListeners() {
|
|
51173
|
-
trace(`${T} bindContainerEventListeners`, {
|
|
51174
|
-
activePlayback: this.core.activePlayback?.name,
|
|
51175
|
-
});
|
|
51176
51219
|
this.core.activePlayback.on(Events$1.PLAYBACK_ERROR, (error) => {
|
|
51177
51220
|
trace(`${T} on PLAYBACK_ERROR`, {
|
|
51178
51221
|
error: {
|
|
@@ -51211,7 +51254,6 @@ class SourceController extends CorePlugin {
|
|
|
51211
51254
|
trace(`${T} retryPlayback enter`, {
|
|
51212
51255
|
currentSourceIndex: this.currentSourceIndex,
|
|
51213
51256
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
51214
|
-
sourcesList: this.sourcesList,
|
|
51215
51257
|
});
|
|
51216
51258
|
this.active = true;
|
|
51217
51259
|
this.getNextMediaSource().then((nextSource) => {
|
|
@@ -51220,9 +51262,7 @@ class SourceController extends CorePlugin {
|
|
|
51220
51262
|
});
|
|
51221
51263
|
const rnd = RETRY_DELAY_BLUR * Math.random();
|
|
51222
51264
|
this.sync(() => {
|
|
51223
|
-
trace(`${T} retryPlayback loading
|
|
51224
|
-
nextSource,
|
|
51225
|
-
});
|
|
51265
|
+
trace(`${T} retryPlayback loading...`);
|
|
51226
51266
|
this.core.load(nextSource.source, nextSource.mimeType);
|
|
51227
51267
|
trace(`${T} retryPlayback loaded`, {
|
|
51228
51268
|
nextSource,
|
package/dist/player.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ import { CorePlugin } from '@clappr/core';
|
|
|
18
18
|
import { Events } from 'hls.js';
|
|
19
19
|
import { Logger } from '@gcorevideo/utils';
|
|
20
20
|
import { LogTracer } from '@gcorevideo/utils';
|
|
21
|
-
import { Player as Player_2 } from '@clappr/core';
|
|
22
21
|
import { reportError as reportError_2 } from '@gcorevideo/utils';
|
|
23
22
|
import { SentryTracer } from '@gcorevideo/utils';
|
|
24
23
|
import { setTracer } from '@gcorevideo/utils';
|
|
@@ -93,7 +92,7 @@ export declare class BigMuteButton extends UICorePlugin {
|
|
|
93
92
|
'click .big-mute-icon-wrapper': string;
|
|
94
93
|
};
|
|
95
94
|
bindEvents(): void;
|
|
96
|
-
unBindEvents
|
|
95
|
+
private unBindEvents;
|
|
97
96
|
private onCoreReady;
|
|
98
97
|
private onContainerVolume;
|
|
99
98
|
private onContainerStart;
|
|
@@ -268,6 +267,7 @@ export declare class ClipsPlugin extends UICorePlugin {
|
|
|
268
267
|
private duration;
|
|
269
268
|
private durationGetting;
|
|
270
269
|
private _oldContainer;
|
|
270
|
+
private svgMask;
|
|
271
271
|
get name(): string;
|
|
272
272
|
get attributes(): {
|
|
273
273
|
class: string;
|
|
@@ -282,6 +282,8 @@ export declare class ClipsPlugin extends UICorePlugin {
|
|
|
282
282
|
private parseClips;
|
|
283
283
|
getText(time: number): string;
|
|
284
284
|
makeSvg(duration: number): void;
|
|
285
|
+
private setSVGMask;
|
|
286
|
+
private setClipText;
|
|
285
287
|
}
|
|
286
288
|
|
|
287
289
|
/**
|
|
@@ -467,6 +469,9 @@ export declare class GoogleAnalytics extends ContainerPlugin {
|
|
|
467
469
|
|
|
468
470
|
declare type KeyboardEventHandler = (e: KeyboardEvent) => boolean | undefined;
|
|
469
471
|
|
|
472
|
+
/**
|
|
473
|
+
* @internal
|
|
474
|
+
*/
|
|
470
475
|
export declare class Kibo {
|
|
471
476
|
private element;
|
|
472
477
|
private lastKeyCode;
|
|
@@ -506,7 +511,6 @@ export declare type LangTag = string;
|
|
|
506
511
|
*
|
|
507
512
|
* - `labels`: The labels to show in the level selector. [vertical resolution]: string
|
|
508
513
|
* - `restrictResolution`: The maximum resolution to allow in the level selector.
|
|
509
|
-
* - `title`: The title to show in the level selector.
|
|
510
514
|
*
|
|
511
515
|
* @example
|
|
512
516
|
* ```ts
|
|
@@ -552,7 +556,6 @@ export declare class LevelSelector extends UICorePlugin {
|
|
|
552
556
|
private get maxLevel();
|
|
553
557
|
private fillLevels;
|
|
554
558
|
private makeLevelsLabels;
|
|
555
|
-
private findLevelBy;
|
|
556
559
|
private onLevelSelect;
|
|
557
560
|
private goBack;
|
|
558
561
|
private setLevel;
|
|
@@ -599,6 +602,13 @@ export declare class Logo extends UIContainerPlugin {
|
|
|
599
602
|
|
|
600
603
|
export { LogTracer }
|
|
601
604
|
|
|
605
|
+
/**
|
|
606
|
+
* The MediaControl is responsible for displaying the Player controls.
|
|
607
|
+
* @beta
|
|
608
|
+
* @remarks
|
|
609
|
+
* This plugin provides a foundation for developing a media controls UI via additional plugins.
|
|
610
|
+
* The methods exposed are to be used by the other plugins that extend the media control UI.
|
|
611
|
+
*/
|
|
602
612
|
export declare class MediaControl extends UICorePlugin {
|
|
603
613
|
private advertisementPlaying;
|
|
604
614
|
private buttonsColor;
|
|
@@ -651,6 +661,7 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
651
661
|
private $volumeBarScrubber;
|
|
652
662
|
private $volumeContainer;
|
|
653
663
|
private $volumeIcon;
|
|
664
|
+
private readonly template;
|
|
654
665
|
get name(): string;
|
|
655
666
|
get supportedVersion(): {
|
|
656
667
|
min: string;
|
|
@@ -689,10 +700,15 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
689
700
|
'mouseenter .media-control-layer[data-controls]': string;
|
|
690
701
|
'mouseleave .media-control-layer[data-controls]': string;
|
|
691
702
|
};
|
|
692
|
-
|
|
703
|
+
/**
|
|
704
|
+
* Current volume
|
|
705
|
+
*/
|
|
693
706
|
get volume(): any;
|
|
707
|
+
/**
|
|
708
|
+
* Muted state
|
|
709
|
+
*/
|
|
694
710
|
get muted(): boolean;
|
|
695
|
-
constructor(core:
|
|
711
|
+
constructor(core: Core);
|
|
696
712
|
getExternalInterface(): {
|
|
697
713
|
setVolume: (value: number, isInitialVolume?: boolean) => void;
|
|
698
714
|
getVolume: () => any;
|
|
@@ -701,10 +717,22 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
701
717
|
bindContainerEvents(): void;
|
|
702
718
|
disable(): void;
|
|
703
719
|
enable(): void;
|
|
720
|
+
/**
|
|
721
|
+
* Start the playback
|
|
722
|
+
*/
|
|
704
723
|
play(): void;
|
|
724
|
+
/**
|
|
725
|
+
* Pause the playback
|
|
726
|
+
*/
|
|
705
727
|
pause(): void;
|
|
728
|
+
/**
|
|
729
|
+
* Stop the playback
|
|
730
|
+
*/
|
|
706
731
|
stop(): void;
|
|
707
|
-
|
|
732
|
+
/**
|
|
733
|
+
* Set the initial volume, which is preserved when playback is interrupted by an advertisement
|
|
734
|
+
*/
|
|
735
|
+
setInitialVolume(): void;
|
|
708
736
|
private onVolumeChanged;
|
|
709
737
|
private onLoadedMetadataOnVideoTag;
|
|
710
738
|
private updateVolumeUI;
|
|
@@ -714,66 +742,84 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
714
742
|
private onVolumeClick;
|
|
715
743
|
private mousemoveOnVolumeBar;
|
|
716
744
|
private playerResize;
|
|
717
|
-
togglePlayPause
|
|
718
|
-
togglePlayStop
|
|
719
|
-
startSeekDrag
|
|
720
|
-
startVolumeDrag
|
|
721
|
-
stopDrag
|
|
722
|
-
updateDrag
|
|
723
|
-
getVolumeFromUIEvent
|
|
724
|
-
toggleMute
|
|
745
|
+
private togglePlayPause;
|
|
746
|
+
private togglePlayStop;
|
|
747
|
+
private startSeekDrag;
|
|
748
|
+
private startVolumeDrag;
|
|
749
|
+
private stopDrag;
|
|
750
|
+
private updateDrag;
|
|
751
|
+
private getVolumeFromUIEvent;
|
|
752
|
+
private toggleMute;
|
|
753
|
+
/**
|
|
754
|
+
* Set the volume
|
|
755
|
+
* @param value - The volume value
|
|
756
|
+
* @param isInitialVolume - save as the initial volume
|
|
757
|
+
* @remarks
|
|
758
|
+
* Initial volume can be restored later
|
|
759
|
+
*/
|
|
725
760
|
setVolume(value: number, isInitialVolume?: boolean): void;
|
|
726
|
-
toggleFullscreen
|
|
727
|
-
onActiveContainerChanged
|
|
728
|
-
showVolumeBar
|
|
729
|
-
hideVolumeBar
|
|
730
|
-
ended
|
|
731
|
-
updateProgressBar
|
|
732
|
-
onTimeUpdate
|
|
733
|
-
renderSeekBar
|
|
734
|
-
drawDurationAndPosition
|
|
735
|
-
seek
|
|
736
|
-
setKeepVisible
|
|
737
|
-
resetKeepVisible
|
|
738
|
-
setUserKeepVisible
|
|
739
|
-
resetUserKeepVisible
|
|
740
|
-
isVisible
|
|
741
|
-
show
|
|
742
|
-
hide
|
|
743
|
-
updateCursorStyle
|
|
761
|
+
private toggleFullscreen;
|
|
762
|
+
private onActiveContainerChanged;
|
|
763
|
+
private showVolumeBar;
|
|
764
|
+
private hideVolumeBar;
|
|
765
|
+
private ended;
|
|
766
|
+
private updateProgressBar;
|
|
767
|
+
private onTimeUpdate;
|
|
768
|
+
private renderSeekBar;
|
|
769
|
+
private drawDurationAndPosition;
|
|
770
|
+
private seek;
|
|
771
|
+
private setKeepVisible;
|
|
772
|
+
private resetKeepVisible;
|
|
773
|
+
private setUserKeepVisible;
|
|
774
|
+
private resetUserKeepVisible;
|
|
775
|
+
private isVisible;
|
|
776
|
+
private show;
|
|
777
|
+
private hide;
|
|
778
|
+
private updateCursorStyle;
|
|
744
779
|
private settingsUpdate;
|
|
745
|
-
getSettings
|
|
746
|
-
highDefinitionUpdate
|
|
747
|
-
createCachedElements
|
|
780
|
+
private getSettings;
|
|
781
|
+
private highDefinitionUpdate;
|
|
782
|
+
private createCachedElements;
|
|
783
|
+
/**
|
|
784
|
+
* Get a media control element DOM node
|
|
785
|
+
* @param name - The name of the media control element
|
|
786
|
+
* @returns The DOM node to render the media control element
|
|
787
|
+
*/
|
|
748
788
|
getElement(name: MediaControlElement): ZeptoResult | null;
|
|
749
|
-
resetIndicators
|
|
750
|
-
initializeIcons
|
|
751
|
-
setSeekPercentage
|
|
752
|
-
seekRelative
|
|
753
|
-
bindKeyAndShow
|
|
754
|
-
bindKeyEvents
|
|
755
|
-
unbindKeyEvents
|
|
756
|
-
parseColors
|
|
757
|
-
applyButtonStyle
|
|
789
|
+
private resetIndicators;
|
|
790
|
+
private initializeIcons;
|
|
791
|
+
private setSeekPercentage;
|
|
792
|
+
private seekRelative;
|
|
793
|
+
private bindKeyAndShow;
|
|
794
|
+
private bindKeyEvents;
|
|
795
|
+
private unbindKeyEvents;
|
|
796
|
+
private parseColors;
|
|
797
|
+
private applyButtonStyle;
|
|
758
798
|
destroy(): UIObject;
|
|
759
|
-
configure
|
|
799
|
+
private configure;
|
|
760
800
|
render(): this;
|
|
761
|
-
get bigPlayButton(): any;
|
|
762
801
|
private handleFullScreenOnBtn;
|
|
763
|
-
onStartAd
|
|
764
|
-
onFinishAd
|
|
765
|
-
|
|
766
|
-
hideControllAds(): void;
|
|
767
|
-
setSVGMask(svg: string): void;
|
|
802
|
+
private onStartAd;
|
|
803
|
+
private onFinishAd;
|
|
804
|
+
private hideControllAds;
|
|
768
805
|
setMuted(value: boolean): void;
|
|
769
806
|
private static getPageX;
|
|
770
807
|
private static getPageY;
|
|
808
|
+
/**
|
|
809
|
+
* Enable the control button
|
|
810
|
+
*/
|
|
771
811
|
enableControlButton(): void;
|
|
812
|
+
/**
|
|
813
|
+
* Disable the control button
|
|
814
|
+
*/
|
|
772
815
|
disabledControlButton(): void;
|
|
773
|
-
isSeekEnabledForHtml5Playback
|
|
816
|
+
private isSeekEnabledForHtml5Playback;
|
|
774
817
|
}
|
|
775
818
|
|
|
776
|
-
|
|
819
|
+
/**
|
|
820
|
+
* @beta
|
|
821
|
+
*/
|
|
822
|
+
export declare type MediaControlElement = 'clipText' | 'pip' | 'seekBarContainer';
|
|
777
823
|
|
|
778
824
|
declare type MediaSourceInfo = {
|
|
779
825
|
live: boolean;
|
|
@@ -1827,6 +1873,11 @@ export declare type TimeProgress = TimePosition & {
|
|
|
1827
1873
|
start: number;
|
|
1828
1874
|
};
|
|
1829
1875
|
|
|
1876
|
+
/**
|
|
1877
|
+
* @internal
|
|
1878
|
+
*/
|
|
1879
|
+
export declare type TimerId = ReturnType<typeof setTimeout>;
|
|
1880
|
+
|
|
1830
1881
|
/**
|
|
1831
1882
|
* For the plugin development
|
|
1832
1883
|
* @beta
|
|
@@ -1918,6 +1969,9 @@ export declare enum VolumeFadeEvents {
|
|
|
1918
1969
|
FADE = "core:volume:fade"
|
|
1919
1970
|
}
|
|
1920
1971
|
|
|
1921
|
-
|
|
1972
|
+
/**
|
|
1973
|
+
* @beta
|
|
1974
|
+
*/
|
|
1975
|
+
export declare type ZeptoResult = ReturnType<typeof $>;
|
|
1922
1976
|
|
|
1923
1977
|
export { }
|