@gcorevideo/player 2.18.3 → 2.19.1
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/audio-selector/style.scss +156 -0
- package/assets/audio-selector/track-selector.ejs +12 -0
- package/assets/big-mute-button/big-mute-button.ejs +3 -0
- package/assets/big-mute-button/big-mute-button.scss +57 -0
- package/assets/bottom-gear/bottomgear.ejs +12 -0
- package/assets/bottom-gear/gear-sub-menu.scss +95 -0
- package/assets/bottom-gear/gear.scss +79 -0
- package/assets/clappr-nerd-stats/button.ejs +4 -0
- package/assets/clappr-nerd-stats/clappr-nerd-stats.ejs +212 -0
- package/assets/clappr-nerd-stats/clappr-nerd-stats.scss +488 -0
- package/assets/clappr-nerd-stats/options-list.ejs +9 -0
- package/assets/clappr-nerd-stats/settings.ejs +12 -0
- package/assets/clappr-nerd-stats/speedtest/speedtest.worker.js +775 -0
- package/assets/clips/clips.scss +3 -0
- package/assets/context-menu/context_menu.ejs +8 -0
- package/assets/context-menu/context_menu.scss +31 -0
- package/assets/dvr-controls/dvr_controls.scss +136 -0
- package/assets/dvr-controls/index.ejs +2 -0
- package/assets/error-screen/error_screen.ejs +13 -0
- package/assets/error-screen/error_screen.scss +40 -0
- package/assets/icons/new/arrow-left.svg +5 -0
- package/assets/icons/new/arrow-right.svg +5 -0
- package/assets/icons/new/check.svg +5 -0
- package/assets/icons/new/close.svg +12 -0
- package/assets/icons/new/full.svg +8 -0
- package/assets/icons/new/fullscreen-off.svg +14 -0
- package/assets/icons/new/fullscreen-on.svg +14 -0
- package/assets/icons/new/gear-hd.svg +16 -0
- package/assets/icons/new/gear.svg +12 -0
- package/assets/icons/new/hd.svg +8 -0
- package/assets/icons/new/pause.svg +5 -0
- package/assets/icons/new/pip.svg +5 -0
- package/assets/icons/new/play.svg +10 -0
- package/assets/icons/new/replayleft.svg +5 -0
- package/assets/icons/new/replayright.svg +5 -0
- package/assets/icons/new/speed.svg +5 -0
- package/assets/icons/new/stats.svg +3 -0
- package/assets/icons/new/stop.svg +3 -0
- package/assets/icons/new/subtitles-off.svg +5 -0
- package/assets/icons/new/subtitles-on.svg +6 -0
- package/assets/icons/new/volume-max.svg +5 -0
- package/assets/icons/new/volume-min.svg +5 -0
- package/assets/icons/new/volume-off.svg +5 -0
- package/assets/icons/old/cardboard.svg +4 -0
- package/assets/icons/old/close-share.svg +13 -0
- package/assets/icons/old/close.svg +13 -0
- package/assets/icons/old/fb.svg +13 -0
- package/assets/icons/old/fullscreen.svg +12 -0
- package/assets/icons/old/language.svg +1 -0
- package/assets/icons/old/pause.svg +12 -0
- package/assets/icons/old/play.svg +12 -0
- package/assets/icons/old/quality-arrow.svg +13 -0
- package/assets/icons/old/reload.svg +4 -0
- package/assets/icons/old/share.svg +13 -0
- package/assets/icons/old/sound-off.svg +15 -0
- package/assets/icons/old/sound-on.svg +15 -0
- package/assets/icons/old/streams.svg +3 -0
- package/assets/icons/old/twitter.svg +13 -0
- package/assets/icons/old/wn.svg +15 -0
- package/assets/icons/standard/01-play.svg +3 -0
- package/assets/icons/standard/02-pause.svg +3 -0
- package/assets/icons/standard/03-stop.svg +3 -0
- package/assets/icons/standard/04-volume.svg +3 -0
- package/assets/icons/standard/05-mute.svg +3 -0
- package/assets/icons/standard/06-expand.svg +3 -0
- package/assets/icons/standard/07-shrink.svg +3 -0
- package/assets/icons/standard/08-hd.svg +3 -0
- package/assets/icons/standard/09-cc.svg +8 -0
- package/assets/icons/standard/10-reload.svg +4 -0
- package/assets/level-selector/button.ejs +8 -0
- package/assets/level-selector/list.ejs +22 -0
- package/assets/level-selector/style.scss +4 -0
- package/assets/logo/styles/logo.scss +10 -0
- package/assets/logo/templates/logo.ejs +3 -0
- package/assets/media-control/closed-hand.cur +0 -0
- package/assets/media-control/container.scss +57 -0
- package/assets/media-control/media-control.ejs +133 -0
- package/assets/media-control/media-control.scss +390 -0
- package/assets/media-control/plugins.scss +94 -0
- package/assets/media-control/width270.scss +50 -0
- package/assets/media-control/width370.scss +263 -0
- package/assets/multi-camera/multicamera.ejs +29 -0
- package/assets/multi-camera/style.scss +176 -0
- package/assets/picture-in-picture/button.ejs +3 -0
- package/assets/picture-in-picture/button.scss +11 -0
- package/assets/playback-rate/button.ejs +6 -0
- package/assets/playback-rate/list.ejs +14 -0
- package/assets/playback-rate/playback-rate-selector.ejs +9 -0
- package/assets/poster/poster.ejs +1 -0
- package/assets/poster/poster.scss +32 -0
- package/assets/seek-time/seek-time.html +2 -0
- package/assets/seek-time/seek-time.scss +38 -0
- package/assets/share/share.ejs +37 -0
- package/assets/share/style.scss +104 -0
- package/assets/skip-time/skip-time.ejs +8 -0
- package/assets/skip-time/style.scss +24 -0
- package/assets/spinner-three-bounce/spinner.ejs +3 -0
- package/assets/spinner-three-bounce/spinner.scss +44 -0
- package/assets/style/main.scss +50 -0
- package/assets/style/theme.scss +42 -0
- package/assets/style/variables.scss +7 -0
- package/assets/subtitles/combobox copy.ejs +16 -0
- package/assets/subtitles/combobox.ejs +16 -0
- package/assets/subtitles/string.ejs +3 -0
- package/assets/subtitles/style.scss +99 -0
- package/assets/thumbnails/scrub-thumbnails.ejs +10 -0
- package/assets/thumbnails/style.scss +75 -0
- package/assets/vast-ads/style.scss +112 -0
- package/assets/video360/button.ejs +1 -0
- package/assets/video360/style.scss +8 -0
- package/build/vite-raw-plugin.js +18 -0
- package/dist/index.js +1 -1
- package/dist/plugins/index.css +2164 -0
- package/dist/{index-C02TmVOf.js → plugins/index.js/index.plugins.js} +29283 -29567
- package/lib/index.core.d.ts +15 -0
- package/lib/index.core.d.ts.map +1 -0
- package/lib/index.core.js +14 -0
- package/lib/index.d.ts +2 -14
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -14
- package/lib/index.plugins.d.ts +37 -0
- package/lib/index.plugins.d.ts.map +1 -0
- package/lib/index.plugins.js +39 -0
- package/lib/plugins/audio-selector/AudioSelector.d.ts +3 -3
- package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
- package/lib/plugins/audio-selector/AudioSelector.js +6 -12
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +2 -2
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +7 -12
- package/lib/plugins/bottom-gear/BottomGear.d.ts +4 -3
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +11 -16
- package/lib/plugins/build.d.ts +2 -0
- package/lib/plugins/build.d.ts.map +1 -0
- package/lib/plugins/build.js +1 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +44 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +294 -0
- package/lib/plugins/clappr-nerd-stats/formatter.d.ts +8 -0
- package/lib/plugins/clappr-nerd-stats/formatter.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/formatter.js +91 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts +54 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +335 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/index.d.ts +9 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/index.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/index.js +154 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/types.d.ts +6 -0
- package/lib/plugins/clappr-nerd-stats/speedtest/types.d.ts.map +1 -0
- package/lib/plugins/clappr-nerd-stats/types.d.ts +4 -0
- package/lib/plugins/clappr-nerd-stats/types.d.ts.map +1 -0
- package/lib/plugins/clappr-stats/ClapprStats.d.ts +56 -0
- package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -0
- package/lib/plugins/clappr-stats/ClapprStats.js +332 -0
- package/lib/plugins/clappr-stats/types.d.ts +50 -0
- package/lib/plugins/clappr-stats/types.d.ts.map +1 -0
- package/lib/plugins/clappr-stats/types.js +5 -0
- package/lib/plugins/clappr-stats/utils.d.ts +3 -0
- package/lib/plugins/clappr-stats/utils.d.ts.map +1 -0
- package/lib/plugins/clappr-stats/utils.js +40 -0
- package/lib/plugins/click-to-pause/ClickToPause.d.ts +2 -2
- package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
- package/lib/plugins/click-to-pause/ClickToPause.js +4 -6
- package/lib/plugins/clips/Clips.d.ts +23 -0
- package/lib/plugins/clips/Clips.d.ts.map +1 -0
- package/lib/plugins/clips/Clips.js +109 -0
- package/lib/plugins/context-menu/ContextMenu.d.ts +36 -0
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -0
- package/lib/plugins/context-menu/ContextMenu.js +102 -0
- package/lib/plugins/disable-controls/DisableControls.d.ts +1 -1
- package/lib/plugins/disable-controls/DisableControls.d.ts.map +1 -1
- package/lib/plugins/disable-controls/DisableControls.js +3 -5
- package/lib/plugins/dvr-controls/{DVRControls.d.ts → DvrControls.d.ts} +4 -4
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -0
- package/lib/plugins/dvr-controls/{DVRControls.js → DvrControls.js} +5 -4
- package/lib/plugins/error-screen/ErrorScreen.d.ts +44 -0
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -0
- package/lib/plugins/error-screen/ErrorScreen.js +179 -0
- package/lib/plugins/favicon/Favicon.d.ts +24 -0
- package/lib/plugins/favicon/Favicon.d.ts.map +1 -0
- package/lib/plugins/favicon/Favicon.js +106 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +30 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -0
- package/lib/plugins/google-analytics/GoogleAnalytics.js +114 -0
- package/lib/plugins/index.d.ts +38 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +40 -0
- package/lib/plugins/kibo/index.d.ts +23 -0
- package/lib/plugins/kibo/index.d.ts.map +1 -0
- package/lib/plugins/kibo/index.js +199 -0
- package/lib/plugins/level-selector/LevelSelector.d.ts +48 -17
- package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
- package/lib/plugins/level-selector/LevelSelector.js +169 -155
- package/lib/plugins/logo/Logo.d.ts +29 -0
- package/lib/plugins/logo/Logo.d.ts.map +1 -0
- package/lib/plugins/logo/Logo.js +181 -0
- package/lib/plugins/logo/utils/index.d.ts +22 -0
- package/lib/plugins/logo/utils/index.d.ts.map +1 -0
- package/lib/plugins/logo/utils/index.js +32 -0
- package/lib/plugins/media-control/MediaControl.d.ts +20 -25
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +136 -106
- package/lib/plugins/multi-camera/MultiCamera.d.ts +59 -0
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -0
- package/lib/plugins/multi-camera/MultiCamera.js +353 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +20 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -0
- package/lib/plugins/picture-in-picture/PictureInPicture.js +68 -0
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +42 -0
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -0
- package/lib/plugins/playback-rate/PlaybackRate.js +205 -0
- package/lib/plugins/poster/Poster.d.ts +18 -17
- package/lib/plugins/poster/Poster.d.ts.map +1 -1
- package/lib/plugins/poster/Poster.js +83 -37
- package/lib/plugins/seek-time/SeekTime.d.ts +38 -0
- package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -0
- package/lib/plugins/seek-time/SeekTime.js +153 -0
- package/lib/plugins/share/Share.d.ts +38 -0
- package/lib/plugins/share/Share.d.ts.map +1 -0
- package/lib/plugins/share/Share.js +122 -0
- package/lib/plugins/skip-time/SkipTime.d.ts +28 -0
- package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -0
- package/lib/plugins/skip-time/SkipTime.js +86 -0
- package/lib/plugins/source-controller/SourceController.d.ts +41 -0
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -0
- package/lib/plugins/source-controller/SourceController.js +199 -0
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +26 -0
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -0
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +117 -0
- package/lib/plugins/statistics/Statistics.d.ts +52 -0
- package/lib/plugins/statistics/Statistics.d.ts.map +1 -0
- package/lib/plugins/statistics/Statistics.js +130 -0
- package/lib/plugins/subtitles/Subtitles.d.ts +61 -0
- package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -0
- package/lib/plugins/subtitles/Subtitles.js +354 -0
- package/lib/plugins/thumbnails/Thumbnails.d.ts +47 -0
- package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -0
- package/lib/plugins/thumbnails/Thumbnails.js +414 -0
- package/lib/plugins/types.d.ts +8 -0
- package/lib/plugins/types.d.ts.map +1 -0
- package/lib/plugins/types.js +1 -0
- package/lib/plugins/utils.d.ts +5 -0
- package/lib/plugins/utils.d.ts.map +1 -0
- package/lib/plugins/utils.js +68 -0
- package/lib/plugins/vast-ads/VastAds.d.ts +72 -0
- package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -0
- package/lib/plugins/vast-ads/VastAds.js +686 -0
- package/lib/plugins/vast-ads/loaderxml.d.ts +32 -0
- package/lib/plugins/vast-ads/loaderxml.d.ts.map +1 -0
- package/lib/plugins/vast-ads/loaderxml.js +226 -0
- package/lib/plugins/vast-ads/roll.d.ts +60 -0
- package/lib/plugins/vast-ads/roll.d.ts.map +1 -0
- package/lib/plugins/vast-ads/roll.js +415 -0
- package/lib/plugins/vast-ads/rollmanager.d.ts +62 -0
- package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -0
- package/lib/plugins/vast-ads/rollmanager.js +347 -0
- package/lib/plugins/vast-ads/sctemanager.d.ts +18 -0
- package/lib/plugins/vast-ads/sctemanager.d.ts.map +1 -0
- package/lib/plugins/vast-ads/sctemanager.js +116 -0
- package/lib/plugins/vast-ads/types.d.ts +12 -0
- package/lib/plugins/vast-ads/types.d.ts.map +1 -0
- package/lib/plugins/vast-ads/types.js +1 -0
- package/lib/plugins/vast-ads/urlhandler.d.ts +4 -0
- package/lib/plugins/vast-ads/urlhandler.d.ts.map +1 -0
- package/lib/plugins/vast-ads/urlhandler.js +30 -0
- package/lib/plugins/vast-ads/xmlhttprequest.d.ts +6 -0
- package/lib/plugins/vast-ads/xmlhttprequest.d.ts.map +1 -0
- package/lib/plugins/vast-ads/xmlhttprequest.js +39 -0
- package/lib/plugins/vast-ads/xmlmerge.d.ts +12 -0
- package/lib/plugins/vast-ads/xmlmerge.d.ts.map +1 -0
- package/lib/plugins/vast-ads/xmlmerge.js +82 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts +21 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -0
- package/lib/plugins/volume-fade/VolumeFade.js +90 -0
- package/package.json +10 -2
- package/rollup.config.js +32 -2
- package/src/index.core.ts +15 -0
- package/src/index.plugins.ts +41 -0
- package/src/index.ts +2 -15
- package/src/plugins/audio-selector/AudioSelector.ts +370 -0
- package/src/plugins/big-mute-button/BigMuteButton.ts +187 -0
- package/src/plugins/bottom-gear/BottomGear.ts +122 -0
- package/src/plugins/build.ts +1 -0
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +369 -0
- package/src/plugins/clappr-nerd-stats/formatter.ts +109 -0
- package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +414 -0
- package/src/plugins/clappr-nerd-stats/speedtest/index.ts +183 -0
- package/src/plugins/clappr-nerd-stats/speedtest/types.ts +5 -0
- package/src/plugins/clappr-nerd-stats/types.ts +3 -0
- package/src/plugins/clappr-stats/ClapprStats.ts +441 -0
- package/src/plugins/clappr-stats/types.ts +52 -0
- package/src/plugins/clappr-stats/utils.ts +42 -0
- package/src/plugins/click-to-pause/ClickToPause.ts +93 -0
- package/src/plugins/clips/Clips.ts +152 -0
- package/src/plugins/context-menu/ContextMenu.ts +134 -0
- package/src/plugins/disable-controls/DisableControls.ts +81 -0
- package/src/plugins/dvr-controls/DvrControls.ts +131 -0
- package/src/plugins/error-screen/ErrorScreen.ts +241 -0
- package/src/plugins/favicon/Favicon.ts +137 -0
- package/src/plugins/ga-events/GaEvents.js +395 -0
- package/src/plugins/ga-events/ga-tracking.js +46 -0
- package/src/plugins/google-analytics/GoogleAnalytics.ts +147 -0
- package/src/plugins/index.ts +42 -0
- package/src/plugins/kibo/index.ts +244 -0
- package/src/plugins/level-selector/LevelSelector.ts +400 -0
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +72 -0
- package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +11 -0
- package/src/plugins/logo/Logo.ts +233 -0
- package/src/plugins/logo/utils/index.ts +46 -0
- package/src/plugins/media-control/MediaControl.ts +1383 -0
- package/src/plugins/multi-camera/MultiCamera copy.xts +414 -0
- package/src/plugins/multi-camera/MultiCamera.ts +426 -0
- package/src/plugins/picture-in-picture/PictureInPicture.ts +87 -0
- package/src/plugins/playback-rate/PlaybackRate.ts +269 -0
- package/src/plugins/poster/Poster.ts +298 -0
- package/src/plugins/seek-time/SeekTime.ts +191 -0
- package/src/plugins/share/Share.ts +148 -0
- package/src/plugins/skip-time/SkipTime.ts +109 -0
- package/src/plugins/source-controller/SourceController.ts +239 -0
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +230 -0
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +135 -0
- package/src/plugins/statistics/Statistics copy.xts +296 -0
- package/src/plugins/statistics/Statistics.ts +207 -0
- package/src/plugins/subtitles/Subtitles.ts +505 -0
- package/src/plugins/thumbnails/Thumbnails.ts +530 -0
- package/src/plugins/types.ts +7 -0
- package/src/plugins/typings/globals.d.ts +10 -0
- package/src/plugins/typings/parse-srt.d.ts +14 -0
- package/src/plugins/typings/workers.d.ts +3 -0
- package/src/plugins/utils.ts +77 -0
- package/src/plugins/vast-ads/VastAds.ts +915 -0
- package/src/plugins/vast-ads/loaderxml.ts +260 -0
- package/src/plugins/vast-ads/roll.ts +492 -0
- package/src/plugins/vast-ads/rollmanager.ts +403 -0
- package/src/plugins/vast-ads/sctemanager.ts +134 -0
- package/src/plugins/vast-ads/types.ts +14 -0
- package/src/plugins/vast-ads/urlhandler.ts +37 -0
- package/src/plugins/vast-ads/xmlhttprequest.ts +44 -0
- package/src/plugins/vast-ads/xmlmerge.ts +96 -0
- package/src/plugins/video360/VRControls.js +104 -0
- package/src/plugins/video360/VREffect.js +422 -0
- package/src/plugins/video360/Video360.js +979 -0
- package/src/plugins/video360/orbit-oriention-controls.js +1002 -0
- package/src/plugins/video360/utils.js +49 -0
- package/src/plugins/volume-fade/VolumeFade.ts +109 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/HlsPlayback-D9EmONbV.js +0 -747
- package/dist/player.d.ts +0 -646
- package/lib/backend.d.ts +0 -3
- package/lib/backend.d.ts.map +0 -1
- package/lib/backend.js +0 -10
- package/lib/constants.d.ts +0 -1
- package/lib/constants.d.ts.map +0 -1
- package/lib/constants.js +0 -1
- package/lib/gcore.types.d.ts +0 -84
- package/lib/gcore.types.d.ts.map +0 -1
- package/lib/gcore.types.js +0 -9
- package/lib/plugins/dash-playback/DashPlayback.d.ts +0 -73
- package/lib/plugins/dash-playback/DashPlayback.d.ts.map +0 -1
- package/lib/plugins/dash-playback/DashPlayback.js +0 -455
- package/lib/plugins/dash-playback/types.d.ts +0 -6
- package/lib/plugins/dash-playback/types.d.ts.map +0 -1
- package/lib/plugins/dash-plugin/DashPlayback.d.ts +0 -86
- package/lib/plugins/dash-plugin/DashPlayback.d.ts.map +0 -1
- package/lib/plugins/dash-plugin/DashPlayback.js +0 -659
- package/lib/plugins/dvr-controls/DVRControls.d.ts.map +0 -1
- package/lib/plugins/hls-playback/HlsPlayback.d.ts +0 -102
- package/lib/plugins/hls-playback/HlsPlayback.d.ts.map +0 -1
- package/lib/plugins/hls-playback/HlsPlayback.js +0 -815
- package/lib/trace/LogTracer.d.ts +0 -12
- package/lib/trace/LogTracer.d.ts.map +0 -1
- package/lib/trace/LogTracer.js +0 -17
- package/lib/trace/SentryTracer.d.ts +0 -12
- package/lib/trace/SentryTracer.d.ts.map +0 -1
- package/lib/trace/SentryTracer.js +0 -23
- package/lib/trace/Tracer.d.ts +0 -13
- package/lib/trace/Tracer.d.ts.map +0 -1
- package/lib/trace/Tracer.js +0 -15
- package/lib/trace/index.d.ts +0 -18
- package/lib/trace/index.d.ts.map +0 -1
- package/lib/trace/index.js +0 -27
- package/lib/trace/types.d.ts +0 -8
- package/lib/trace/types.d.ts.map +0 -1
- package/lib/tsdoc-metadata.json +0 -11
- package/lib/utils/Logger.d.ts +0 -23
- package/lib/utils/Logger.d.ts.map +0 -1
- package/lib/utils/Logger.js +0 -81
- package/lib/utils/canAutoplay.d.ts +0 -6
- package/lib/utils/canAutoplay.d.ts.map +0 -1
- package/lib/utils/canAutoplay.js +0 -30
- package/lib/utils/queryParams.d.ts +0 -2
- package/lib/utils/queryParams.d.ts.map +0 -1
- package/lib/utils/queryParams.js +0 -4
- package/lib/utils/scripts-load.d.ts +0 -2
- package/lib/utils/scripts-load.d.ts.map +0 -1
- package/lib/utils/scripts-load.js +0 -20
- package/lib/utils/testUtils.d.ts +0 -3
- package/lib/utils/testUtils.d.ts.map +0 -1
- package/lib/utils/testUtils.js +0 -12
- package/lib/utils/utils.d.ts +0 -3
- package/lib/utils/utils.d.ts.map +0 -1
- package/lib/utils/utils.js +0 -31
- /package/lib/plugins/{dash-playback → clappr-nerd-stats/speedtest}/types.js +0 -0
- /package/lib/{trace → plugins/clappr-nerd-stats}/types.js +0 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { ContainerPlugin, Events as CoreEvents, Log } from '@clappr/core';
|
|
2
|
+
import assert from 'assert';
|
|
3
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
4
|
+
import { ClapprStatsEvents } from './types.js';
|
|
5
|
+
import { newMetrics } from './utils.js';
|
|
6
|
+
// TODO: fix
|
|
7
|
+
const updateMetrics = () => { };
|
|
8
|
+
export class ClapprStats extends ContainerPlugin {
|
|
9
|
+
bwMeasureCount = 0;
|
|
10
|
+
intervalId = null;
|
|
11
|
+
lastDecodedFramesCount = 0;
|
|
12
|
+
metrics = newMetrics();
|
|
13
|
+
completion;
|
|
14
|
+
_onReport;
|
|
15
|
+
runBandwidthTestEvery;
|
|
16
|
+
runEach;
|
|
17
|
+
timers = {
|
|
18
|
+
startup: 0,
|
|
19
|
+
watch: 0,
|
|
20
|
+
pause: 0,
|
|
21
|
+
buffering: 0,
|
|
22
|
+
session: 0,
|
|
23
|
+
latency: 0,
|
|
24
|
+
};
|
|
25
|
+
updateFn = updateMetrics;
|
|
26
|
+
urisToMeasureBandwidth;
|
|
27
|
+
uriToMeasureLatency;
|
|
28
|
+
get name() {
|
|
29
|
+
return 'clappr_stats';
|
|
30
|
+
}
|
|
31
|
+
get supportedVersion() {
|
|
32
|
+
return { min: CLAPPR_VERSION };
|
|
33
|
+
}
|
|
34
|
+
get _playbackName() {
|
|
35
|
+
return String(this.container.playback.name || '');
|
|
36
|
+
}
|
|
37
|
+
get _playbackType() {
|
|
38
|
+
return this.container.getPlaybackType();
|
|
39
|
+
}
|
|
40
|
+
_now() {
|
|
41
|
+
const hasPerformanceSupport = window.performance && typeof (window.performance.now) === 'function';
|
|
42
|
+
return (hasPerformanceSupport) ? window.performance.now() : new Date().getTime();
|
|
43
|
+
}
|
|
44
|
+
_inc(counter) {
|
|
45
|
+
this.metrics.counters[counter] += 1;
|
|
46
|
+
}
|
|
47
|
+
// _timerHasStarted(timer) {
|
|
48
|
+
// return this[`_start${timer}`] !== undefined;
|
|
49
|
+
// }
|
|
50
|
+
start(timer) {
|
|
51
|
+
// this[`_start${timer}`] = this._now();
|
|
52
|
+
this.timers[timer] = this._now();
|
|
53
|
+
}
|
|
54
|
+
_stop(timer) {
|
|
55
|
+
// this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
|
|
56
|
+
this.metrics.timers[timer] += this._now() - this.timers[timer];
|
|
57
|
+
}
|
|
58
|
+
setUpdateMetrics(updateMetricsFn) {
|
|
59
|
+
this.updateFn = updateMetricsFn;
|
|
60
|
+
}
|
|
61
|
+
_defaultReport(metrics) {
|
|
62
|
+
this.updateFn(metrics);
|
|
63
|
+
}
|
|
64
|
+
constructor(container) {
|
|
65
|
+
super(container);
|
|
66
|
+
this.runEach = container.options.clapprStats?.runEach ?? 5000;
|
|
67
|
+
this._onReport = container.options.clapprStats?.onReport ?? this._defaultReport;
|
|
68
|
+
this.uriToMeasureLatency = container.options.clapprStats?.uriToMeasureLatency;
|
|
69
|
+
this.urisToMeasureBandwidth = container.options.clapprStats?.urisToMeasureBandwidth;
|
|
70
|
+
this.runBandwidthTestEvery = container.options.clapprStats?.runBandwidthTestEvery ?? 10;
|
|
71
|
+
this.completion = {
|
|
72
|
+
watch: container.options.clapprStats?.onCompletion ?? [],
|
|
73
|
+
calls: []
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
bindEvents() {
|
|
77
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_BITRATE, this.onBitrate);
|
|
78
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_STOP, this.stopReporting);
|
|
79
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_ENDED, this.stopReporting);
|
|
80
|
+
this.listenToOnce(this.container.playback, CoreEvents.PLAYBACK_PLAY_INTENT, this.startTimers);
|
|
81
|
+
this.listenToOnce(this.container, CoreEvents.CONTAINER_PLAY, this.onFirstPlaying);
|
|
82
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_PLAY, this.onPlay);
|
|
83
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_PAUSE, this.onPause);
|
|
84
|
+
this.listenToOnce(this.container, CoreEvents.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
85
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_SEEK, this.onSeek);
|
|
86
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_ERROR, () => this._inc('error'));
|
|
87
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_FULLSCREEN, () => this._inc('fullscreen'));
|
|
88
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_PLAYBACKDVRSTATECHANGED, (dvrInUse) => {
|
|
89
|
+
dvrInUse && this._inc('dvrUsage');
|
|
90
|
+
});
|
|
91
|
+
this.listenTo(this.container.playback, CoreEvents.PLAYBACK_PROGRESS, this.onProgress);
|
|
92
|
+
this.listenTo(this.container.playback, CoreEvents.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
|
|
93
|
+
}
|
|
94
|
+
destroy() {
|
|
95
|
+
this.stopReporting();
|
|
96
|
+
super.destroy();
|
|
97
|
+
}
|
|
98
|
+
exportMetrics() {
|
|
99
|
+
return structuredClone(this.metrics);
|
|
100
|
+
}
|
|
101
|
+
onBitrate(newBitrate) {
|
|
102
|
+
const bitrate = newBitrate.bitrate;
|
|
103
|
+
const now = this._now();
|
|
104
|
+
if (this.metrics.extra.bitratesHistory.length > 0) {
|
|
105
|
+
const beforeLast = this.metrics.extra.bitratesHistory[this.metrics.extra.bitratesHistory.length - 1];
|
|
106
|
+
beforeLast.end = now;
|
|
107
|
+
beforeLast.time = now - beforeLast.start;
|
|
108
|
+
}
|
|
109
|
+
this.metrics.extra.bitratesHistory.push({ start: this._now(), bitrate: bitrate });
|
|
110
|
+
this._inc('changeLevel');
|
|
111
|
+
}
|
|
112
|
+
stopReporting() {
|
|
113
|
+
this._buildReport();
|
|
114
|
+
if (this.intervalId !== null) {
|
|
115
|
+
clearInterval(this.intervalId);
|
|
116
|
+
this.intervalId = null;
|
|
117
|
+
}
|
|
118
|
+
this._newMetrics();
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
this.stopListening();
|
|
121
|
+
this.bindEvents();
|
|
122
|
+
}
|
|
123
|
+
startTimers() {
|
|
124
|
+
this.intervalId = setInterval(this._buildReport.bind(this), this.runEach);
|
|
125
|
+
this.start('session');
|
|
126
|
+
this.start('startup');
|
|
127
|
+
}
|
|
128
|
+
onFirstPlaying() {
|
|
129
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
130
|
+
this.start('watch');
|
|
131
|
+
this._stop('startup');
|
|
132
|
+
}
|
|
133
|
+
playAfterPause() {
|
|
134
|
+
this.listenTo(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
135
|
+
this._stop('pause');
|
|
136
|
+
this.start('watch');
|
|
137
|
+
}
|
|
138
|
+
onPlay() {
|
|
139
|
+
this._inc('play');
|
|
140
|
+
}
|
|
141
|
+
onPause() {
|
|
142
|
+
this._stop('watch');
|
|
143
|
+
this.start('pause');
|
|
144
|
+
this._inc('pause');
|
|
145
|
+
this.listenToOnce(this.container, CoreEvents.CONTAINER_PLAY, this.playAfterPause);
|
|
146
|
+
this.stopListening(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
|
|
147
|
+
}
|
|
148
|
+
onSeek(e) {
|
|
149
|
+
this._inc('seek');
|
|
150
|
+
this.metrics.extra.watchHistory.push([e * 1000, e * 1000]);
|
|
151
|
+
}
|
|
152
|
+
onTimeUpdate(e) {
|
|
153
|
+
const current = e.current * 1000, total = e.total * 1000, l = this.metrics.extra.watchHistory.length;
|
|
154
|
+
this.metrics.extra.duration = total;
|
|
155
|
+
this.metrics.extra.currentTime = current;
|
|
156
|
+
this.metrics.extra.watchedPercentage = (current / total) * 100;
|
|
157
|
+
if (l === 0) {
|
|
158
|
+
this.metrics.extra.watchHistory.push([current, current]);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this.metrics.extra.watchHistory[l - 1][1] = current;
|
|
162
|
+
}
|
|
163
|
+
if (this.metrics.extra.bitratesHistory.length > 0) {
|
|
164
|
+
const lastBitrate = this.metrics.extra.bitratesHistory[this.metrics.extra.bitratesHistory.length - 1];
|
|
165
|
+
if (!lastBitrate.end) {
|
|
166
|
+
lastBitrate.time = this._now() - lastBitrate.start;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
this._onCompletion();
|
|
170
|
+
}
|
|
171
|
+
onContainerUpdateWhilePlaying() {
|
|
172
|
+
if (this.container.playback.isPlaying()) {
|
|
173
|
+
this._stop('watch');
|
|
174
|
+
this.start('watch');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
onBuffering() {
|
|
178
|
+
this._inc('buffering');
|
|
179
|
+
this.start('buffering');
|
|
180
|
+
this.listenToOnce(this.container, CoreEvents.CONTAINER_STATE_BUFFERFULL, this.onBufferfull);
|
|
181
|
+
}
|
|
182
|
+
onBufferfull() {
|
|
183
|
+
this._stop('buffering');
|
|
184
|
+
this.listenToOnce(this.container, CoreEvents.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
185
|
+
}
|
|
186
|
+
onProgress(progress) {
|
|
187
|
+
this.metrics.extra.buffersize = progress.current * 1000;
|
|
188
|
+
}
|
|
189
|
+
_newMetrics() {
|
|
190
|
+
this.metrics = newMetrics();
|
|
191
|
+
}
|
|
192
|
+
_onCompletion() {
|
|
193
|
+
const currentPercentage = this.metrics.extra.watchedPercentage;
|
|
194
|
+
const allPercentages = this.completion.watch;
|
|
195
|
+
const isCalled = this.completion.calls.indexOf(currentPercentage) !== -1;
|
|
196
|
+
if (allPercentages.indexOf(currentPercentage) !== -1 && !isCalled) {
|
|
197
|
+
Log.info(this.name + ' PERCENTAGE_EVENT: ' + currentPercentage);
|
|
198
|
+
this.completion.calls.push(currentPercentage);
|
|
199
|
+
this.trigger(ClapprStatsEvents.PERCENTAGE_EVENT, currentPercentage);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
_buildReport() {
|
|
203
|
+
this._stop('session');
|
|
204
|
+
this.start('session');
|
|
205
|
+
this.metrics.extra.playbackName = this._playbackName;
|
|
206
|
+
this.metrics.extra.playbackType = this._playbackType;
|
|
207
|
+
this._calculateBitrates();
|
|
208
|
+
this._calculatePercentages();
|
|
209
|
+
this._fetchFPS();
|
|
210
|
+
this._measureLatency();
|
|
211
|
+
this._measureBandwidth();
|
|
212
|
+
this._onReport(this.metrics);
|
|
213
|
+
this.trigger(ClapprStatsEvents.REPORT_EVENT, structuredClone(this.metrics));
|
|
214
|
+
}
|
|
215
|
+
_fetchFPS() {
|
|
216
|
+
// flashls ??? - hls.droppedFramesl hls.stream.bufferLength (seconds)
|
|
217
|
+
// hls ??? (use the same?)
|
|
218
|
+
const fetchFPS = {
|
|
219
|
+
'html5_video': this._html5FetchFPS,
|
|
220
|
+
'hls': this._html5FetchFPS,
|
|
221
|
+
'dash_shaka_playback': this._html5FetchFPS
|
|
222
|
+
};
|
|
223
|
+
if (this._playbackName in fetchFPS) {
|
|
224
|
+
fetchFPS[this._playbackName].call(this);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
_calculateBitrates() {
|
|
228
|
+
const { bitratesHistory } = this.metrics.extra;
|
|
229
|
+
if (bitratesHistory.length === 0) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
let totalTime = 0;
|
|
233
|
+
let weightedTotal = 0;
|
|
234
|
+
for (const { bitrate, time = 0 } of bitratesHistory) {
|
|
235
|
+
totalTime += time;
|
|
236
|
+
weightedTotal += bitrate * time;
|
|
237
|
+
}
|
|
238
|
+
this.metrics.extra.bitrateWeightedMean = weightedTotal / totalTime;
|
|
239
|
+
this.metrics.extra.bitrateMostUsed = bitratesHistory.reduce((mostUsed, current) => (current.time || 0) > (mostUsed.time || 0) ? current : mostUsed, { time: 0, bitrate: 0, start: 0, end: 0 }).bitrate;
|
|
240
|
+
}
|
|
241
|
+
_calculatePercentages() {
|
|
242
|
+
if (this.metrics.extra.duration > 0) {
|
|
243
|
+
this.metrics.extra.bufferingPercentage = (this.metrics.timers.buffering / this.metrics.extra.duration) * 100;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
_html5FetchFPS() {
|
|
247
|
+
const videoTag = this.container.playback.el;
|
|
248
|
+
const getFirstValidValue = (...args) => args.find(val => val !== undefined);
|
|
249
|
+
const decodedFrames = getFirstValidValue(videoTag.webkitDecodedFrameCount, videoTag.mozDecodedFrames, 0);
|
|
250
|
+
const droppedFrames = getFirstValidValue(videoTag.webkitDroppedFrameCount, videoTag.mozParsedFrames && videoTag.mozDecodedFrames ? videoTag.mozParsedFrames - videoTag.mozDecodedFrames : 0, 0);
|
|
251
|
+
const decodedFramesLastTime = decodedFrames - (this.lastDecodedFramesCount || 0);
|
|
252
|
+
this.metrics.counters.decodedFrames = decodedFrames;
|
|
253
|
+
this.metrics.counters.droppedFrames = droppedFrames;
|
|
254
|
+
this.metrics.counters.fps = decodedFramesLastTime / (this.runEach / 1000);
|
|
255
|
+
this.lastDecodedFramesCount = decodedFrames;
|
|
256
|
+
}
|
|
257
|
+
// originally from https://www.smashingmagazine.com/2011/11/analyzing-network-characteristics-using-javascript-and-the-dom-part-1/
|
|
258
|
+
_measureLatency() {
|
|
259
|
+
if (this.uriToMeasureLatency) {
|
|
260
|
+
const t = [];
|
|
261
|
+
const n = 2;
|
|
262
|
+
let rtt;
|
|
263
|
+
const ld = () => {
|
|
264
|
+
t.push(this._now());
|
|
265
|
+
if (t.length > n) {
|
|
266
|
+
done();
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
const img = new Image;
|
|
270
|
+
img.onload = ld;
|
|
271
|
+
img.src = this.uriToMeasureLatency + '?' + Math.random()
|
|
272
|
+
+ '=' + this._now();
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
const done = () => {
|
|
276
|
+
rtt = t[2] - t[1];
|
|
277
|
+
this.metrics.timers.latency = rtt;
|
|
278
|
+
};
|
|
279
|
+
ld();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
// originally from https://www.smashingmagazine.com/2011/11/analyzing-network-characteristics-using-javascript-and-the-dom-part-1/
|
|
283
|
+
_measureBandwidth() {
|
|
284
|
+
if (this.urisToMeasureBandwidth && (this.bwMeasureCount % this.runBandwidthTestEvery === 0)) {
|
|
285
|
+
let i = 0;
|
|
286
|
+
const ld = (e) => {
|
|
287
|
+
if (i > 0) {
|
|
288
|
+
const prev = this.urisToMeasureBandwidth[i - 1];
|
|
289
|
+
prev.end = this._now();
|
|
290
|
+
if (prev.timer !== null) {
|
|
291
|
+
clearTimeout(prev.timer);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (i >= this.urisToMeasureBandwidth.length || (i > 0 && this.urisToMeasureBandwidth[i - 1].expired)) {
|
|
295
|
+
assert(e, 'incorrect invocation in _measureBandwidth');
|
|
296
|
+
done(e);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
const xhr = new XMLHttpRequest();
|
|
300
|
+
xhr.open('GET', this.urisToMeasureBandwidth[i].url, true);
|
|
301
|
+
xhr.responseType = 'arraybuffer';
|
|
302
|
+
xhr.onload = xhr.onabort = ld;
|
|
303
|
+
this.urisToMeasureBandwidth[i].start = this._now();
|
|
304
|
+
this.urisToMeasureBandwidth[i].timer = setTimeout((j) => {
|
|
305
|
+
this.urisToMeasureBandwidth[j].expired = true;
|
|
306
|
+
xhr.abort();
|
|
307
|
+
}, this.urisToMeasureBandwidth[i].timeout, i);
|
|
308
|
+
xhr.send();
|
|
309
|
+
}
|
|
310
|
+
i++;
|
|
311
|
+
};
|
|
312
|
+
const done = (e) => {
|
|
313
|
+
const timeSpent = (this.urisToMeasureBandwidth[i - 1].end - this.urisToMeasureBandwidth[i - 1].start) / 1000;
|
|
314
|
+
const bandwidthBps = (e.loaded * 8) / timeSpent;
|
|
315
|
+
this.metrics.extra.bandwidth = bandwidthBps;
|
|
316
|
+
this.urisToMeasureBandwidth.forEach((x) => {
|
|
317
|
+
x.start = 0;
|
|
318
|
+
x.end = 0;
|
|
319
|
+
x.expired = false;
|
|
320
|
+
if (x.timer !== null) {
|
|
321
|
+
clearTimeout(x.timer);
|
|
322
|
+
x.timer = null;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
ld();
|
|
327
|
+
}
|
|
328
|
+
this.bwMeasureCount++;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
// ClapprStats.REPORT_EVENT = 'clappr:stats:report';
|
|
332
|
+
// ClapprStats.PERCENTAGE_EVENT = 'clappr:stats:percentage';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type Metrics = {
|
|
2
|
+
counters: {
|
|
3
|
+
play: number;
|
|
4
|
+
pause: number;
|
|
5
|
+
error: number;
|
|
6
|
+
buffering: number;
|
|
7
|
+
decodedFrames: number;
|
|
8
|
+
droppedFrames: number;
|
|
9
|
+
fps: number;
|
|
10
|
+
changeLevel: number;
|
|
11
|
+
seek: number;
|
|
12
|
+
fullscreen: number;
|
|
13
|
+
dvrUsage: number;
|
|
14
|
+
};
|
|
15
|
+
timers: {
|
|
16
|
+
startup: number;
|
|
17
|
+
watch: number;
|
|
18
|
+
pause: number;
|
|
19
|
+
buffering: number;
|
|
20
|
+
session: number;
|
|
21
|
+
latency: number;
|
|
22
|
+
};
|
|
23
|
+
extra: {
|
|
24
|
+
playbackName: string;
|
|
25
|
+
playbackType: string;
|
|
26
|
+
bitratesHistory: BitrateTrackRecord[];
|
|
27
|
+
bitrateWeightedMean: number;
|
|
28
|
+
bitrateMostUsed: number;
|
|
29
|
+
buffersize: number;
|
|
30
|
+
watchHistory: Array<[number, number]>;
|
|
31
|
+
watchedPercentage: number;
|
|
32
|
+
bufferingPercentage: number;
|
|
33
|
+
bandwidth: number;
|
|
34
|
+
duration: number;
|
|
35
|
+
currentTime: number;
|
|
36
|
+
};
|
|
37
|
+
custom: Record<string, unknown>;
|
|
38
|
+
};
|
|
39
|
+
export type BitrateTrackRecord = {
|
|
40
|
+
start: number;
|
|
41
|
+
end?: number;
|
|
42
|
+
time?: number;
|
|
43
|
+
bitrate: number;
|
|
44
|
+
};
|
|
45
|
+
export type MetricsUpdateFn = (metrics: Metrics) => void;
|
|
46
|
+
export declare enum ClapprStatsEvents {
|
|
47
|
+
REPORT_EVENT = "clappr:stats:report",
|
|
48
|
+
PERCENTAGE_EVENT = "clappr:stats:percentage"
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/types.ts"],"names":[],"mappings":"AAAA,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,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,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEzD,oBAAY,iBAAiB;IAC3B,YAAY,wBAAwB;IACpC,gBAAgB,4BAA4B;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/clappr-stats/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,wBAAgB,UAAU,IAAI,OAAO,CAuCpC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function newMetrics() {
|
|
2
|
+
return {
|
|
3
|
+
counters: {
|
|
4
|
+
play: 0,
|
|
5
|
+
pause: 0,
|
|
6
|
+
error: 0,
|
|
7
|
+
buffering: 0,
|
|
8
|
+
decodedFrames: 0,
|
|
9
|
+
droppedFrames: 0,
|
|
10
|
+
fps: 0,
|
|
11
|
+
changeLevel: 0,
|
|
12
|
+
seek: 0,
|
|
13
|
+
fullscreen: 0,
|
|
14
|
+
dvrUsage: 0,
|
|
15
|
+
},
|
|
16
|
+
timers: {
|
|
17
|
+
startup: 0,
|
|
18
|
+
watch: 0,
|
|
19
|
+
pause: 0,
|
|
20
|
+
buffering: 0,
|
|
21
|
+
session: 0,
|
|
22
|
+
latency: 0,
|
|
23
|
+
},
|
|
24
|
+
extra: {
|
|
25
|
+
playbackName: '',
|
|
26
|
+
playbackType: '',
|
|
27
|
+
bitratesHistory: [],
|
|
28
|
+
bitrateWeightedMean: 0,
|
|
29
|
+
bitrateMostUsed: 0,
|
|
30
|
+
buffersize: 0,
|
|
31
|
+
watchHistory: [],
|
|
32
|
+
watchedPercentage: 0,
|
|
33
|
+
bufferingPercentage: 0,
|
|
34
|
+
bandwidth: 0,
|
|
35
|
+
duration: 0,
|
|
36
|
+
currentTime: 0,
|
|
37
|
+
},
|
|
38
|
+
custom: {},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ContainerPlugin } from '@clappr/core';
|
|
2
|
-
export
|
|
2
|
+
export declare class ClickToPause extends ContainerPlugin {
|
|
3
3
|
private pointerEnabled;
|
|
4
4
|
private timer;
|
|
5
5
|
get name(): string;
|
|
6
6
|
get supportedVersion(): {
|
|
7
|
-
min: string
|
|
7
|
+
min: string;
|
|
8
8
|
};
|
|
9
9
|
get config(): any;
|
|
10
10
|
bindEvents(): void;
|
|
@@ -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,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,CAAC;AAWjE,qBAAa,YAAa,SAAQ,eAAe;IAC/C,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,KAAK,CAAsB;IAEnC,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,MAAM,QAET;IAEQ,UAAU;IAKnB,OAAO,CAAC,KAAK;IAoBb,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,UAAU;CAMnB"}
|
|
@@ -2,23 +2,21 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
4
|
import { ContainerPlugin, Events, Playback } from '@clappr/core';
|
|
5
|
-
import { trace } from '
|
|
5
|
+
import { trace } from '@gcorevideo/utils';
|
|
6
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
6
7
|
const T = 'plugins.click_to_pause_custom';
|
|
7
|
-
export
|
|
8
|
+
export class ClickToPause extends ContainerPlugin {
|
|
8
9
|
pointerEnabled = false;
|
|
9
10
|
timer = null;
|
|
10
11
|
get name() {
|
|
11
12
|
return 'click_to_pause_custom';
|
|
12
13
|
}
|
|
13
14
|
get supportedVersion() {
|
|
14
|
-
return { min:
|
|
15
|
+
return { min: CLAPPR_VERSION };
|
|
15
16
|
}
|
|
16
17
|
get config() {
|
|
17
18
|
return this.container.options.clickToPauseConfig || {};
|
|
18
19
|
}
|
|
19
|
-
// constructor(container) {
|
|
20
|
-
// super(container);
|
|
21
|
-
// }
|
|
22
20
|
bindEvents() {
|
|
23
21
|
this.listenTo(this.container, Events.CONTAINER_CLICK, this.click);
|
|
24
22
|
this.listenTo(this.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UICorePlugin } from '@clappr/core';
|
|
2
|
+
import '../../../assets/clips/clips.scss';
|
|
3
|
+
export declare class ClipsPlugin extends UICorePlugin {
|
|
4
|
+
private clips;
|
|
5
|
+
private duration;
|
|
6
|
+
private durationGetting;
|
|
7
|
+
private _oldContainer;
|
|
8
|
+
get name(): string;
|
|
9
|
+
get attributes(): {
|
|
10
|
+
class: string;
|
|
11
|
+
};
|
|
12
|
+
bindEvents(): void;
|
|
13
|
+
private _onCoreReady;
|
|
14
|
+
unbindEvents(): void;
|
|
15
|
+
private _onMediaControlContainerChanged;
|
|
16
|
+
private playerResize;
|
|
17
|
+
private _bindContainerEvents;
|
|
18
|
+
private onTimeUpdate;
|
|
19
|
+
private parseClips;
|
|
20
|
+
getText(time: number): string;
|
|
21
|
+
makeSvg(duration: number): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=Clips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,MAAM,cAAc,CAAC;AAI/D,OAAO,kCAAkC,CAAC;AAc1C,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,KAAK,CAAmC;IAEhD,OAAO,CAAC,QAAQ,CAAa;IAE7B,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,aAAa,CAAwB;IAE7C,IAAI,IAAI,WAEP;IAED,IAAa,UAAU;;MAItB;IAEQ,UAAU;IAMnB,OAAO,CAAC,YAAY;IAUpB,YAAY;IAOZ,OAAO,CAAC,+BAA+B;IAIvC,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,IAAI,EAAE,MAAM;IASpB,OAAO,CAAC,QAAQ,EAAE,MAAM;CAsBzB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Events, UICorePlugin } from '@clappr/core';
|
|
2
|
+
import { strtimeToMiliseconds } from '../utils.js';
|
|
3
|
+
import '../../../assets/clips/clips.scss';
|
|
4
|
+
export class ClipsPlugin extends UICorePlugin {
|
|
5
|
+
clips = new Map();
|
|
6
|
+
duration = 0;
|
|
7
|
+
durationGetting = false;
|
|
8
|
+
_oldContainer;
|
|
9
|
+
get name() {
|
|
10
|
+
return 'clips';
|
|
11
|
+
}
|
|
12
|
+
get attributes() {
|
|
13
|
+
return {
|
|
14
|
+
'class': this.name
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
bindEvents() {
|
|
18
|
+
this.listenToOnce(this.core, Events.CORE_READY, this._onCoreReady);
|
|
19
|
+
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
|
|
20
|
+
this.listenTo(this.core, Events.CORE_RESIZE, this.playerResize);
|
|
21
|
+
}
|
|
22
|
+
_onCoreReady() {
|
|
23
|
+
if (!this.options.clips) {
|
|
24
|
+
this.destroy();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.parseClips();
|
|
28
|
+
}
|
|
29
|
+
unbindEvents() {
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
this.stopListening(this.core, Events.CORE_READY);
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED);
|
|
34
|
+
}
|
|
35
|
+
_onMediaControlContainerChanged() {
|
|
36
|
+
this._bindContainerEvents();
|
|
37
|
+
}
|
|
38
|
+
playerResize() {
|
|
39
|
+
this.durationGetting = false;
|
|
40
|
+
if (this.durationGetting) {
|
|
41
|
+
this.makeSvg(this.duration);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
_bindContainerEvents() {
|
|
45
|
+
if (this._oldContainer) {
|
|
46
|
+
this.stopListening(this._oldContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
47
|
+
}
|
|
48
|
+
this._oldContainer = this.core.mediaControl.container;
|
|
49
|
+
this.durationGetting = false;
|
|
50
|
+
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
51
|
+
}
|
|
52
|
+
onTimeUpdate(event) {
|
|
53
|
+
if (!this.durationGetting) {
|
|
54
|
+
this.duration = event.total;
|
|
55
|
+
this.makeSvg(event.total);
|
|
56
|
+
this.durationGetting = true;
|
|
57
|
+
}
|
|
58
|
+
for (const value of this.clips.values()) {
|
|
59
|
+
if (event.current >= value.start && event.current < value.end) {
|
|
60
|
+
this.core.mediaControl.setClipText(value.text);
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
parseClips() {
|
|
66
|
+
const textArr = this.options.clips.text.split('\n');
|
|
67
|
+
const clipsArr = textArr.map((val) => {
|
|
68
|
+
const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
|
|
69
|
+
return matchRes ? {
|
|
70
|
+
start: strtimeToMiliseconds(matchRes[1]),
|
|
71
|
+
text: matchRes[2],
|
|
72
|
+
} : null;
|
|
73
|
+
}).filter((clip) => clip !== null);
|
|
74
|
+
clipsArr.sort((a, b) => a.start - b.start);
|
|
75
|
+
clipsArr.forEach((clip, index) => {
|
|
76
|
+
this.clips.set(clip.start, {
|
|
77
|
+
index,
|
|
78
|
+
start: clip.start,
|
|
79
|
+
text: clip.text,
|
|
80
|
+
end: clipsArr[index + 1] ? clipsArr[index + 1].start : null,
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
getText(time) {
|
|
85
|
+
for (const [key, value] of this.clips.entries()) {
|
|
86
|
+
if (time >= value.start && time < value.end) {
|
|
87
|
+
return value.text;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return '';
|
|
91
|
+
}
|
|
92
|
+
makeSvg(duration) {
|
|
93
|
+
let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
|
|
94
|
+
const widthOfSeek = this.core.mediaControl.container.$el.width();
|
|
95
|
+
let finishValue = 0;
|
|
96
|
+
this.clips.forEach(val => {
|
|
97
|
+
let end = val.end;
|
|
98
|
+
if (!end) {
|
|
99
|
+
end = val.end = duration;
|
|
100
|
+
}
|
|
101
|
+
const widthChunk = (end - val.start) * widthOfSeek / duration;
|
|
102
|
+
svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
|
|
103
|
+
finishValue += widthChunk;
|
|
104
|
+
});
|
|
105
|
+
svg += `<rect x="${finishValue}" y="0" width="${widthOfSeek - finishValue}" height="30"/>\n`;
|
|
106
|
+
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
107
|
+
this.core.mediaControl.setSVGMask(svg);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { UICorePlugin, Core } from '@clappr/core';
|
|
2
|
+
import '../../../assets/context-menu/context_menu.scss';
|
|
3
|
+
export declare class ContextMenu extends UICorePlugin {
|
|
4
|
+
private _label;
|
|
5
|
+
private _url;
|
|
6
|
+
private container;
|
|
7
|
+
private menuOptions;
|
|
8
|
+
get name(): string;
|
|
9
|
+
get supportedVersion(): {
|
|
10
|
+
min: string;
|
|
11
|
+
};
|
|
12
|
+
get attributes(): {
|
|
13
|
+
class: string;
|
|
14
|
+
};
|
|
15
|
+
get mediaControl(): any;
|
|
16
|
+
get template(): any;
|
|
17
|
+
get label(): string;
|
|
18
|
+
get url(): string;
|
|
19
|
+
get exposeVersion(): {
|
|
20
|
+
label: string;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
get events(): {
|
|
24
|
+
'click [data-version]': string;
|
|
25
|
+
};
|
|
26
|
+
constructor(core: Core);
|
|
27
|
+
bindEvents(): void;
|
|
28
|
+
destroy(): import("@clappr/core").UIObject;
|
|
29
|
+
private containerChanged;
|
|
30
|
+
private toggleContextMenu;
|
|
31
|
+
private show;
|
|
32
|
+
private hide;
|
|
33
|
+
private onOpenMainPage;
|
|
34
|
+
render(): this;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/context-menu/ContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,IAAI,EAAa,MAAM,cAAc,CAAC;AAIlF,OAAO,gDAAgD,CAAC;AAQxD,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAc;IAE5B,OAAO,CAAC,IAAI,CAAc;IAE1B,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,CAAC,WAAW,CAAoB;IAEvC,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAa,UAAU;;MAEtB;IAED,IAAI,YAAY,QAEf;IAED,IAAI,QAAQ,QAEX;IAED,IAAI,KAAK,WAER;IAED,IAAI,GAAG,WAEN;IAED,IAAI,aAAa;;;MAKhB;IAED,IAAa,MAAM;;MAIlB;gBAEW,IAAI,EAAE,IAAI;IAYb,UAAU;IAYV,OAAO;IAOhB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,cAAc;IAIb,MAAM;CAShB"}
|