@gcorevideo/player 2.19.15 → 2.20.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/assets/level-selector/list.ejs +1 -1
- package/dist/core.js +2 -2
- package/dist/index.css +966 -966
- package/dist/index.js +884 -627
- package/dist/player.d.ts +536 -122
- package/dist/plugins/index.css +1160 -1160
- package/dist/plugins/index.js +2006 -1725
- package/docs/api/player.audioselector.md +1 -251
- package/docs/api/player.bigmutebutton.md +1 -156
- package/docs/api/player.clapprnerdstats.md +12 -259
- package/docs/api/player.clapprstats.exportmetrics.md +4 -0
- package/docs/api/player.clapprstats.md +7 -223
- package/docs/api/player.clapprstats.setupdatemetrics.md +2 -0
- package/docs/api/player.clicktopause.md +5 -113
- package/docs/api/player.clipsplugin.gettext.md +9 -0
- package/docs/api/player.clipsplugin.md +10 -94
- package/docs/api/{player.playbackrate.setselectedrate.md → player.clipspluginsettings.md} +18 -10
- package/docs/api/player.clipspluginsettings.text.md +13 -0
- package/docs/api/player.contextmenu._constructor_.md +6 -3
- package/docs/api/player.contextmenu.md +13 -256
- package/docs/api/player.contextmenupluginsettings.label.md +11 -0
- package/docs/api/player.contextmenupluginsettings.md +93 -0
- package/docs/api/player.contextmenupluginsettings.preventshowcontextmenu.md +11 -0
- package/docs/api/player.contextmenupluginsettings.url.md +11 -0
- package/docs/api/player.dvrcontrols.md +5 -1
- package/docs/api/player.errorscreen.attributes.md +3 -0
- package/docs/api/player.errorscreen.bindevents.md +3 -0
- package/docs/api/player.errorscreen.container.md +3 -0
- package/docs/api/player.errorscreen.hide.md +3 -0
- package/docs/api/player.errorscreen.md +25 -0
- package/docs/api/player.errorscreen.name.md +3 -0
- package/docs/api/player.errorscreen.render.md +3 -0
- package/docs/api/player.errorscreen.show.md +3 -0
- package/docs/api/player.errorscreen.supportedversion.md +3 -0
- package/docs/api/player.errorscreen.template.md +3 -0
- package/docs/api/player.errorscreen.unbindevents.md +3 -0
- package/docs/api/player.favicon._constructor_.md +3 -0
- package/docs/api/player.favicon.bindevents.md +3 -0
- package/docs/api/player.favicon.configure.md +3 -0
- package/docs/api/player.favicon.destroy.md +3 -0
- package/docs/api/player.favicon.disable.md +3 -0
- package/docs/api/player.favicon.md +18 -1
- package/docs/api/player.favicon.name.md +3 -0
- package/docs/api/player.favicon.supportedversion.md +3 -0
- package/docs/api/player.gearevents.md +4 -1
- package/docs/api/player.googleanalytics._constructor_.md +3 -0
- package/docs/api/player.googleanalytics.addeventlisteners.md +3 -0
- package/docs/api/player.googleanalytics.embedscript.md +3 -0
- package/docs/api/player.googleanalytics.md +42 -1
- package/docs/api/player.googleanalytics.name.md +3 -0
- package/docs/api/player.googleanalytics.onbufferfull.md +3 -0
- package/docs/api/player.googleanalytics.onbuffering.md +3 -0
- package/docs/api/player.googleanalytics.ondvr.md +3 -0
- package/docs/api/player.googleanalytics.onended.md +3 -0
- package/docs/api/player.googleanalytics.onerror.md +3 -0
- package/docs/api/player.googleanalytics.onfullscreen.md +3 -0
- package/docs/api/player.googleanalytics.onhd.md +3 -0
- package/docs/api/player.googleanalytics.onpause.md +3 -0
- package/docs/api/player.googleanalytics.onplay.md +3 -0
- package/docs/api/player.googleanalytics.onready.md +3 -0
- package/docs/api/player.googleanalytics.onseek.md +3 -0
- package/docs/api/player.googleanalytics.onstop.md +3 -0
- package/docs/api/player.googleanalytics.onvolumechanged.md +3 -0
- package/docs/api/player.googleanalytics.push.md +3 -0
- package/docs/api/player.googleanalytics.supportedversion.md +3 -0
- package/docs/api/{player.clapprstats.name.md → player.initeventdata.event.md} +3 -3
- package/docs/api/player.initeventdata.md +60 -0
- package/docs/api/player.logo._constructor_.md +3 -0
- package/docs/api/player.logo.attributes.md +3 -0
- package/docs/api/player.logo.bindevents.md +3 -0
- package/docs/api/player.logo.md +20 -1
- package/docs/api/player.logo.name.md +3 -0
- package/docs/api/player.logo.render.md +3 -0
- package/docs/api/player.logo.stoplistening.md +3 -0
- package/docs/api/player.logo.supportedversion.md +3 -0
- package/docs/api/player.logo.template.md +3 -0
- package/docs/api/player.md +149 -18
- package/docs/api/player.mediacontrolelement.md +1 -1
- package/docs/api/player.multicamera.md +2 -0
- package/docs/api/player.pictureinpicture.md +9 -197
- package/docs/api/player.playbackrate.md +10 -314
- package/docs/api/player.seektime.attributes.md +3 -0
- package/docs/api/player.seektime.bindevents.md +3 -0
- package/docs/api/player.seektime.durationshown.md +3 -0
- package/docs/api/player.seektime.getseektime.md +3 -0
- package/docs/api/player.seektime.islivestreamwithdvr.md +3 -0
- package/docs/api/player.seektime.md +31 -0
- package/docs/api/player.seektime.mediacontrol.md +3 -0
- package/docs/api/player.seektime.mediacontrolcontainer.md +3 -0
- package/docs/api/player.seektime.name.md +3 -0
- package/docs/api/player.seektime.render.md +3 -0
- package/docs/api/player.seektime.shouldbevisible.md +3 -0
- package/docs/api/player.seektime.supportedversion.md +3 -0
- package/docs/api/player.seektime.template.md +3 -0
- package/docs/api/player.seektime.update.md +3 -0
- package/docs/api/player.share.md +2 -0
- package/docs/api/player.skiptime.md +2 -0
- package/docs/api/{player.clapprstats.destroy.md → player.stalleventdata.count.md} +5 -7
- package/docs/api/{player.bigmutebutton.template.md → player.stalleventdata.event.md} +3 -3
- package/docs/api/player.stalleventdata.md +117 -0
- package/docs/api/{player.audioselector.onshowlevelselectmenu.md → player.stalleventdata.time.md} +5 -7
- package/docs/api/{player.clapprstats.starttimers.md → player.stalleventdata.total_ms.md} +5 -7
- package/docs/api/{player.audioselector.template.md → player.starteventdata.event.md} +3 -3
- package/docs/api/player.starteventdata.md +60 -0
- package/docs/api/{player.clapprstats._defaultreport.md → player.telemetry._constructor_.md} +7 -9
- package/docs/api/player.telemetry.md +146 -0
- package/docs/api/{player.clapprnerdstats.name.md → player.telemetry.name.md} +4 -2
- package/docs/api/{player.clapprstats.supportedversion.md → player.telemetry.supportedversion.md} +4 -2
- package/docs/api/player.telemetryevent.md +100 -0
- package/docs/api/player.telemetryeventdata.md +18 -0
- package/docs/api/player.telemetrypluginsettings.md +60 -0
- package/docs/api/{player.audioselector.bindevents.md → player.telemetrypluginsettings.send.md} +5 -7
- package/docs/api/{player.audioselector.reload.md → player.telemetryrecord.md} +8 -6
- package/docs/api/player.thumbnails.md +21 -139
- package/docs/api/player.thumbnailspluginsettings.md +23 -0
- package/docs/api/player.volumefade.md +1 -93
- package/docs/api/{player.audioselector.name.md → player.watcheventdata.event.md} +3 -3
- package/docs/api/player.watcheventdata.md +60 -0
- package/lib/index.plugins.d.ts +2 -3
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +2 -3
- package/lib/playback/hls-playback/HlsPlayback.js +1 -1
- package/lib/plugins/audio-selector/AudioSelector.d.ts +28 -6
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +52 -22
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +18 -2
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +21 -16
- package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -0
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +1 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +38 -5
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +63 -17
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +31 -8
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/ClapprStats.js +24 -0
- package/lib/plugins/clappr-stats/types.d.ts +12 -0
- package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
- package/lib/plugins/clappr-stats/types.js +3 -0
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +13 -1
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +14 -4
- package/lib/plugins/clips/Clips.d.ts +34 -2
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +51 -22
- package/lib/plugins/context-menu/ContextMenu.d.ts +40 -13
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.js +48 -36
- package/lib/plugins/dvr-controls/DvrControls.d.ts +5 -4
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +15 -29
- package/lib/plugins/error-screen/ErrorScreen.d.ts +4 -0
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +4 -0
- package/lib/plugins/favicon/Favicon.d.ts +4 -0
- package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
- package/lib/plugins/favicon/Favicon.js +4 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +4 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -1
- package/lib/plugins/google-analytics/GoogleAnalytics.js +5 -1
- package/lib/plugins/index.d.ts +2 -4
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/plugins/index.js +2 -4
- package/lib/plugins/logo/Logo.d.ts +4 -0
- package/lib/plugins/logo/Logo.d.ts.map +1 -1
- package/lib/plugins/logo/Logo.js +4 -0
- package/lib/plugins/media-control/MediaControl.d.ts +1 -1
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +3 -1
- package/lib/plugins/multi-camera/MultiCamera.d.ts +3 -0
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +3 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +32 -4
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.js +30 -2
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +47 -14
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +38 -9
- package/lib/plugins/seek-time/SeekTime.d.ts +4 -0
- package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
- package/lib/plugins/seek-time/SeekTime.js +5 -1
- package/lib/plugins/share/Share.d.ts +3 -0
- package/lib/plugins/share/Share.d.ts.map +1 -1
- package/lib/plugins/share/Share.js +3 -0
- package/lib/plugins/skip-time/SkipTime.d.ts +3 -0
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
- package/lib/plugins/skip-time/SkipTime.js +3 -0
- package/lib/plugins/statistics/Statistics.d.ts +38 -3
- package/lib/plugins/statistics/Statistics.d.ts.map +1 -1
- package/lib/plugins/statistics/Statistics.js +51 -9
- package/lib/plugins/telemetry/Telemetry.d.ts +153 -0
- package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -0
- package/lib/plugins/telemetry/Telemetry.js +181 -0
- package/lib/plugins/thumbnails/Thumbnails.d.ts +48 -3
- package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -1
- package/lib/plugins/thumbnails/Thumbnails.js +52 -18
- package/lib/plugins/volume-fade/VolumeFade.d.ts +8 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +9 -1
- package/package.json +1 -1
- package/src/index.plugins.ts +2 -3
- package/src/playback/hls-playback/HlsPlayback.ts +1 -1
- package/src/plugins/audio-selector/AudioSelector.ts +227 -154
- package/src/plugins/big-mute-button/BigMuteButton.ts +100 -79
- package/src/plugins/bottom-gear/BottomGear.ts +1 -0
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +240 -173
- package/src/plugins/clappr-stats/ClapprStats.ts +32 -8
- package/src/plugins/clappr-stats/types.ts +13 -0
- package/src/plugins/click-to-pause/ClickToPause.ts +47 -36
- package/src/plugins/clips/Clips.ts +127 -71
- package/src/plugins/context-menu/ContextMenu.ts +105 -76
- package/src/plugins/dvr-controls/DvrControls.ts +15 -31
- package/src/plugins/error-screen/ErrorScreen.ts +4 -0
- package/src/plugins/favicon/Favicon.ts +4 -0
- package/src/plugins/google-analytics/GoogleAnalytics.ts +5 -1
- package/src/plugins/index.ts +2 -4
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +47 -26
- package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +18 -18
- package/src/plugins/logo/Logo.ts +4 -0
- package/src/plugins/media-control/MediaControl.ts +4 -1
- package/src/plugins/multi-camera/MultiCamera.ts +3 -0
- package/src/plugins/picture-in-picture/PictureInPicture.ts +35 -7
- package/src/plugins/playback-rate/PlaybackRate.ts +53 -24
- package/src/plugins/seek-time/SeekTime.ts +5 -1
- package/src/plugins/share/Share.ts +3 -0
- package/src/plugins/skip-time/SkipTime.ts +3 -0
- package/src/plugins/telemetry/Telemetry.ts +317 -0
- package/src/plugins/thumbnails/Thumbnails.ts +268 -194
- package/src/plugins/volume-fade/VolumeFade.ts +10 -2
- package/temp/player.api.json +2457 -5257
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.audioselector.attributes.md +0 -17
- package/docs/api/player.audioselector.events.md +0 -17
- package/docs/api/player.audioselector.hideselecttrackmenu.md +0 -18
- package/docs/api/player.audioselector.render.md +0 -18
- package/docs/api/player.audioselector.supportedversion.md +0 -16
- package/docs/api/player.audioselector.togglecontextmenu.md +0 -18
- package/docs/api/player.audioselector.unbindevents.md +0 -18
- package/docs/api/player.audioselector.version.md +0 -14
- package/docs/api/player.bigmutebutton.bindevents.md +0 -18
- package/docs/api/player.bigmutebutton.events.md +0 -17
- package/docs/api/player.bigmutebutton.name.md +0 -14
- package/docs/api/player.bigmutebutton.render.md +0 -18
- package/docs/api/player.bigmutebutton.supportedversion.md +0 -16
- package/docs/api/player.clapprnerdstats.attributes.md +0 -17
- package/docs/api/player.clapprnerdstats.bindevents.md +0 -18
- package/docs/api/player.clapprnerdstats.events.md +0 -18
- package/docs/api/player.clapprnerdstats.playerheight.md +0 -14
- package/docs/api/player.clapprnerdstats.playerwidth.md +0 -14
- package/docs/api/player.clapprnerdstats.render.md +0 -18
- package/docs/api/player.clapprnerdstats.statsboxelem.md +0 -14
- package/docs/api/player.clapprnerdstats.statsboxwidththreshold.md +0 -14
- package/docs/api/player.clapprnerdstats.supportedversion.md +0 -16
- package/docs/api/player.clapprnerdstats.template.md +0 -14
- package/docs/api/player.clapprstats._buildreport.md +0 -18
- package/docs/api/player.clapprstats._playbackname.md +0 -14
- package/docs/api/player.clapprstats._playbacktype.md +0 -14
- package/docs/api/player.clapprstats.bindevents.md +0 -18
- package/docs/api/player.clapprstats.onfirstplaying.md +0 -18
- package/docs/api/player.clapprstats.playafterpause.md +0 -18
- package/docs/api/player.clapprstats.stopreporting.md +0 -18
- package/docs/api/player.clicktopause.bindevents.md +0 -15
- package/docs/api/player.clicktopause.config.md +0 -11
- package/docs/api/player.clicktopause.name.md +0 -11
- package/docs/api/player.clicktopause.supportedversion.md +0 -13
- package/docs/api/player.clipsplugin.attributes.md +0 -13
- package/docs/api/player.clipsplugin.bindevents.md +0 -15
- package/docs/api/player.clipsplugin.makesvg.md +0 -49
- package/docs/api/player.clipsplugin.name.md +0 -11
- package/docs/api/player.clipsplugin.unbindevents.md +0 -15
- package/docs/api/player.contextmenu.attributes.md +0 -13
- package/docs/api/player.contextmenu.bindevents.md +0 -15
- package/docs/api/player.contextmenu.destroy.md +0 -15
- package/docs/api/player.contextmenu.events.md +0 -13
- package/docs/api/player.contextmenu.exposeversion.md +0 -14
- package/docs/api/player.contextmenu.label.md +0 -11
- package/docs/api/player.contextmenu.mediacontrol.md +0 -11
- package/docs/api/player.contextmenu.name.md +0 -11
- package/docs/api/player.contextmenu.render.md +0 -15
- package/docs/api/player.contextmenu.supportedversion.md +0 -13
- package/docs/api/player.contextmenu.template.md +0 -11
- package/docs/api/player.contextmenu.url.md +0 -11
- package/docs/api/player.disablecontrols.bindevents.md +0 -15
- package/docs/api/player.disablecontrols.container.md +0 -11
- package/docs/api/player.disablecontrols.md +0 -138
- package/docs/api/player.disablecontrols.name.md +0 -11
- package/docs/api/player.disablecontrols.supportedversion.md +0 -13
- package/docs/api/player.disablecontrols.unbindevents.md +0 -15
- package/docs/api/player.pictureinpicture.bindevents.md +0 -15
- package/docs/api/player.pictureinpicture.events.md +0 -13
- package/docs/api/player.pictureinpicture.exitpictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.name.md +0 -11
- package/docs/api/player.pictureinpicture.render.md +0 -15
- package/docs/api/player.pictureinpicture.requestpictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.supportedversion.md +0 -13
- package/docs/api/player.pictureinpicture.togglepictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.version.md +0 -11
- package/docs/api/player.pictureinpicture.videoelement.md +0 -11
- package/docs/api/player.playbackrate.attributes.md +0 -14
- package/docs/api/player.playbackrate.bindevents.md +0 -15
- package/docs/api/player.playbackrate.events.md +0 -15
- package/docs/api/player.playbackrate.gettitle.md +0 -15
- package/docs/api/player.playbackrate.goback.md +0 -15
- package/docs/api/player.playbackrate.highlightcurrentrate.md +0 -15
- package/docs/api/player.playbackrate.name.md +0 -11
- package/docs/api/player.playbackrate.onfinishad.md +0 -15
- package/docs/api/player.playbackrate.onplay.md +0 -15
- package/docs/api/player.playbackrate.onrateselect.md +0 -49
- package/docs/api/player.playbackrate.onshowmenu.md +0 -15
- package/docs/api/player.playbackrate.onstartad.md +0 -15
- package/docs/api/player.playbackrate.onstop.md +0 -15
- package/docs/api/player.playbackrate.reload.md +0 -15
- package/docs/api/player.playbackrate.render.md +0 -15
- package/docs/api/player.playbackrate.supportedversion.md +0 -13
- package/docs/api/player.playbackrate.template.md +0 -11
- package/docs/api/player.playbackrate.unbindevents.md +0 -15
- package/docs/api/player.playbackrate.updateplaybackrate.md +0 -49
- package/docs/api/player.pluginsettings.md +0 -13
- package/docs/api/player.statistics._constructor_.md +0 -47
- package/docs/api/player.statistics.bindevents.md +0 -15
- package/docs/api/player.statistics.md +0 -141
- package/docs/api/player.statistics.name.md +0 -11
- package/docs/api/player.statistics.supportedversion.md +0 -13
- package/docs/api/player.thumbnails.attributes.md +0 -13
- package/docs/api/player.thumbnails.bindevents.md +0 -15
- package/docs/api/player.thumbnails.name.md +0 -11
- package/docs/api/player.thumbnails.settext.md +0 -49
- package/docs/api/player.thumbnails.supportedversion.md +0 -13
- package/docs/api/player.thumbnails.template.md +0 -11
- package/docs/api/player.volumefade.bindevents.md +0 -18
- package/docs/api/player.volumefade.name.md +0 -14
- package/docs/api/player.volumefade.unbindevents.md +0 -18
- package/src/plugins/disable-controls/DisableControls.ts +0 -81
- package/src/plugins/ga-events/GaEvents.js +0 -395
- package/src/plugins/ga-events/ga-tracking.js +0 -46
- package/src/plugins/statistics/Statistics.ts +0 -207
- /package/src/plugins/{statistics → telemetry}/Statistics copy.xts +0 -0
|
@@ -2,7 +2,10 @@ import { Container, ContainerPlugin } from '@clappr/core';
|
|
|
2
2
|
import type { QualityLevel } from '../../playback.types.js';
|
|
3
3
|
import type { Metrics, MetricsUpdateFn } from './types.js';
|
|
4
4
|
/**
|
|
5
|
+
* Collects useful statistics about playback performance.
|
|
5
6
|
* @beta
|
|
7
|
+
* @remarks
|
|
8
|
+
* This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
|
|
6
9
|
*/
|
|
7
10
|
export declare class ClapprStats extends ContainerPlugin {
|
|
8
11
|
private bwMeasureCount;
|
|
@@ -17,27 +20,47 @@ export declare class ClapprStats extends ContainerPlugin {
|
|
|
17
20
|
private updateFn;
|
|
18
21
|
private urisToMeasureBandwidth;
|
|
19
22
|
private uriToMeasureLatency;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
20
26
|
get name(): string;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
21
30
|
get supportedVersion(): {
|
|
22
31
|
min: string;
|
|
23
32
|
};
|
|
24
|
-
get _playbackName()
|
|
25
|
-
get _playbackType()
|
|
33
|
+
private get _playbackName();
|
|
34
|
+
private get _playbackType();
|
|
26
35
|
private _now;
|
|
27
36
|
private _inc;
|
|
28
37
|
private start;
|
|
29
38
|
private _stop;
|
|
39
|
+
/**
|
|
40
|
+
* Registers a callback to receive the metrics.
|
|
41
|
+
* @param updateMetricsFn
|
|
42
|
+
*/
|
|
30
43
|
setUpdateMetrics(updateMetricsFn: MetricsUpdateFn): void;
|
|
31
|
-
_defaultReport
|
|
44
|
+
private _defaultReport;
|
|
32
45
|
constructor(container: Container);
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
33
49
|
bindEvents(): void;
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
34
53
|
destroy(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the collected metrics.
|
|
56
|
+
* @returns The collected metrics
|
|
57
|
+
*/
|
|
35
58
|
exportMetrics(): Metrics;
|
|
36
59
|
onBitrate(newBitrate: QualityLevel): void;
|
|
37
|
-
stopReporting
|
|
38
|
-
startTimers
|
|
39
|
-
onFirstPlaying
|
|
40
|
-
playAfterPause
|
|
60
|
+
private stopReporting;
|
|
61
|
+
private startTimers;
|
|
62
|
+
private onFirstPlaying;
|
|
63
|
+
private playAfterPause;
|
|
41
64
|
private onPlay;
|
|
42
65
|
private onPause;
|
|
43
66
|
private onSeek;
|
|
@@ -48,7 +71,7 @@ export declare class ClapprStats extends ContainerPlugin {
|
|
|
48
71
|
private onProgress;
|
|
49
72
|
private _newMetrics;
|
|
50
73
|
private _onCompletion;
|
|
51
|
-
_buildReport
|
|
74
|
+
private _buildReport;
|
|
52
75
|
private _fetchFPS;
|
|
53
76
|
private _calculateBitrates;
|
|
54
77
|
private _calculatePercentages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClapprStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/ClapprStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAA6B,MAAM,cAAc,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAA8B,MAAM,yBAAyB,CAAC;AAKxF,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkB3D
|
|
1
|
+
{"version":3,"file":"ClapprStats.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/ClapprStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAA6B,MAAM,cAAc,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAA8B,MAAM,yBAAyB,CAAC;AAKxF,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkB3D;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,eAAe;IAC9C,OAAO,CAAC,cAAc,CAAK;IAE3B,OAAO,CAAC,UAAU,CAAwB;IAE1C,OAAO,CAAC,sBAAsB,CAAK;IAEnC,OAAO,CAAC,OAAO,CAAyB;IAExC,OAAO,CAAC,UAAU,CAGhB;IAEF,OAAO,CAAC,SAAS,CAA6B;IAE9C,OAAO,CAAC,qBAAqB,CAAS;IAEtC,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,MAAM,CAOZ;IAEF,OAAO,CAAC,QAAQ,CAAkC;IAElD,OAAO,CAAC,sBAAsB,CAA0B;IAExD,OAAO,CAAC,mBAAmB,CAAqB;IAEhD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,KAAK,aAAa,GAExB;IAED,OAAO,KAAK,aAAa,GAExB;IAED,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,IAAI;IAQZ,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,KAAK;IAKb;;;OAGG;IACH,gBAAgB,CAAC,eAAe,EAAE,eAAe;IAIjD,OAAO,CAAC,cAAc;gBAIV,SAAS,EAAE,SAAS;IAchC;;OAEG;IACM,UAAU;IAmBnB;;OAEG;IACM,OAAO;IAKhB;;;OAGG;IACH,aAAa;IAIb,SAAS,CAAC,UAAU,EAAE,YAAY;IAgBlC,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,iBAAiB;CAmD1B"}
|
|
@@ -6,7 +6,10 @@ import { newMetrics } from './utils.js';
|
|
|
6
6
|
// TODO: fix
|
|
7
7
|
const updateMetrics = () => { };
|
|
8
8
|
/**
|
|
9
|
+
* Collects useful statistics about playback performance.
|
|
9
10
|
* @beta
|
|
11
|
+
* @remarks
|
|
12
|
+
* This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
|
|
10
13
|
*/
|
|
11
14
|
export class ClapprStats extends ContainerPlugin {
|
|
12
15
|
bwMeasureCount = 0;
|
|
@@ -28,9 +31,15 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
28
31
|
updateFn = updateMetrics;
|
|
29
32
|
urisToMeasureBandwidth;
|
|
30
33
|
uriToMeasureLatency;
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
31
37
|
get name() {
|
|
32
38
|
return 'clappr_stats';
|
|
33
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
34
43
|
get supportedVersion() {
|
|
35
44
|
return { min: CLAPPR_VERSION };
|
|
36
45
|
}
|
|
@@ -58,6 +67,10 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
58
67
|
// this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
|
|
59
68
|
this.metrics.timers[timer] += this._now() - this.timers[timer];
|
|
60
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Registers a callback to receive the metrics.
|
|
72
|
+
* @param updateMetricsFn
|
|
73
|
+
*/
|
|
61
74
|
setUpdateMetrics(updateMetricsFn) {
|
|
62
75
|
this.updateFn = updateMetricsFn;
|
|
63
76
|
}
|
|
@@ -76,6 +89,9 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
76
89
|
calls: []
|
|
77
90
|
};
|
|
78
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
79
95
|
bindEvents() {
|
|
80
96
|
this.listenTo(this.container, CoreEvents.CONTAINER_BITRATE, this.onBitrate);
|
|
81
97
|
this.listenTo(this.container, CoreEvents.CONTAINER_STOP, this.stopReporting);
|
|
@@ -94,10 +110,17 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
94
110
|
this.listenTo(this.container.playback, CoreEvents.PLAYBACK_PROGRESS, this.onProgress);
|
|
95
111
|
this.listenTo(this.container.playback, CoreEvents.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
|
|
96
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
97
116
|
destroy() {
|
|
98
117
|
this.stopReporting();
|
|
99
118
|
super.destroy();
|
|
100
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Returns the collected metrics.
|
|
122
|
+
* @returns The collected metrics
|
|
123
|
+
*/
|
|
101
124
|
exportMetrics() {
|
|
102
125
|
return structuredClone(this.metrics);
|
|
103
126
|
}
|
|
@@ -119,6 +142,7 @@ export class ClapprStats extends ContainerPlugin {
|
|
|
119
142
|
this.intervalId = null;
|
|
120
143
|
}
|
|
121
144
|
this._newMetrics();
|
|
145
|
+
// TODO
|
|
122
146
|
// @ts-ignore
|
|
123
147
|
this.stopListening();
|
|
124
148
|
this.bindEvents();
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @beta
|
|
3
|
+
*/
|
|
1
4
|
export type Metrics = {
|
|
2
5
|
counters: {
|
|
3
6
|
play: number;
|
|
@@ -36,13 +39,22 @@ export type Metrics = {
|
|
|
36
39
|
};
|
|
37
40
|
custom: Record<string, unknown>;
|
|
38
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* @beta
|
|
44
|
+
*/
|
|
39
45
|
export type BitrateTrackRecord = {
|
|
40
46
|
start: number;
|
|
41
47
|
end?: number;
|
|
42
48
|
time?: number;
|
|
43
49
|
bitrate: number;
|
|
44
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* @beta
|
|
53
|
+
*/
|
|
45
54
|
export type MetricsUpdateFn = (metrics: Metrics) => void;
|
|
55
|
+
/**
|
|
56
|
+
* @beta
|
|
57
|
+
*/
|
|
46
58
|
export declare enum ClapprStatsEvents {
|
|
47
59
|
REPORT_EVENT = "clappr:stats:report",
|
|
48
60
|
PERCENTAGE_EVENT = "clappr:stats:percentage"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/types.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;QACtB,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,kBAAkB,EAAE,CAAC;QACtC,mBAAmB,EAAE,MAAM,CAAC;QAC5B,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACtC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEzD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,YAAY,wBAAwB;IACpC,gBAAgB,4BAA4B;CAC7C"}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { ContainerPlugin } from '@clappr/core';
|
|
2
|
+
/**
|
|
3
|
+
* Adds a behavior of toggling the playback state on click over the container
|
|
4
|
+
* @beta
|
|
5
|
+
*/
|
|
2
6
|
export declare class ClickToPause extends ContainerPlugin {
|
|
3
7
|
private pointerEnabled;
|
|
4
8
|
private timer;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
5
12
|
get name(): string;
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
6
16
|
get supportedVersion(): {
|
|
7
17
|
min: string;
|
|
8
18
|
};
|
|
9
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
10
22
|
bindEvents(): void;
|
|
11
23
|
private click;
|
|
12
24
|
private settingsUpdate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickToPause.d.ts","sourceRoot":"","sources":["../../../src/plugins/click-to-pause/ClickToPause.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"ClickToPause.d.ts","sourceRoot":"","sources":["../../../src/plugins/click-to-pause/ClickToPause.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAA;AAShE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,eAAe;IAC/C,OAAO,CAAC,cAAc,CAAQ;IAE9B,OAAO,CAAC,KAAK,CAAqB;IAElC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,KAAK;IAoBb,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,UAAU;CAMnB"}
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
//Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
2
2
|
// Use of this source code is governed by a BSD-style
|
|
3
|
-
// license that can be found
|
|
3
|
+
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
4
4
|
import { ContainerPlugin, Events, Playback } from '@clappr/core';
|
|
5
5
|
import { trace } from '@gcorevideo/utils';
|
|
6
6
|
import { CLAPPR_VERSION } from '../../build.js';
|
|
7
7
|
const T = 'plugins.click_to_pause_custom';
|
|
8
|
+
/**
|
|
9
|
+
* Adds a behavior of toggling the playback state on click over the container
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
8
12
|
export class ClickToPause extends ContainerPlugin {
|
|
9
13
|
pointerEnabled = false;
|
|
10
14
|
timer = null;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
11
18
|
get name() {
|
|
12
19
|
return 'click_to_pause_custom';
|
|
13
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
14
24
|
get supportedVersion() {
|
|
15
25
|
return { min: CLAPPR_VERSION };
|
|
16
26
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
20
30
|
bindEvents() {
|
|
21
31
|
this.listenTo(this.container, Events.CONTAINER_CLICK, this.click);
|
|
22
32
|
this.listenTo(this.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
|
|
@@ -1,25 +1,57 @@
|
|
|
1
1
|
import { UICorePlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/clips/clips.scss';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options
|
|
5
|
+
*/
|
|
6
|
+
export interface ClipsPluginSettings {
|
|
7
|
+
/**
|
|
8
|
+
* The text to display over the seekbar.
|
|
9
|
+
*/
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Adds a behavior of showing a text over the seekbar to indicate the current clip.
|
|
14
|
+
* @beta
|
|
15
|
+
* @remarks
|
|
16
|
+
* Depends on:
|
|
17
|
+
*
|
|
18
|
+
* - {@link MediaControl}
|
|
19
|
+
*
|
|
20
|
+
* Configuration options - {@link ClipsPluginSettings}
|
|
21
|
+
*/
|
|
3
22
|
export declare class ClipsPlugin extends UICorePlugin {
|
|
4
23
|
private clips;
|
|
5
24
|
private duration;
|
|
6
25
|
private durationGetting;
|
|
7
26
|
private _oldContainer;
|
|
8
27
|
private svgMask;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
9
31
|
get name(): string;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
10
35
|
get attributes(): {
|
|
11
36
|
class: string;
|
|
12
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
13
41
|
bindEvents(): void;
|
|
14
42
|
private _onCoreReady;
|
|
15
|
-
unbindEvents(): void;
|
|
16
43
|
private _onMediaControlContainerChanged;
|
|
17
44
|
private playerResize;
|
|
18
45
|
private _bindContainerEvents;
|
|
19
46
|
private onTimeUpdate;
|
|
20
47
|
private parseClips;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the text of the current clip.
|
|
50
|
+
* @param time - The current time of the player.
|
|
51
|
+
* @returns The text of the current clip.
|
|
52
|
+
*/
|
|
21
53
|
getText(time: number): string;
|
|
22
|
-
makeSvg
|
|
54
|
+
private makeSvg;
|
|
23
55
|
private setSVGMask;
|
|
24
56
|
private setClipText;
|
|
25
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAK,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAK,MAAM,cAAc,CAAA;AAKjE,OAAO,kCAAkC,CAAA;AAezC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;GASG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,KAAK,CAAmC;IAEhD,OAAO,CAAC,QAAQ,CAAY;IAE5B,OAAO,CAAC,eAAe,CAAQ;IAE/B,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,OAAO,CAA2B;IAE1C;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED;;OAEG;IACM,UAAU;IAanB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,+BAA+B;IAIvC,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IA4BlB;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM;IASpB,OAAO,CAAC,OAAO;IA4Bf,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,WAAW;CAQpB"}
|
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
import { Events, UICorePlugin, $ } from '@clappr/core';
|
|
2
2
|
import { strtimeToMiliseconds } from '../utils.js';
|
|
3
3
|
import '../../../assets/clips/clips.scss';
|
|
4
|
+
import assert from 'assert';
|
|
5
|
+
/**
|
|
6
|
+
* Adds a behavior of showing a text over the seekbar to indicate the current clip.
|
|
7
|
+
* @beta
|
|
8
|
+
* @remarks
|
|
9
|
+
* Depends on:
|
|
10
|
+
*
|
|
11
|
+
* - {@link MediaControl}
|
|
12
|
+
*
|
|
13
|
+
* Configuration options - {@link ClipsPluginSettings}
|
|
14
|
+
*/
|
|
4
15
|
export class ClipsPlugin extends UICorePlugin {
|
|
5
16
|
clips = new Map();
|
|
6
17
|
duration = 0;
|
|
7
18
|
durationGetting = false;
|
|
8
19
|
_oldContainer;
|
|
9
20
|
svgMask = null;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
10
24
|
get name() {
|
|
11
|
-
return '
|
|
25
|
+
return 'clips';
|
|
12
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
13
30
|
get attributes() {
|
|
14
31
|
return {
|
|
15
|
-
|
|
32
|
+
class: this.name,
|
|
16
33
|
};
|
|
17
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
18
38
|
bindEvents() {
|
|
39
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
40
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
19
41
|
this.listenToOnce(this.core, Events.CORE_READY, this._onCoreReady);
|
|
20
|
-
|
|
42
|
+
// TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
|
|
43
|
+
this.listenTo(mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
|
|
21
44
|
this.listenTo(this.core, Events.CORE_RESIZE, this.playerResize);
|
|
22
45
|
}
|
|
23
46
|
_onCoreReady() {
|
|
@@ -27,12 +50,6 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
27
50
|
}
|
|
28
51
|
this.parseClips();
|
|
29
52
|
}
|
|
30
|
-
unbindEvents() {
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
this.stopListening(this.core, Events.CORE_READY);
|
|
33
|
-
// @ts-ignore
|
|
34
|
-
this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED);
|
|
35
|
-
}
|
|
36
53
|
_onMediaControlContainerChanged() {
|
|
37
54
|
this._bindContainerEvents();
|
|
38
55
|
}
|
|
@@ -46,9 +63,10 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
46
63
|
if (this._oldContainer) {
|
|
47
64
|
this.stopListening(this._oldContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
48
65
|
}
|
|
49
|
-
|
|
66
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
67
|
+
this._oldContainer = mediaControl.container;
|
|
50
68
|
this.durationGetting = false;
|
|
51
|
-
this.listenTo(
|
|
69
|
+
this.listenTo(mediaControl.container, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
52
70
|
}
|
|
53
71
|
onTimeUpdate(event) {
|
|
54
72
|
if (!this.durationGetting) {
|
|
@@ -65,13 +83,17 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
65
83
|
}
|
|
66
84
|
parseClips() {
|
|
67
85
|
const textArr = this.options.clips.text.split('\n');
|
|
68
|
-
const clipsArr = textArr
|
|
86
|
+
const clipsArr = textArr
|
|
87
|
+
.map((val) => {
|
|
69
88
|
const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
|
|
70
|
-
return matchRes
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
89
|
+
return matchRes
|
|
90
|
+
? {
|
|
91
|
+
start: strtimeToMiliseconds(matchRes[1]),
|
|
92
|
+
text: matchRes[2],
|
|
93
|
+
}
|
|
94
|
+
: null;
|
|
95
|
+
})
|
|
96
|
+
.filter((clip) => clip !== null);
|
|
75
97
|
clipsArr.sort((a, b) => a.start - b.start);
|
|
76
98
|
clipsArr.forEach((clip, index) => {
|
|
77
99
|
this.clips.set(clip.start, {
|
|
@@ -82,6 +104,11 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
82
104
|
});
|
|
83
105
|
});
|
|
84
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns the text of the current clip.
|
|
109
|
+
* @param time - The current time of the player.
|
|
110
|
+
* @returns The text of the current clip.
|
|
111
|
+
*/
|
|
85
112
|
getText(time) {
|
|
86
113
|
for (const [key, value] of this.clips.entries()) {
|
|
87
114
|
if (time >= value.start && time < value.end) {
|
|
@@ -92,14 +119,14 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
92
119
|
}
|
|
93
120
|
makeSvg(duration) {
|
|
94
121
|
let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
|
|
95
|
-
const widthOfSeek = this.core.
|
|
122
|
+
const widthOfSeek = this.core.activeContainer.$el.width();
|
|
96
123
|
let finishValue = 0;
|
|
97
|
-
this.clips.forEach(val => {
|
|
124
|
+
this.clips.forEach((val) => {
|
|
98
125
|
let end = val.end;
|
|
99
126
|
if (!end) {
|
|
100
127
|
end = val.end = duration;
|
|
101
128
|
}
|
|
102
|
-
const widthChunk = (end - val.start) * widthOfSeek / duration;
|
|
129
|
+
const widthChunk = ((end - val.start) * widthOfSeek) / duration;
|
|
103
130
|
svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
|
|
104
131
|
finishValue += widthChunk;
|
|
105
132
|
});
|
|
@@ -112,7 +139,8 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
112
139
|
if (this.svgMask) {
|
|
113
140
|
this.svgMask.remove();
|
|
114
141
|
}
|
|
115
|
-
const
|
|
142
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
143
|
+
const $seekBarContainer = mediaControl.getElement('seekBarContainer');
|
|
116
144
|
if ($seekBarContainer?.get(0)) {
|
|
117
145
|
$seekBarContainer.addClass('clips');
|
|
118
146
|
}
|
|
@@ -120,7 +148,8 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
120
148
|
$seekBarContainer?.append(this.svgMask);
|
|
121
149
|
}
|
|
122
150
|
setClipText(text) {
|
|
123
|
-
const
|
|
151
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
152
|
+
const $clipText = mediaControl.getElement('clipText');
|
|
124
153
|
if ($clipText && text) {
|
|
125
154
|
$clipText.show();
|
|
126
155
|
$clipText.text(`${text}`);
|
|
@@ -1,36 +1,63 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Container, UIContainerPlugin } from '@clappr/core';
|
|
2
2
|
import '../../../assets/context-menu/context_menu.scss';
|
|
3
|
-
export
|
|
3
|
+
export interface ContextMenuPluginSettings {
|
|
4
|
+
label?: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
preventShowContextMenu?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Displays a small context menu when clicked on the player container.
|
|
10
|
+
* @beta
|
|
11
|
+
* @remarks
|
|
12
|
+
* Configuration options - {@link ContextMenuPluginSettings}
|
|
13
|
+
*/
|
|
14
|
+
export declare class ContextMenu extends UIContainerPlugin {
|
|
4
15
|
private _label;
|
|
5
16
|
private _url;
|
|
6
|
-
private container;
|
|
7
17
|
private menuOptions;
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
8
21
|
get name(): string;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
9
25
|
get supportedVersion(): {
|
|
10
26
|
min: string;
|
|
11
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
12
31
|
get attributes(): {
|
|
13
32
|
class: string;
|
|
14
33
|
};
|
|
15
|
-
|
|
16
|
-
get
|
|
17
|
-
get
|
|
18
|
-
get
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
34
|
+
private static readonly template;
|
|
35
|
+
private get label();
|
|
36
|
+
private get url();
|
|
37
|
+
private get exposeVersion();
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
23
41
|
get events(): {
|
|
24
42
|
'click [data-version]': string;
|
|
25
43
|
};
|
|
26
|
-
constructor(
|
|
44
|
+
constructor(container: Container);
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
27
48
|
bindEvents(): void;
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
28
52
|
destroy(): import("@clappr/core").UIObject;
|
|
29
|
-
private containerChanged;
|
|
30
53
|
private toggleContextMenu;
|
|
31
54
|
private show;
|
|
32
55
|
private hide;
|
|
33
56
|
private onOpenMainPage;
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
34
60
|
render(): this;
|
|
61
|
+
private hideOnBodyClick;
|
|
35
62
|
}
|
|
36
63
|
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/context-menu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/context-menu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EACT,iBAAiB,EAClB,MAAM,cAAc,CAAA;AAIrB,OAAO,gDAAgD,CAAA;AASvD,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IAChD,OAAO,CAAC,MAAM,CAAa;IAE3B,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO,CAAC,WAAW,CAAmB;IAEtC;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,IAAa,UAAU;;MAEtB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAEzD,OAAO,KAAK,KAAK,GAEhB;IAED,OAAO,KAAK,GAAG,GAEd;IAED,OAAO,KAAK,aAAa,GAKxB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;gBAEW,SAAS,EAAE,SAAS;IAYhC;;OAEG;IACM,UAAU;IAUnB;;OAEG;IACM,OAAO;IAKhB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,cAAc;IAItB;;OAEG;IACM,MAAM;IASf,OAAO,CAAC,eAAe,CAEtB;CACF"}
|