@gcorevideo/player 2.20.8 → 2.20.11
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/assets/dvr-controls/dvr_controls.scss +0 -2
- package/dist/core.js +22 -17
- package/dist/index.css +1343 -1346
- package/dist/index.js +119 -109
- package/dist/player.d.ts +238 -179
- package/dist/plugins/index.css +461 -464
- package/dist/plugins/index.js +97 -93
- package/docs/api/player.audioselector.md +1 -1
- package/docs/api/player.bigmutebutton.md +1 -1
- package/docs/api/player.bottomgear.md +15 -1
- package/docs/api/player.bottomgear.refresh.md +20 -0
- package/docs/api/player.clapprnerdstats.md +1 -1
- package/docs/api/player.clapprstats.exportmetrics.md +1 -1
- package/docs/api/player.clapprstats.md +1 -15
- package/docs/api/player.clapprstats.setupdatemetrics.md +2 -0
- package/docs/api/player.clicktopause.md +1 -1
- package/docs/api/player.clipsplugin.md +1 -1
- package/docs/api/player.clipspluginsettings.md +5 -2
- package/docs/api/player.clipspluginsettings.text.md +3 -0
- package/docs/api/player.containerpluginconstructor.md +17 -0
- package/docs/api/player.containersize.md +0 -3
- package/docs/api/player.contextmenu.md +1 -1
- package/docs/api/player.corepluginconstructor.md +17 -0
- package/docs/api/player.dashsettings.md +0 -3
- package/docs/api/player.dvrcontrols.md +2 -35
- package/docs/api/player.errorlevel.md +0 -3
- package/docs/api/player.errorscreen.md +1 -220
- package/docs/api/{player.errorscreen.render.md → player.errorscreenpluginsettings.md} +7 -7
- package/docs/api/player.favicon.md +1 -1
- package/docs/api/player.googleanalytics.md +1 -1
- package/docs/api/player.langtag.md +0 -3
- package/docs/api/player.levelselector.md +3 -9
- package/docs/api/{player.errorscreen.bindevents.md → player.levelselectorpluginsettings.labels.md} +11 -5
- package/docs/api/player.levelselectorpluginsettings.md +79 -0
- package/docs/api/{player.errorscreen.unbindevents.md → player.levelselectorpluginsettings.restrictresolution.md} +5 -7
- package/docs/api/player.logo.md +1 -1
- package/docs/api/player.md +131 -65
- package/docs/api/{player.errorscreen.container.md → player.mediacontrol.currentseekpos.md} +3 -3
- package/docs/api/player.mediacontrol.disable.md +1 -1
- package/docs/api/player.mediacontrol.md +24 -3
- package/docs/api/{player.gearevents.md → player.mediacontrolevents.md} +4 -4
- package/docs/api/player.multicamera.md +1 -29
- package/docs/api/player.pictureinpicture.md +1 -1
- package/docs/api/player.playbackerror.code.md +0 -3
- package/docs/api/player.playbackerror.description.md +0 -3
- package/docs/api/player.playbackerror.level.md +0 -3
- package/docs/api/player.playbackerror.md +25 -9
- package/docs/api/player.playbackerror.message.md +0 -3
- package/docs/api/player.playbackerror.origin.md +0 -3
- package/docs/api/player.playbackerror.scope.md +0 -3
- package/docs/api/player.playbackerror.ui.md +17 -0
- package/docs/api/player.playbackerrorcode.md +6 -9
- package/docs/api/player.playbackmodule.md +0 -3
- package/docs/api/{player.dvrcontrols._constructor_.md → player.playbackrate._constructor_.md} +3 -3
- package/docs/api/player.playbackrate.md +35 -2
- package/docs/api/player.playbacktype.md +1 -4
- package/docs/api/player.player._constructor_.md +0 -3
- package/docs/api/player.player.attachto.md +0 -3
- package/docs/api/player.player.configure.md +0 -3
- package/docs/api/player.player.destroy.md +0 -3
- package/docs/api/player.player.getcurrenttime.md +0 -3
- package/docs/api/player.player.getduration.md +0 -3
- package/docs/api/player.player.getvolume.md +0 -3
- package/docs/api/player.player.isdvrenabled.md +0 -3
- package/docs/api/player.player.isdvrinuse.md +0 -3
- package/docs/api/player.player.ismuted.md +0 -3
- package/docs/api/player.player.isplaying.md +0 -3
- package/docs/api/player.player.md +25 -28
- package/docs/api/player.player.mute.md +0 -3
- package/docs/api/player.player.off.md +0 -3
- package/docs/api/player.player.on.md +0 -3
- package/docs/api/player.player.pause.md +0 -3
- package/docs/api/player.player.play.md +0 -3
- package/docs/api/player.player.registerplugin.md +2 -5
- package/docs/api/player.player.resize.md +0 -3
- package/docs/api/player.player.seek.md +0 -3
- package/docs/api/player.player.setvolume.md +0 -3
- package/docs/api/player.player.stop.md +0 -3
- package/docs/api/player.player.unmute.md +0 -3
- package/docs/api/player.player.unregisterplugin.md +14 -7
- package/docs/api/player.playercomponenttype.md +0 -3
- package/docs/api/player.playerconfig.autoplay.md +0 -3
- package/docs/api/player.playerconfig.dash.md +0 -3
- package/docs/api/player.playerconfig.debug.md +0 -3
- package/docs/api/player.playerconfig.language.md +0 -3
- package/docs/api/player.playerconfig.loop.md +0 -3
- package/docs/api/player.playerconfig.md +10 -13
- package/docs/api/player.playerconfig.mute.md +0 -3
- package/docs/api/player.playerconfig.playbacktype.md +0 -3
- package/docs/api/player.playerconfig.prioritytransport.md +0 -3
- package/docs/api/player.playerconfig.sources.md +0 -3
- package/docs/api/player.playerconfig.strings.md +0 -3
- package/docs/api/player.playerdebugsettings.md +0 -3
- package/docs/api/player.playerdebugtag.md +0 -3
- package/docs/api/player.playerevent.md +11 -14
- package/docs/api/player.playereventhandler.md +0 -3
- package/docs/api/player.playereventparams.md +0 -3
- package/docs/api/player.playermediasource.md +0 -3
- package/docs/api/player.playermediasourcedesc.md +2 -5
- package/docs/api/player.playermediasourcedesc.mimetype.md +0 -3
- package/docs/api/player.playermediasourcedesc.source.md +0 -3
- package/docs/api/player.playerplugin.md +0 -4
- package/docs/api/player.playerpluginconstructor.md +14 -0
- package/docs/api/player.poster.md +1 -1
- package/docs/api/player.qualitylevel.bitrate.md +0 -3
- package/docs/api/player.qualitylevel.height.md +0 -3
- package/docs/api/player.qualitylevel.level.md +0 -3
- package/docs/api/player.qualitylevel.md +4 -7
- package/docs/api/player.qualitylevel.width.md +0 -3
- package/docs/api/player.seektime.md +1 -1
- package/docs/api/player.share.attributes.md +3 -0
- package/docs/api/player.share.bindevents.md +3 -0
- package/docs/api/player.share.canshowshare.md +3 -0
- package/docs/api/player.share.events.md +3 -0
- package/docs/api/player.share.hideshare.md +3 -0
- package/docs/api/player.share.initializeicons.md +3 -0
- package/docs/api/player.share.md +40 -1
- package/docs/api/player.share.name.md +3 -0
- package/docs/api/player.share.onshareembedclick.md +3 -0
- package/docs/api/player.share.onsharefb.md +3 -0
- package/docs/api/player.share.onsharehide.md +3 -0
- package/docs/api/player.share.onsharelinkclick.md +3 -0
- package/docs/api/player.share.onshareshow.md +3 -0
- package/docs/api/player.share.onsharetw.md +3 -0
- package/docs/api/player.share.render.md +3 -0
- package/docs/api/player.share.showshare.md +3 -0
- package/docs/api/player.share.supportedversion.md +3 -0
- package/docs/api/player.share.template.md +3 -0
- package/docs/api/player.share.unbindevents.md +3 -0
- package/docs/api/player.skiptime.attributes.md +3 -0
- package/docs/api/player.skiptime.bindevents.md +3 -0
- package/docs/api/player.skiptime.container.md +3 -0
- package/docs/api/player.skiptime.events.md +3 -0
- package/docs/api/player.skiptime.handlerewindclicks.md +3 -0
- package/docs/api/player.skiptime.md +30 -1
- package/docs/api/player.skiptime.name.md +3 -0
- package/docs/api/player.skiptime.render.md +3 -0
- package/docs/api/player.skiptime.setback.md +3 -0
- package/docs/api/player.skiptime.setforward.md +3 -0
- package/docs/api/player.skiptime.setmidclick.md +3 -0
- package/docs/api/player.skiptime.supportedversion.md +3 -0
- package/docs/api/player.skiptime.template.md +3 -0
- package/docs/api/player.skiptime.togglefullscreen.md +3 -0
- package/docs/api/player.sourcecontroller.md +1 -1
- package/docs/api/player.spinnerevents.md +4 -1
- package/docs/api/player.spinnerthreebounce.hide.md +1 -1
- package/docs/api/player.spinnerthreebounce.md +7 -5
- package/docs/api/player.spinnerthreebounce.show.md +40 -2
- package/docs/api/player.subtitles.md +1 -1
- package/docs/api/player.telemetry.md +1 -1
- package/docs/api/player.telemetrypluginsettings.md +1 -1
- package/docs/api/{player.errorscreen.hide.md → player.telemetrysendfn.md} +6 -6
- package/docs/api/player.thumbnails.md +1 -1
- package/docs/api/player.timeposition.current.md +0 -3
- package/docs/api/player.timeposition.md +2 -5
- package/docs/api/player.timeposition.total.md +0 -3
- package/docs/api/player.timevalue.md +0 -3
- package/docs/api/player.translationkey.md +0 -3
- package/docs/api/player.translationsettings.md +0 -3
- package/docs/api/player.transportpreference.md +2 -7
- package/docs/api/player.volumefade.md +1 -1
- package/lib/Player.d.ts +18 -9
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +19 -14
- package/lib/index.core.d.ts +0 -1
- package/lib/index.core.d.ts.map +1 -1
- package/lib/index.core.js +0 -1
- package/lib/index.d.ts +18 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +18 -1
- package/lib/index.plugins.d.ts +0 -1
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +0 -1
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +1 -1
- package/lib/playback.types.d.ts +8 -7
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/playback.types.js +1 -1
- package/lib/plugins/audio-selector/AudioSelector.d.ts +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +1 -1
- 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/big-mute-button/BigMuteButton.js +1 -2
- package/lib/plugins/bottom-gear/BottomGear.d.ts +2 -2
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +1 -1
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +8 -8
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +4 -5
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/ClapprStats.js +4 -3
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
- package/lib/plugins/clips/Clips.d.ts +3 -2
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +1 -1
- package/lib/plugins/context-menu/ContextMenu.d.ts +1 -1
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.js +1 -1
- package/lib/plugins/dvr-controls/DvrControls.d.ts +7 -4
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +29 -36
- package/lib/plugins/error-screen/ErrorScreen.d.ts +8 -14
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +1 -1
- package/lib/plugins/favicon/Favicon.d.ts +1 -1
- package/lib/plugins/favicon/Favicon.js +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.js +1 -1
- package/lib/plugins/index.d.ts +0 -1
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/plugins/index.js +0 -1
- package/lib/plugins/kibo/index.d.ts +0 -3
- package/lib/plugins/kibo/index.d.ts.map +1 -1
- package/lib/plugins/kibo/index.js +0 -3
- package/lib/plugins/level-selector/LevelSelector.d.ts +6 -4
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +2 -4
- package/lib/plugins/logo/Logo.d.ts +1 -1
- package/lib/plugins/logo/Logo.js +1 -1
- package/lib/plugins/media-control/MediaControl.d.ts +11 -5
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +17 -5
- package/lib/plugins/multi-camera/MultiCamera.d.ts +3 -11
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.js +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +1 -1
- package/lib/plugins/poster/Poster.d.ts +1 -1
- package/lib/plugins/poster/Poster.js +3 -3
- package/lib/plugins/seek-time/SeekTime.d.ts +1 -1
- package/lib/plugins/seek-time/SeekTime.js +1 -1
- package/lib/plugins/share/Share.d.ts +2 -1
- package/lib/plugins/share/Share.d.ts.map +1 -1
- package/lib/plugins/share/Share.js +2 -1
- package/lib/plugins/skip-time/SkipTime.d.ts +2 -1
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
- package/lib/plugins/skip-time/SkipTime.js +2 -1
- package/lib/plugins/source-controller/SourceController.d.ts +1 -1
- package/lib/plugins/source-controller/SourceController.js +4 -4
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +6 -3
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +6 -3
- package/lib/plugins/subtitles/Subtitles.d.ts +1 -1
- package/lib/plugins/subtitles/Subtitles.js +1 -1
- package/lib/plugins/telemetry/Telemetry.d.ts +2 -3
- package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -1
- package/lib/plugins/telemetry/Telemetry.js +1 -1
- package/lib/plugins/thumbnails/Thumbnails.d.ts +1 -1
- package/lib/plugins/thumbnails/Thumbnails.js +1 -1
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -1
- package/lib/plugins/vast-ads/VastAds.js +3 -3
- 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/plugins/vast-ads/rollmanager.js +2 -2
- package/lib/plugins/volume-fade/VolumeFade.d.ts +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +1 -1
- package/lib/testUtils.d.ts +11 -2
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +22 -3
- package/lib/types.d.ts +38 -27
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +1 -1
- package/lib/utils/types.d.ts +0 -6
- package/lib/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Player.ts +23 -21
- package/src/index.core.ts +0 -1
- package/src/index.plugins.ts +0 -1
- package/src/index.ts +18 -1
- package/src/playback/hls-playback/HlsPlayback.ts +7 -11
- package/src/playback.types.ts +8 -7
- package/src/plugins/audio-selector/AudioSelector.ts +2 -2
- package/src/plugins/big-mute-button/BigMuteButton.ts +2 -3
- package/src/plugins/bottom-gear/BottomGear.ts +2 -2
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +2 -2
- package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +184 -187
- package/src/plugins/clappr-stats/ClapprStats.ts +5 -4
- package/src/plugins/click-to-pause/ClickToPause.ts +1 -1
- package/src/plugins/clips/Clips.ts +4 -3
- package/src/plugins/context-menu/ContextMenu.ts +1 -3
- package/src/plugins/dvr-controls/DvrControls.ts +34 -45
- package/src/plugins/dvr-controls/__tests__/DvrControls.test.ts +91 -0
- package/src/plugins/dvr-controls/__tests__/__snapshots__/DvrControls.test.ts.snap +43 -0
- package/src/plugins/error-screen/ErrorScreen.ts +10 -17
- package/src/plugins/favicon/Favicon.ts +2 -2
- package/src/plugins/google-analytics/GoogleAnalytics.ts +1 -1
- package/src/plugins/index.ts +0 -1
- package/src/plugins/kibo/index.ts +0 -3
- package/src/plugins/level-selector/LevelSelector.ts +7 -5
- package/src/plugins/logo/Logo.ts +2 -2
- package/src/plugins/media-control/MediaControl.ts +20 -6
- package/src/plugins/multi-camera/MultiCamera.ts +4 -4
- package/src/plugins/picture-in-picture/PictureInPicture.ts +1 -1
- package/src/plugins/playback-rate/PlaybackRate.ts +2 -2
- package/src/plugins/poster/Poster.ts +4 -4
- package/src/plugins/seek-time/SeekTime.ts +2 -2
- package/src/plugins/share/Share.ts +2 -1
- package/src/plugins/skip-time/SkipTime.ts +2 -1
- package/src/plugins/source-controller/SourceController.ts +4 -4
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +2 -2
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +6 -3
- package/src/plugins/subtitles/Subtitles.ts +2 -2
- package/src/plugins/telemetry/Telemetry.ts +2 -2
- package/src/plugins/thumbnails/Thumbnails.ts +2 -2
- package/src/plugins/vast-ads/VastAds.ts +5 -4
- package/src/plugins/vast-ads/roll.ts +2 -1
- package/src/plugins/vast-ads/rollmanager.ts +3 -3
- package/src/plugins/volume-fade/VolumeFade.ts +1 -1
- package/src/testUtils.ts +28 -4
- package/src/types.ts +41 -28
- package/src/utils/types.ts +0 -8
- package/temp/player.api.json +680 -786
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.clapprstats.onbitrate.md +0 -52
- package/docs/api/player.errorscreen.attributes.md +0 -17
- package/docs/api/player.errorscreen.name.md +0 -14
- package/docs/api/player.errorscreen.show.md +0 -54
- package/docs/api/player.errorscreen.supportedversion.md +0 -16
- package/docs/api/player.errorscreen.template.md +0 -14
- package/docs/api/player.mediatransport.md +0 -16
- package/docs/api/player.multicamera.getcameraslist.md +0 -18
- package/docs/api/player.multicamera.getcurrentcamera.md +0 -18
|
@@ -8,7 +8,8 @@ import '../../../assets/skip-time/style.scss';
|
|
|
8
8
|
type Position = 'mid' | 'left' | 'right';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* `PLUGIN` that adds skip controls to the media control UI.
|
|
12
|
+
* @beta
|
|
12
13
|
*/
|
|
13
14
|
export class SkipTime extends UICorePluginOriginal {
|
|
14
15
|
get name() {
|
|
@@ -27,7 +27,7 @@ function noSync(cb: () => void) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* `PLUGIN` that is responsible for managing the automatic failover between sources.
|
|
31
31
|
* @beta
|
|
32
32
|
* @remarks
|
|
33
33
|
* Have a look at the {@link https://miro.com/app/board/uXjVLiN15tY=/?share_link_id=390327585787 | source failover diagram} for the details
|
|
@@ -153,7 +153,7 @@ export class SourceController extends CorePlugin {
|
|
|
153
153
|
}
|
|
154
154
|
this.bindContainerEventListeners()
|
|
155
155
|
if (this.active) {
|
|
156
|
-
this.core.activeContainer?.getPlugin('
|
|
156
|
+
this.core.activeContainer?.getPlugin('poster')?.disable()
|
|
157
157
|
spinner?.show(0)
|
|
158
158
|
}
|
|
159
159
|
}
|
|
@@ -177,7 +177,7 @@ export class SourceController extends CorePlugin {
|
|
|
177
177
|
}
|
|
178
178
|
switch (error.code) {
|
|
179
179
|
case PlaybackErrorCode.MediaSourceUnavailable:
|
|
180
|
-
this.core.activeContainer?.getPlugin('
|
|
180
|
+
this.core.activeContainer?.getPlugin('poster')?.disable()
|
|
181
181
|
this.retryPlayback()
|
|
182
182
|
break
|
|
183
183
|
default:
|
|
@@ -192,7 +192,7 @@ export class SourceController extends CorePlugin {
|
|
|
192
192
|
})
|
|
193
193
|
if (this.active) {
|
|
194
194
|
this.reset()
|
|
195
|
-
this.core.activeContainer?.getPlugin('
|
|
195
|
+
this.core.activeContainer?.getPlugin('poster')?.enable()
|
|
196
196
|
this.core.activeContainer?.getPlugin('spinner')?.hide()
|
|
197
197
|
}
|
|
198
198
|
})
|
|
@@ -116,7 +116,7 @@ describe('SourceController', () => {
|
|
|
116
116
|
poster = createMockPlugin()
|
|
117
117
|
spinner = createSpinnerPlugin()
|
|
118
118
|
core.activeContainer.getPlugin.mockImplementation((name: string) => {
|
|
119
|
-
if (name === '
|
|
119
|
+
if (name === 'poster') {
|
|
120
120
|
return poster
|
|
121
121
|
}
|
|
122
122
|
if (name === 'spinner') {
|
|
@@ -183,7 +183,7 @@ describe('SourceController', () => {
|
|
|
183
183
|
poster = createMockPlugin()
|
|
184
184
|
spinner = createSpinnerPlugin()
|
|
185
185
|
core.activeContainer.getPlugin.mockImplementation((name: string) => {
|
|
186
|
-
if (name === '
|
|
186
|
+
if (name === 'poster') {
|
|
187
187
|
return poster
|
|
188
188
|
}
|
|
189
189
|
if (name === 'spinner') {
|
|
@@ -20,6 +20,7 @@ const T = 'plugins.spinner'
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Custom events emitted by the plugin
|
|
23
|
+
* @beta
|
|
23
24
|
*/
|
|
24
25
|
export enum SpinnerEvents {
|
|
25
26
|
/**
|
|
@@ -30,10 +31,12 @@ export enum SpinnerEvents {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* `PLUGIN` that shows a pending operation indicator when playback is buffering or in a similar state
|
|
34
35
|
* @beta
|
|
35
36
|
* @remarks
|
|
36
|
-
*
|
|
37
|
+
* Events emitted- {@link SpinnerEvents}
|
|
38
|
+
* Other plugins can use {@link SpinnerThreeBounce.show | show} and {@link SpinnerThreeBounce.hide | hide} methods to
|
|
39
|
+
* implement custom pending/progress indication scenarios.
|
|
37
40
|
*/
|
|
38
41
|
export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
39
42
|
private userShown = false
|
|
@@ -134,7 +137,7 @@ export class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
134
137
|
/**
|
|
135
138
|
* Shows the spinner.
|
|
136
139
|
*
|
|
137
|
-
* When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce
|
|
140
|
+
* When called, the spinner will not hide (due to its built-in logic) until {@link SpinnerThreeBounce.hide} is called
|
|
138
141
|
*/
|
|
139
142
|
show(delay = 300) {
|
|
140
143
|
trace(`${T} show`)
|
|
@@ -17,7 +17,7 @@ import comboboxHTML from '../../../assets/subtitles/combobox.ejs'
|
|
|
17
17
|
import stringHTML from '../../../assets/subtitles/string.ejs'
|
|
18
18
|
|
|
19
19
|
import { isFullscreen } from '../utils.js'
|
|
20
|
-
import type { ZeptoResult } from '../../
|
|
20
|
+
import type { ZeptoResult } from '../../types.js'
|
|
21
21
|
|
|
22
22
|
const VERSION: string = '2.19.14'
|
|
23
23
|
|
|
@@ -34,7 +34,7 @@ type TextTrackInfo = {
|
|
|
34
34
|
const NO_TRACK = { language: 'off' }
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* `PLUGIN` that provides a UI to select the subtitles when available.
|
|
38
38
|
* @beta
|
|
39
39
|
*
|
|
40
40
|
* @remarks
|
|
@@ -77,7 +77,7 @@ export type TelemetryRecord = {
|
|
|
77
77
|
* @param data - The telemetry record to send.
|
|
78
78
|
* @beta
|
|
79
79
|
*/
|
|
80
|
-
type TelemetrySendFn = (data: TelemetryRecord) => void
|
|
80
|
+
export type TelemetrySendFn = (data: TelemetryRecord) => void
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Plugin settings
|
|
@@ -103,7 +103,7 @@ export enum TelemetryEvent {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
106
|
+
* `PLUGIN` that collects and reports the performance statistics.
|
|
107
107
|
* @beta
|
|
108
108
|
* @remarks
|
|
109
109
|
* This plugin is experimental and its API is likely to change.
|
|
@@ -8,7 +8,7 @@ import { CLAPPR_VERSION } from '../../build.js'
|
|
|
8
8
|
|
|
9
9
|
import pluginHtml from '../../../assets/thumbnails/scrub-thumbnails.ejs'
|
|
10
10
|
import '../../../assets/thumbnails/style.scss'
|
|
11
|
-
import { ZeptoResult } from '../../
|
|
11
|
+
import { ZeptoResult } from '../../types.js'
|
|
12
12
|
import { getPageX } from '../utils.js'
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -38,7 +38,7 @@ type Thumb = {
|
|
|
38
38
|
const T = 'plugins.thumbnails'
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* `PLUGIN` that displays the thumbnails of the video when available.
|
|
42
42
|
* @beta
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
@@ -16,7 +16,8 @@ import assert from 'assert'
|
|
|
16
16
|
import { TimePosition } from '../../playback.types.js'
|
|
17
17
|
|
|
18
18
|
import { CLAPPR_VERSION } from '../../build.js'
|
|
19
|
-
import {
|
|
19
|
+
import { ZeptoResult } from '../../types.js'
|
|
20
|
+
import { TimerId } from '../../utils/types.js'
|
|
20
21
|
import RollManager from './rollmanager.js'
|
|
21
22
|
import SCTEManager from './sctemanager.js'
|
|
22
23
|
import { VolumeFadeEvents } from '../volume-fade/VolumeFade.js'
|
|
@@ -286,7 +287,7 @@ export class VastAds extends UICorePlugin {
|
|
|
286
287
|
|
|
287
288
|
private onPlaybackPlay() {
|
|
288
289
|
setTimeout(() => {
|
|
289
|
-
const posterPlugin = this.container?.getPlugin('
|
|
290
|
+
const posterPlugin = this.container?.getPlugin('poster')
|
|
290
291
|
|
|
291
292
|
posterPlugin?.enable()
|
|
292
293
|
posterPlugin?.$el.hide()
|
|
@@ -618,7 +619,7 @@ export class VastAds extends UICorePlugin {
|
|
|
618
619
|
this._pluginError('failed to get Clappr playback')
|
|
619
620
|
}
|
|
620
621
|
// Attempt to get poster plugin. (May interfere with media control)
|
|
621
|
-
this._posterPlugin = this._container?.getPlugin('
|
|
622
|
+
this._posterPlugin = this._container?.getPlugin('poster')
|
|
622
623
|
|
|
623
624
|
// Attempt to get click-to-pause plugin. (May interfere with advert click handling)
|
|
624
625
|
this._clickToPausePlugin = this._container?.getPlugin(
|
|
@@ -721,7 +722,7 @@ export class VastAds extends UICorePlugin {
|
|
|
721
722
|
|
|
722
723
|
private adsPlaying() {
|
|
723
724
|
assert(this.container, 'container is not defined')
|
|
724
|
-
const poster = this.container.getPlugin('
|
|
725
|
+
const poster = this.container.getPlugin('poster')
|
|
725
726
|
|
|
726
727
|
poster && poster.disable()
|
|
727
728
|
try {
|
|
@@ -3,7 +3,8 @@ import { $, Container, Core, Events, Log, Playback } from '@clappr/core';
|
|
|
3
3
|
import { reportError } from '@gcorevideo/utils';
|
|
4
4
|
import assert from 'assert';
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { ZeptoResult } from '../../types.js';
|
|
7
|
+
import type { TimerId } from '../../utils/types.js';
|
|
7
8
|
|
|
8
9
|
type RollConstructorOptions = {
|
|
9
10
|
core: Core;
|
|
@@ -4,7 +4,7 @@ import assert from 'assert';
|
|
|
4
4
|
|
|
5
5
|
import LoaderXML from './loaderxml.js';
|
|
6
6
|
import Roll from './roll.js';
|
|
7
|
-
import { ZeptoResult } from '../../
|
|
7
|
+
import { ZeptoResult } from '../../types.js';
|
|
8
8
|
import { AdRollDesc, AdRollItem, AdRollType, VastAdsOptions } from './types.js';
|
|
9
9
|
|
|
10
10
|
type CoreOptions = Record<string, unknown>;
|
|
@@ -71,7 +71,7 @@ export default class RollManager extends Events {
|
|
|
71
71
|
this.$areaClick = $areaClick;
|
|
72
72
|
this._playback = this.core.activePlayback;
|
|
73
73
|
this._contentElement = this._playback.el as HTMLMediaElement;
|
|
74
|
-
this._posterPlugin = this._container.getPlugin('
|
|
74
|
+
this._posterPlugin = this._container.getPlugin('poster');
|
|
75
75
|
this._clickToPausePlugin = this._container.getPlugin('click_to_pause_custom');
|
|
76
76
|
this._adContainer = _adContainer;
|
|
77
77
|
this._events = {};
|
|
@@ -210,7 +210,7 @@ export default class RollManager extends Events {
|
|
|
210
210
|
//чтобы реклама шла одна за другой
|
|
211
211
|
this._allURLRequest = !!roll.oneByOne;
|
|
212
212
|
try {
|
|
213
|
-
const customPosterPlugin = this.container.getPlugin('
|
|
213
|
+
const customPosterPlugin = this.container.getPlugin('poster');
|
|
214
214
|
|
|
215
215
|
customPosterPlugin.hidePlayButton();
|
|
216
216
|
} catch (error) {
|
package/src/testUtils.ts
CHANGED
|
@@ -82,7 +82,10 @@ export class _MockPlayback extends Events {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export function createMockCore(
|
|
85
|
+
export function createMockCore(
|
|
86
|
+
options: Record<string, unknown> = {},
|
|
87
|
+
container: any = createMockContainer(),
|
|
88
|
+
) {
|
|
86
89
|
const el = document.createElement('div')
|
|
87
90
|
const emitter = new Events()
|
|
88
91
|
return Object.assign(emitter, {
|
|
@@ -90,10 +93,14 @@ export function createMockCore(options: Record<string, unknown> = {}, container:
|
|
|
90
93
|
$el: $(el),
|
|
91
94
|
activePlayback: container.playback,
|
|
92
95
|
activeContainer: container,
|
|
96
|
+
i18n: {
|
|
97
|
+
t: vi.fn().mockImplementation((key: string) => key),
|
|
98
|
+
},
|
|
93
99
|
options: {
|
|
94
100
|
...options,
|
|
95
101
|
},
|
|
96
102
|
configure: vi.fn(),
|
|
103
|
+
getPlaybackType: vi.fn(),
|
|
97
104
|
getPlugin: vi.fn(),
|
|
98
105
|
load: vi.fn(),
|
|
99
106
|
trigger: emitter.emit,
|
|
@@ -165,20 +172,37 @@ export function createMockPlayback(name = 'mock') {
|
|
|
165
172
|
|
|
166
173
|
export function createMockContainer(playback: any = createMockPlayback()) {
|
|
167
174
|
const el = document.createElement('div')
|
|
168
|
-
|
|
169
|
-
|
|
175
|
+
const emitter = new Events()
|
|
176
|
+
return Object.assign(emitter, {
|
|
170
177
|
el,
|
|
171
|
-
getPlugin: vi.fn(),
|
|
172
178
|
playback,
|
|
179
|
+
$el: $(el),
|
|
180
|
+
getDuration: vi.fn().mockReturnValue(0),
|
|
181
|
+
getPlugin: vi.fn(),
|
|
182
|
+
isPlaying: vi.fn().mockReturnValue(false),
|
|
183
|
+
play: vi.fn(),
|
|
184
|
+
seek: vi.fn(),
|
|
185
|
+
trigger: emitter.emit,
|
|
173
186
|
})
|
|
174
187
|
}
|
|
175
188
|
|
|
176
189
|
export function createMockMediaControl(core: any) {
|
|
177
190
|
const mediaControl = new UICorePlugin(core)
|
|
191
|
+
mediaControl.$el.html(
|
|
192
|
+
`<div class="media-control-left-panel" data-media-control></div>
|
|
193
|
+
<div class="media-control-right-panel" data-media-control></div>
|
|
194
|
+
<div class="media-control-center-panel" data-media-control></div>`,
|
|
195
|
+
)
|
|
178
196
|
const elements = {
|
|
179
197
|
gear: $(document.createElement('div')),
|
|
180
198
|
}
|
|
181
199
|
// @ts-ignore
|
|
182
200
|
mediaControl.getElement = vi.fn().mockImplementation((name) => elements[name])
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
mediaControl.getLeftPanel = vi.fn().mockImplementation(() => mediaControl.$el.find('.media-control-left-panel'))
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
mediaControl.getRightPanel = vi.fn().mockImplementation(() => mediaControl.$el.find('.media-control-right-panel'))
|
|
205
|
+
// @ts-ignore
|
|
206
|
+
mediaControl.getCenterPanel = vi.fn().mockImplementation(() => mediaControl.$el.find('.media-control-center-panel'))
|
|
183
207
|
return mediaControl
|
|
184
208
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { $, Container, Core } from "@clappr/core";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Describes a media source with its MIME type and URL.
|
|
3
5
|
*
|
|
4
6
|
* @remarks
|
|
5
7
|
* When the MIME type is provided, it helps the player determine the appropriate playback engine.
|
|
6
8
|
* If omitted, the player will attempt to detect the type from the source URL extension.
|
|
7
|
-
* @
|
|
9
|
+
* @public
|
|
8
10
|
*/
|
|
9
11
|
export interface PlayerMediaSourceDesc {
|
|
10
12
|
/**
|
|
@@ -21,57 +23,62 @@ export interface PlayerMediaSourceDesc {
|
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* A media source to fetch the media data from
|
|
24
|
-
* @
|
|
26
|
+
* @public
|
|
25
27
|
*/
|
|
26
28
|
export type PlayerMediaSource = string | PlayerMediaSourceDesc
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* Debug output category selector
|
|
30
|
-
* @
|
|
32
|
+
* @public
|
|
31
33
|
*/
|
|
32
34
|
export type PlayerDebugTag = 'all' | 'clappr' | 'dash' | 'hls' | 'none'
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* @remarks `true` is equivalent to `'all'`, `false` is equivalent to `'none'`
|
|
36
|
-
* @
|
|
38
|
+
* @public
|
|
37
39
|
*/
|
|
38
40
|
export type PlayerDebugSettings = PlayerDebugTag | boolean
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
|
-
* Type of a stream
|
|
42
|
-
* @
|
|
43
|
+
* Type of a stream
|
|
44
|
+
* @public
|
|
43
45
|
*/
|
|
44
46
|
export type PlaybackType = 'live' | 'vod'
|
|
45
47
|
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @
|
|
49
|
+
* Preferred streaming media delivery protocol
|
|
50
|
+
* @public
|
|
49
51
|
*/
|
|
50
|
-
export type
|
|
52
|
+
export type TransportPreference = 'dash' | 'hls'
|
|
51
53
|
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
54
|
-
* @beta
|
|
55
|
-
*/
|
|
56
|
-
export type TransportPreference = MediaTransport
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @beta
|
|
55
|
+
* @public
|
|
60
56
|
* @see {@link https://clappr.github.io/classes/UIContainerPlugin.html},
|
|
61
57
|
* {@link https://clappr.github.io/classes/ContainerPlugin.html}
|
|
62
58
|
*/
|
|
63
59
|
export type PlayerPlugin = {
|
|
64
|
-
new (...args: any[]): unknown
|
|
65
60
|
name: string
|
|
66
61
|
}
|
|
67
62
|
|
|
63
|
+
/**
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
68
66
|
export type PlayerPluginConstructor = CorePluginConstructor | ContainerPluginConstructor
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export type CorePluginConstructor = {
|
|
72
|
+
new (core: Core): PlayerPlugin
|
|
73
|
+
type: string // 'core', but it's a nuisance to type it in the plugins definition
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
/**
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export type ContainerPluginConstructor = {
|
|
80
|
+
new (container: Container): PlayerPlugin
|
|
81
|
+
type: string // 'container', but it's a nuisance to type it in the plugins definition
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
/**
|
|
@@ -113,7 +120,7 @@ export type ContainerPluginConstructor = ((container: unknown) => PlayerPlugin)
|
|
|
113
120
|
* },
|
|
114
121
|
* }
|
|
115
122
|
* ```
|
|
116
|
-
* @
|
|
123
|
+
* @public
|
|
117
124
|
*/
|
|
118
125
|
export interface PlayerConfig extends Record<string, unknown> {
|
|
119
126
|
/**
|
|
@@ -181,18 +188,18 @@ export interface PlayerConfig extends Record<string, unknown> {
|
|
|
181
188
|
/**
|
|
182
189
|
* An ISO 639-1 language code.
|
|
183
190
|
* @example `pt`
|
|
184
|
-
* @
|
|
191
|
+
* @public
|
|
185
192
|
*/
|
|
186
193
|
export type LangTag = string
|
|
187
194
|
|
|
188
195
|
/**
|
|
189
|
-
* @
|
|
196
|
+
* @public
|
|
190
197
|
*/
|
|
191
198
|
export type TranslationKey = string
|
|
192
199
|
|
|
193
200
|
/**
|
|
194
201
|
* A plain JS object that must conform to the DASH.js settings schema.
|
|
195
|
-
* @
|
|
202
|
+
* @public
|
|
196
203
|
* {@link https://cdn.dashjs.org/latest/jsdoc/module-Settings.html | DASH.js settings}
|
|
197
204
|
*/
|
|
198
205
|
export type DashSettings = Record<string, unknown>
|
|
@@ -219,7 +226,7 @@ export type DashSettings = Record<string, unknown>
|
|
|
219
226
|
* }
|
|
220
227
|
* ```
|
|
221
228
|
*
|
|
222
|
-
* @
|
|
229
|
+
* @public
|
|
223
230
|
*/
|
|
224
231
|
export type TranslationSettings = Partial<
|
|
225
232
|
Record<LangTag, Record<TranslationKey, string>>
|
|
@@ -227,7 +234,7 @@ export type TranslationSettings = Partial<
|
|
|
227
234
|
|
|
228
235
|
/**
|
|
229
236
|
* Dimensions of the player container DOM element.
|
|
230
|
-
* @
|
|
237
|
+
* @public
|
|
231
238
|
*/
|
|
232
239
|
export type ContainerSize = {
|
|
233
240
|
width: number
|
|
@@ -236,7 +243,7 @@ export type ContainerSize = {
|
|
|
236
243
|
|
|
237
244
|
/**
|
|
238
245
|
* A top-level event on the player object
|
|
239
|
-
* @
|
|
246
|
+
* @public
|
|
240
247
|
*/
|
|
241
248
|
export enum PlayerEvent {
|
|
242
249
|
/**
|
|
@@ -289,3 +296,9 @@ export enum PlayerEvent {
|
|
|
289
296
|
*/
|
|
290
297
|
VolumeUpdate = 'volumeupdate',
|
|
291
298
|
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* {@link https://zeptojs.com/#$() | Zepto query result}
|
|
302
|
+
* @beta
|
|
303
|
+
*/
|
|
304
|
+
export type ZeptoResult = ReturnType<typeof $>;
|