@gcorevideo/player 2.22.1 → 2.22.3
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 +1 -1
- package/dist/index.css +1427 -1427
- package/dist/index.js +111 -33
- package/dist/player.d.ts +243 -95
- package/dist/plugins/index.css +350 -350
- package/dist/plugins/index.js +111 -33
- package/docs/api/player.bottomgear.additem.md +95 -0
- package/docs/api/player.bottomgear.md +63 -19
- package/docs/api/player.bottomgear.refresh.md +5 -1
- package/docs/api/player.clapprnerdstats.md +0 -2
- package/docs/api/player.clicktopause.md +1 -1
- package/docs/api/player.closedcaptions.md +2 -2
- package/docs/api/player.closedcaptionspluginsettings.md +5 -0
- package/docs/api/player.errorscreen.md +18 -4
- package/docs/api/player.errorscreenpluginsettings.md +1 -4
- package/docs/api/player.errorscreensettings.md +15 -0
- package/docs/api/{player.mediacontrolevents.md → player.gearevents.md} +7 -7
- package/docs/api/player.levelselector.events.md +0 -1
- package/docs/api/player.levelselector.md +1 -1
- package/docs/api/player.md +33 -36
- package/docs/api/{player.bottomgear.setcontent.md → player.mediacontrol.handlecustomarea.md} +5 -9
- package/docs/api/player.mediacontrol.md +15 -1
- package/docs/api/player.mediacontrol.putelement.md +2 -2
- package/docs/api/player.mediacontrol.toggleelement.md +2 -4
- package/docs/api/player.mediacontrolelement.md +1 -1
- package/docs/api/player.playbackrate.md +22 -3
- package/docs/api/{player.gearoptionsitem.md → player.playbackrateoption.md} +6 -4
- package/docs/api/player.playbackratesettings.md +20 -0
- package/docs/api/player.sourcecontroller._constructor_.md +49 -0
- package/docs/api/player.sourcecontroller.md +70 -7
- package/docs/api/player.spinnerevents.md +1 -4
- package/docs/api/player.spinnerthreebounce._constructor_.md +0 -3
- package/docs/api/player.spinnerthreebounce.hide.md +0 -3
- package/docs/api/player.spinnerthreebounce.md +6 -9
- package/docs/api/player.spinnerthreebounce.show.md +2 -5
- package/lib/index.plugins.d.ts +1 -0
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +1 -0
- package/lib/internal.types.d.ts +5 -0
- package/lib/internal.types.d.ts.map +1 -1
- package/lib/playback.types.d.ts +0 -5
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts +35 -13
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +35 -3
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +3 -2
- package/lib/plugins/error-screen/ErrorScreen.d.ts +29 -4
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +17 -2
- package/lib/plugins/media-control/MediaControl.d.ts +0 -11
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +0 -12
- package/lib/plugins/source-controller/SourceController.d.ts +40 -4
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +41 -4
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +9 -6
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +11 -6
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +7 -7
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +2 -2
- package/package.json +1 -1
- package/src/index.plugins.ts +1 -0
- package/src/internal.types.ts +6 -0
- package/src/playback.types.ts +0 -5
- package/src/plugins/bottom-gear/BottomGear.ts +35 -16
- package/src/plugins/click-to-pause/ClickToPause.ts +3 -2
- package/src/plugins/error-screen/ErrorScreen.ts +30 -4
- package/src/plugins/media-control/MediaControl.ts +0 -12
- package/src/plugins/source-controller/SourceController.ts +41 -4
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +11 -6
- package/src/plugins/subtitles/ClosedCaptions.ts +8 -9
- package/temp/player.api.json +260 -299
- package/tsconfig.tsbuildinfo +1 -1
- package/assets/bottom-gear/bottomgear copy.ejs +0 -10
- package/docs/api/player.bottomgear.getelement.md +0 -56
- package/docs/api/player.gearitemelement.md +0 -18
- package/docs/api/player.subtitlespluginsettings.md +0 -18
- package/docs/api/player.texttrackitem.id.md +0 -11
- package/docs/api/player.texttrackitem.md +0 -87
- package/docs/api/player.texttrackitem.name.md +0 -11
- package/docs/api/player.texttrackitem.track.md +0 -11
package/dist/index.js
CHANGED
|
@@ -43299,7 +43299,7 @@ class Player {
|
|
|
43299
43299
|
}
|
|
43300
43300
|
}
|
|
43301
43301
|
|
|
43302
|
-
var version$1 = "2.22.
|
|
43302
|
+
var version$1 = "2.22.3";
|
|
43303
43303
|
|
|
43304
43304
|
var packages = {
|
|
43305
43305
|
"node_modules/@clappr/core": {
|
|
@@ -43665,16 +43665,24 @@ const gearHdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\
|
|
|
43665
43665
|
|
|
43666
43666
|
const VERSION$5 = '2.19.12';
|
|
43667
43667
|
const T$f = 'plugins.bottom_gear';
|
|
43668
|
+
/**
|
|
43669
|
+
* Events triggered by the plugin
|
|
43670
|
+
* @beta
|
|
43671
|
+
*/
|
|
43668
43672
|
var GearEvents;
|
|
43669
43673
|
(function (GearEvents) {
|
|
43674
|
+
/**
|
|
43675
|
+
* Use this event to accurately attach an item to the gear menu
|
|
43676
|
+
*/
|
|
43670
43677
|
GearEvents["RENDERED"] = "rendered";
|
|
43671
43678
|
})(GearEvents || (GearEvents = {}));
|
|
43672
43679
|
// TODO disabled if no items added
|
|
43673
43680
|
/**
|
|
43674
|
-
* `PLUGIN` that adds
|
|
43681
|
+
* `PLUGIN` that adds a button to extend the media controls UI with extra options.
|
|
43675
43682
|
* @beta
|
|
43676
43683
|
* @remarks
|
|
43677
|
-
* The
|
|
43684
|
+
* The plugin renders small gear icon to the right of the media controls.
|
|
43685
|
+
* It provides a base for attaching custom settings UI in the gear menu
|
|
43678
43686
|
*
|
|
43679
43687
|
* Depends on:
|
|
43680
43688
|
*
|
|
@@ -43781,6 +43789,28 @@ class BottomGear extends UICorePlugin {
|
|
|
43781
43789
|
this.listenToOnce(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
43782
43790
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
43783
43791
|
}
|
|
43792
|
+
/**
|
|
43793
|
+
* Adds a custom option to the gear menu
|
|
43794
|
+
* @param name - A unique name of the option
|
|
43795
|
+
* @param $subMenu - The submenu to attach to the option
|
|
43796
|
+
* @returns The added item placeholder to attach custom markup
|
|
43797
|
+
* @remarks
|
|
43798
|
+
* When called with $submenu param, a click on the added item will toggle the submenu visibility.
|
|
43799
|
+
*
|
|
43800
|
+
* When added without submenu, it's responsibility of the caller to handle the click event however needed.
|
|
43801
|
+
* @example
|
|
43802
|
+
* ```ts
|
|
43803
|
+
* class MyPlugin extends UICorePlugin {
|
|
43804
|
+
* override render() {
|
|
43805
|
+
* this.$el.html('<div class="my-awesome-settings">...</div>')
|
|
43806
|
+
* this.core.getPlugin('bottom_gear')
|
|
43807
|
+
* ?.addItem('custom', this.$el)
|
|
43808
|
+
* .html($('<button>Custom settings</button>'))
|
|
43809
|
+
* return this
|
|
43810
|
+
* }
|
|
43811
|
+
* }
|
|
43812
|
+
* ```
|
|
43813
|
+
*/
|
|
43784
43814
|
addItem(name, $subMenu) {
|
|
43785
43815
|
const $existingItem = this.$el.find(`#gear-options li[data-${name}`);
|
|
43786
43816
|
if ($existingItem.length) {
|
|
@@ -43840,7 +43870,9 @@ class BottomGear extends UICorePlugin {
|
|
|
43840
43870
|
return this;
|
|
43841
43871
|
}
|
|
43842
43872
|
/**
|
|
43843
|
-
* Collapses any submenu open back to the gear menu
|
|
43873
|
+
* Collapses any submenu open back to the gear menu.
|
|
43874
|
+
* @remarks
|
|
43875
|
+
* Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
|
|
43844
43876
|
*/
|
|
43845
43877
|
refresh() {
|
|
43846
43878
|
this.$el.find('.gear-sub-menu-wrapper').hide();
|
|
@@ -46624,12 +46656,13 @@ class ClapprStats extends ContainerPlugin {
|
|
|
46624
46656
|
// ClapprStats.REPORT_EVENT = 'clappr:stats:report';
|
|
46625
46657
|
// ClapprStats.PERCENTAGE_EVENT = 'clappr:stats:percentage';
|
|
46626
46658
|
|
|
46627
|
-
//
|
|
46659
|
+
// This work is based on the original work of the following authors:
|
|
46660
|
+
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
46628
46661
|
// Use of this source code is governed by a BSD-style
|
|
46629
46662
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
46630
46663
|
const T$d = 'plugins.click_to_pause_custom';
|
|
46631
46664
|
/**
|
|
46632
|
-
* `PLUGIN` that
|
|
46665
|
+
* A small `PLUGIN` that toggles the playback state on click over the video container
|
|
46633
46666
|
* @beta
|
|
46634
46667
|
*/
|
|
46635
46668
|
class ClickToPause extends ContainerPlugin {
|
|
@@ -47133,8 +47166,23 @@ const templateHtml = "<div class=\"player-error-screen__content\" data-error-scr
|
|
|
47133
47166
|
|
|
47134
47167
|
const T$b = 'plugins.error_screen';
|
|
47135
47168
|
/**
|
|
47136
|
-
* `PLUGIN` that displays errors nicely in the overlay on top of the player.
|
|
47137
|
-
* @
|
|
47169
|
+
* `PLUGIN` that displays fatal errors nicely in the overlay on top of the player.
|
|
47170
|
+
* @public
|
|
47171
|
+
* @remarks
|
|
47172
|
+
* A fatal error is an error that prevents the player from playing the content.
|
|
47173
|
+
* It's usually a network error that persists after multiple retries.
|
|
47174
|
+
*
|
|
47175
|
+
* The error screen should not be confused with the content stub that is shown when no media sources are available.
|
|
47176
|
+
* This can happen due to the lack of the support of the given sources type or because the sources are misconfigured (e.g., omitted).
|
|
47177
|
+
*
|
|
47178
|
+
* Configuration options - {@link ErrorScreenPluginSettings}
|
|
47179
|
+
*
|
|
47180
|
+
* @example
|
|
47181
|
+
* ```ts
|
|
47182
|
+
* import { ErrorScreen, Player } from '@gcorevideo/player'
|
|
47183
|
+
*
|
|
47184
|
+
* Player.registerPlugin(ErrorScreen)
|
|
47185
|
+
* ```
|
|
47138
47186
|
*/
|
|
47139
47187
|
class ErrorScreen extends UICorePlugin {
|
|
47140
47188
|
err = null;
|
|
@@ -48178,18 +48226,6 @@ const DEFAULT_SETTINGS = {
|
|
|
48178
48226
|
default: [],
|
|
48179
48227
|
seekEnabled: true,
|
|
48180
48228
|
};
|
|
48181
|
-
/**
|
|
48182
|
-
* Custom events emitted by the plugins to communicate with one another
|
|
48183
|
-
* @beta
|
|
48184
|
-
* @deprecated
|
|
48185
|
-
*/
|
|
48186
|
-
var MediaControlEvents;
|
|
48187
|
-
(function (MediaControlEvents) {
|
|
48188
|
-
/**
|
|
48189
|
-
* Emitted when the gear menu is rendered
|
|
48190
|
-
*/
|
|
48191
|
-
MediaControlEvents["MEDIACONTROL_GEAR_RENDERED"] = "mediacontrol:gear:rendered";
|
|
48192
|
-
})(MediaControlEvents || (MediaControlEvents = {}));
|
|
48193
48229
|
const T$9 = 'plugins.media_control';
|
|
48194
48230
|
const LEFT_ORDER = [
|
|
48195
48231
|
'playpause',
|
|
@@ -50686,27 +50722,30 @@ class SkipTime extends UICorePlugin {
|
|
|
50686
50722
|
|
|
50687
50723
|
const spinnerHTML = "<div data-bounce1></div>\n<div data-bounce2></div>\n<div data-bounce3></div>\n";
|
|
50688
50724
|
|
|
50725
|
+
// This work is based on the original work of Globo.com
|
|
50689
50726
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
50690
50727
|
// Use of this source code is governed by a BSD-style
|
|
50691
50728
|
// license that can be found in the LICENSE file.
|
|
50729
|
+
// https://github.com/clappr/clappr-plugins/blob/ffaa9d27005fa5a8a7c243ffc47eb5655b84b371/LICENSE
|
|
50692
50730
|
const T$4 = 'plugins.spinner';
|
|
50693
50731
|
/**
|
|
50694
50732
|
* Custom events emitted by the plugin
|
|
50695
|
-
* @
|
|
50733
|
+
* @public
|
|
50696
50734
|
*/
|
|
50697
50735
|
var SpinnerEvents;
|
|
50698
50736
|
(function (SpinnerEvents) {
|
|
50699
50737
|
/**
|
|
50700
50738
|
* Emitted at the end of the spinner animation cycle to facilitate smooth UI updates,
|
|
50701
|
-
*
|
|
50739
|
+
* for instance, {@link SourceController} listens to this event to reload the source when the spinner is hidden
|
|
50702
50740
|
*/
|
|
50703
50741
|
SpinnerEvents["SYNC"] = "plugins:spinner:sync";
|
|
50704
50742
|
})(SpinnerEvents || (SpinnerEvents = {}));
|
|
50705
50743
|
/**
|
|
50706
|
-
* `PLUGIN` that shows a pending operation indicator when playback is buffering or in a similar state
|
|
50707
|
-
* @
|
|
50744
|
+
* `PLUGIN` that shows a pending operation indicator when playback is buffering or in a similar state.
|
|
50745
|
+
* @public
|
|
50708
50746
|
* @remarks
|
|
50709
|
-
*
|
|
50747
|
+
* It is aliased as `Spinner` for convenience.
|
|
50748
|
+
* Events emitted - {@link SpinnerEvents}
|
|
50710
50749
|
* Other plugins can use {@link SpinnerThreeBounce.show | show} and {@link SpinnerThreeBounce.hide | hide} methods to
|
|
50711
50750
|
* implement custom pending/progress indication scenarios.
|
|
50712
50751
|
*/
|
|
@@ -50779,7 +50818,9 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50779
50818
|
/**
|
|
50780
50819
|
* Shows the spinner.
|
|
50781
50820
|
*
|
|
50782
|
-
*
|
|
50821
|
+
* The method call prevents spinner's built-in logic from automatically hiding it until {@link SpinnerThreeBounce.hide} is called
|
|
50822
|
+
*
|
|
50823
|
+
* @param delay - The delay in milliseconds before the spinner is shown.
|
|
50783
50824
|
*/
|
|
50784
50825
|
show(delay = 300) {
|
|
50785
50826
|
trace(`${T$4} show`);
|
|
@@ -50846,11 +50887,47 @@ function noSync(cb) {
|
|
|
50846
50887
|
queueMicrotask(cb);
|
|
50847
50888
|
}
|
|
50848
50889
|
/**
|
|
50849
|
-
* `PLUGIN` that is
|
|
50850
|
-
* @
|
|
50890
|
+
* `PLUGIN` that is managing the automatic failover between media sources.
|
|
50891
|
+
* @public
|
|
50851
50892
|
* @remarks
|
|
50852
50893
|
* Have a look at the {@link https://miro.com/app/board/uXjVLiN15tY=/?share_link_id=390327585787 | source failover diagram} for the details
|
|
50853
|
-
* on how sources ordering and selection works.
|
|
50894
|
+
* on how sources ordering and selection works. Below is a simplified diagram:
|
|
50895
|
+
*
|
|
50896
|
+
* ```markdown
|
|
50897
|
+
* sources_list:
|
|
50898
|
+
* - a.mpd | +--------------------+
|
|
50899
|
+
* - b.m3u8 |--->| init |
|
|
50900
|
+
* - ... | |--------------------|
|
|
50901
|
+
* | current_source = 0 |
|
|
50902
|
+
* +--------------------+
|
|
50903
|
+
* |
|
|
50904
|
+
* | source = a.mpd
|
|
50905
|
+
* | playback = dash.js
|
|
50906
|
+
* v
|
|
50907
|
+
* +------------------+
|
|
50908
|
+
* +-->| load source |
|
|
50909
|
+
* | +---------|--------+
|
|
50910
|
+
* | v
|
|
50911
|
+
* | +------------------+
|
|
50912
|
+
* | | play |
|
|
50913
|
+
* | +---------|--------+
|
|
50914
|
+
* | |
|
|
50915
|
+
* | v
|
|
50916
|
+
* | +-----------------------+
|
|
50917
|
+
* | | on playback_error |
|
|
50918
|
+
* | |-----------------------|
|
|
50919
|
+
* | | current_source = |
|
|
50920
|
+
* | | (current_source + 1) |
|
|
50921
|
+
* | | % len sources_list |
|
|
50922
|
+
* | | |
|
|
50923
|
+
* | | delay 1..3s |
|
|
50924
|
+
* | +---------------|-------+
|
|
50925
|
+
* | |
|
|
50926
|
+
* | source=b.m3u8 |
|
|
50927
|
+
* | playback=hls.js |
|
|
50928
|
+
* +-------------------+
|
|
50929
|
+
*
|
|
50930
|
+
* ```
|
|
50854
50931
|
*
|
|
50855
50932
|
* This plugin does not expose any public methods apart from required by the Clappr plugin interface.
|
|
50856
50933
|
* It is supposed to work autonomously.
|
|
@@ -50900,6 +50977,7 @@ class SourceController extends CorePlugin {
|
|
|
50900
50977
|
* | playback=hls.js |
|
|
50901
50978
|
* +-------------------+
|
|
50902
50979
|
*
|
|
50980
|
+
* As can be seen from the diagram, the plugin will endless try to load the next sources rotating between them in round-robin manner.
|
|
50903
50981
|
*/
|
|
50904
50982
|
sourcesList = [];
|
|
50905
50983
|
currentSourceIndex = 0;
|
|
@@ -50920,7 +50998,7 @@ class SourceController extends CorePlugin {
|
|
|
50920
50998
|
return { min: CLAPPR_VERSION };
|
|
50921
50999
|
}
|
|
50922
51000
|
/**
|
|
50923
|
-
* @
|
|
51001
|
+
* @param core - The Clappr core instance.
|
|
50924
51002
|
*/
|
|
50925
51003
|
constructor(core) {
|
|
50926
51004
|
super(core);
|
|
@@ -51064,7 +51142,7 @@ const T$2 = 'plugins.cc';
|
|
|
51064
51142
|
* @beta
|
|
51065
51143
|
*
|
|
51066
51144
|
* @remarks
|
|
51067
|
-
* The plugin is activated when closed captions tracks are
|
|
51145
|
+
* The plugin is activated when closed captions tracks are detected in the media source.
|
|
51068
51146
|
* It shows a familiar "CC" button with a dropdown menu to select the subtitles language.
|
|
51069
51147
|
*
|
|
51070
51148
|
* Depends on:
|
|
@@ -51081,7 +51159,7 @@ const T$2 = 'plugins.cc';
|
|
|
51081
51159
|
* new Player({
|
|
51082
51160
|
* ...
|
|
51083
51161
|
* cc: {
|
|
51084
|
-
* language: '
|
|
51162
|
+
* language: 'pt-BR',
|
|
51085
51163
|
* },
|
|
51086
51164
|
* })
|
|
51087
51165
|
* ```
|
|
@@ -52234,4 +52312,4 @@ class VolumeFade extends UICorePlugin {
|
|
|
52234
52312
|
}
|
|
52235
52313
|
}
|
|
52236
52314
|
|
|
52237
|
-
export { AudioSelector, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause, ClipsPlugin, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, LevelSelector, LogTracer, Logger, Logo, MediaControl,
|
|
52315
|
+
export { AudioSelector, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause, ClipsPlugin, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|