@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
package/lib/gcore.types.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { TransportPreference } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* @alpha
|
|
4
|
-
*/
|
|
5
|
-
export type SrcProjectionType = 'regular' | '360' | 'vr180' | 'vr360tb';
|
|
6
|
-
/**
|
|
7
|
-
* @alpha
|
|
8
|
-
*/
|
|
9
|
-
export type ProjectionType = '360' | '180' | '360_TB';
|
|
10
|
-
/**
|
|
11
|
-
* Represents a media stream source with its associated metadata
|
|
12
|
-
* @beta
|
|
13
|
-
*/
|
|
14
|
-
export type GcoreStreamMediaSource = {
|
|
15
|
-
/**
|
|
16
|
-
* Human-readable description of the media
|
|
17
|
-
*/
|
|
18
|
-
description: string;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the stream supports DVR (Digital Video Recording) functionality
|
|
21
|
-
*/
|
|
22
|
-
dvr: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* URL for HLS CMAF stream, if available
|
|
25
|
-
*/
|
|
26
|
-
hlsCmafUrl: string | null;
|
|
27
|
-
/**
|
|
28
|
-
* URL for HLS MPEG-TS stream, if available
|
|
29
|
-
*/
|
|
30
|
-
hlsMpegtsUrl: string | null;
|
|
31
|
-
/**
|
|
32
|
-
* Unique identifier for the media source
|
|
33
|
-
*/
|
|
34
|
-
id: number;
|
|
35
|
-
/**
|
|
36
|
-
* Whether this is a live stream
|
|
37
|
-
*/
|
|
38
|
-
live: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Preferred transport protocol for this source
|
|
41
|
-
*/
|
|
42
|
-
priorityTransport: TransportPreference;
|
|
43
|
-
/**
|
|
44
|
-
* URL to the poster image
|
|
45
|
-
*/
|
|
46
|
-
poster: string | null;
|
|
47
|
-
/**
|
|
48
|
-
* The projection type for the video
|
|
49
|
-
*/
|
|
50
|
-
projection: ProjectionType | null;
|
|
51
|
-
/**
|
|
52
|
-
* URL to a preview screenshot
|
|
53
|
-
*/
|
|
54
|
-
screenshot: string | null;
|
|
55
|
-
/**
|
|
56
|
-
* Primary source URL
|
|
57
|
-
*/
|
|
58
|
-
source: string | null;
|
|
59
|
-
/**
|
|
60
|
-
* DASH manifest URL
|
|
61
|
-
*/
|
|
62
|
-
sourceDash: string | null;
|
|
63
|
-
/**
|
|
64
|
-
* URL to the video preview sprite sheet
|
|
65
|
-
*/
|
|
66
|
-
sprite: string | null;
|
|
67
|
-
/**
|
|
68
|
-
* Title of the media
|
|
69
|
-
*/
|
|
70
|
-
title: string;
|
|
71
|
-
/**
|
|
72
|
-
* URL to the WebVTT subtitle file
|
|
73
|
-
*/
|
|
74
|
-
vtt: string | null;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* @internal Gcore internal query params
|
|
78
|
-
*/
|
|
79
|
-
export declare enum _QueryParams {
|
|
80
|
-
DEBUG = "debug",
|
|
81
|
-
NO_LOW_LATENCY = "no_low_latency",
|
|
82
|
-
SUBTITLES_LANGUAGE = "sub_lang"
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=gcore.types.d.ts.map
|
package/lib/gcore.types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gcore.types.d.ts","sourceRoot":"","sources":["../src/gcore.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAA;AACvE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAA;AAErD;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,GAAG,EAAE,OAAO,CAAA;IAEZ;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAE3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;IAEb;;OAEG;IACH,iBAAiB,EAAE,mBAAmB,CAAA;IAEtC;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAErB;;OAEG;IACH,UAAU,EAAE,cAAc,GAAG,IAAI,CAAA;IAEjC;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,cAAc,mBAAmB;IACjC,kBAAkB,aAAa;CAChC"}
|
package/lib/gcore.types.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal Gcore internal query params
|
|
3
|
-
*/
|
|
4
|
-
export var _QueryParams;
|
|
5
|
-
(function (_QueryParams) {
|
|
6
|
-
_QueryParams["DEBUG"] = "debug";
|
|
7
|
-
_QueryParams["NO_LOW_LATENCY"] = "no_low_latency";
|
|
8
|
-
_QueryParams["SUBTITLES_LANGUAGE"] = "sub_lang";
|
|
9
|
-
})(_QueryParams || (_QueryParams = {}));
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { HTML5Video, Playback } from '@clappr/core';
|
|
2
|
-
import DASHJS, { type BitrateInfo as DashBitrateInfo, IManifestInfo } from 'dashjs';
|
|
3
|
-
import { QualityLevel, TimePosition, TimeValue } from '../../playback.types.js';
|
|
4
|
-
type PlaybackType = typeof Playback.VOD | typeof Playback.LIVE | typeof Playback.AOD | typeof Playback.NO_OP;
|
|
5
|
-
type PlaylistType = string;
|
|
6
|
-
type LocalTimeCorrelation = {
|
|
7
|
-
local: number;
|
|
8
|
-
remote: number;
|
|
9
|
-
};
|
|
10
|
-
export default class DashPlayback extends HTML5Video {
|
|
11
|
-
_levels: QualityLevel[] | null;
|
|
12
|
-
_currentLevel: number | null;
|
|
13
|
-
_durationExcludesAfterLiveSyncPoint: boolean;
|
|
14
|
-
_isReadyState: boolean;
|
|
15
|
-
_playableRegionDuration: number;
|
|
16
|
-
_playableRegionStartTime: number;
|
|
17
|
-
_playbackType: PlaybackType;
|
|
18
|
-
_playlistType: PlaylistType | null;
|
|
19
|
-
_programDateTime: TimeValue;
|
|
20
|
-
_dash: DASHJS.MediaPlayerClass | null;
|
|
21
|
-
_extrapolatedWindowDuration: number;
|
|
22
|
-
_lastDuration: TimeValue | null;
|
|
23
|
-
_lastTimeUpdate: TimePosition;
|
|
24
|
-
_localStartTimeCorrelation: LocalTimeCorrelation | null;
|
|
25
|
-
_localEndTimeCorrelation: LocalTimeCorrelation | null;
|
|
26
|
-
startChangeQuality: boolean;
|
|
27
|
-
manifestInfo: IManifestInfo | null;
|
|
28
|
-
_timeUpdateTimer: ReturnType<typeof setInterval> | null;
|
|
29
|
-
get name(): string;
|
|
30
|
-
get levels(): QualityLevel[];
|
|
31
|
-
get currentLevel(): number;
|
|
32
|
-
get isReady(): boolean;
|
|
33
|
-
set currentLevel(id: number);
|
|
34
|
-
get _startTime(): number;
|
|
35
|
-
get _now(): number;
|
|
36
|
-
get _extrapolatedStartTime(): number;
|
|
37
|
-
get _extrapolatedEndTime(): number;
|
|
38
|
-
get _duration(): number;
|
|
39
|
-
constructor(options: any, i18n: string, playerError?: any);
|
|
40
|
-
_setup(): void;
|
|
41
|
-
render(): this;
|
|
42
|
-
_ready(): void;
|
|
43
|
-
private _setupSrc;
|
|
44
|
-
_startTimeUpdateTimer(): void;
|
|
45
|
-
_stopTimeUpdateTimer(): void;
|
|
46
|
-
getProgramDateTime(): number;
|
|
47
|
-
getDuration(): TimeValue;
|
|
48
|
-
getCurrentTime(): TimeValue;
|
|
49
|
-
getStartTimeOffset(): TimeValue;
|
|
50
|
-
seekPercentage(percentage: number): void;
|
|
51
|
-
seek(time: TimeValue): void;
|
|
52
|
-
seekToLivePoint(): void;
|
|
53
|
-
_updateDvr(status: boolean): void;
|
|
54
|
-
_updateSettings(): void;
|
|
55
|
-
private _onPlaybackError;
|
|
56
|
-
private _onDASHJSSError;
|
|
57
|
-
private triggerError;
|
|
58
|
-
_onTimeUpdate(): void;
|
|
59
|
-
_onDurationChange(): void;
|
|
60
|
-
get dvrEnabled(): boolean;
|
|
61
|
-
_onProgress(): void;
|
|
62
|
-
play(): void;
|
|
63
|
-
pause(): void;
|
|
64
|
-
stop(): void;
|
|
65
|
-
destroy(): void;
|
|
66
|
-
_updatePlaybackType(): void;
|
|
67
|
-
_fillLevels(levels: DashBitrateInfo[]): void;
|
|
68
|
-
private onLevelSwitch;
|
|
69
|
-
getPlaybackType(): string;
|
|
70
|
-
isSeekEnabled(): boolean;
|
|
71
|
-
}
|
|
72
|
-
export {};
|
|
73
|
-
//# sourceMappingURL=DashPlayback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DashPlayback.d.ts","sourceRoot":"","sources":["../../../src/plugins/dash-playback/DashPlayback.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,UAAU,EAAO,QAAQ,EAAsB,MAAM,cAAc,CAAA;AAGpF,OAAO,MAAM,EAAE,EAIb,KAAK,WAAW,IAAI,eAAe,EAEnC,aAAa,EACd,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAoC,YAAY,EAAE,YAAY,EAAc,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAM7H,KAAK,YAAY,GACb,OAAO,QAAQ,CAAC,GAAG,GACnB,OAAO,QAAQ,CAAC,IAAI,GACpB,OAAO,QAAQ,CAAC,GAAG,GACnB,OAAO,QAAQ,CAAC,KAAK,CAAA;AAEzB,KAAK,YAAY,GAAG,MAAM,CAAA;AAE1B,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAKD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU;IAClD,OAAO,EAAE,YAAY,EAAE,GAAG,IAAI,CAAO;IAErC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAO;IAKnC,mCAAmC,EAAE,OAAO,CAAQ;IAEpD,aAAa,EAAE,OAAO,CAAQ;IAI9B,uBAAuB,EAAE,MAAM,CAAI;IASnC,wBAAwB,EAAE,MAAM,CAAI;IAEpC,aAAa,EAAE,YAAY,CAAe;IAG1C,aAAa,EAAE,YAAY,GAAG,IAAI,CAAO;IAGzC,gBAAgB,EAAE,SAAS,CAAI;IAE/B,KAAK,EAAE,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAO;IAE5C,2BAA2B,EAAE,MAAM,CAAI;IAEvC,aAAa,EAAE,SAAS,GAAG,IAAI,CAAO;IAEtC,eAAe,EAAE,YAAY,CAA2B;IAIxD,0BAA0B,EAAE,oBAAoB,GAAG,IAAI,CAAO;IAI9D,wBAAwB,EAAE,oBAAoB,GAAG,IAAI,CAAO;IAE5D,kBAAkB,UAAQ;IAE1B,YAAY,EAAE,aAAa,GAAG,IAAI,CAAO;IAEzC,gBAAgB,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,GAAG,IAAI,CAAO;IAE9D,IAAI,IAAI,WAEP;IAED,IAAI,MAAM,IAAI,YAAY,EAAE,CAE3B;IAED,IAAI,YAAY,IAAI,MAAM,CAMzB;IAED,IAAI,OAAO,YAEV;IAED,IAAI,YAAY,CAAC,EAAE,EAAE,MAAM,EAkC1B;IAED,IAAI,UAAU,WASb;IAED,IAAI,IAAI,WAEP;IAID,IAAI,sBAAsB,WAczB;IAID,IAAI,oBAAoB,WAgBvB;IAED,IAAI,SAAS,WAKZ;gBAEW,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,GAAG;IAOzD,MAAM;IAyEN,MAAM;IAMN,MAAM;YAMW,SAAS;IAI1B,qBAAqB;IAQrB,oBAAoB;IAMpB,kBAAkB;IAOlB,WAAW,IAAI,SAAS;IAQxB,cAAc,IAAI,SAAS;IAO3B,kBAAkB,IAAI,SAAS;IAI/B,cAAc,CAAC,UAAU,EAAE,MAAM;IAejC,IAAI,CAAC,IAAI,EAAE,SAAS;IAgBpB,eAAe;IAIf,UAAU,CAAC,MAAM,EAAE,OAAO;IAKjB,eAAe;IAgBxB,OAAO,CAAC,gBAAgB,CAGvB;IAED,OAAO,CAAC,eAAe,CA0BtB;IAED,OAAO,CAAC,YAAY;IAUpB,aAAa;IAqBb,iBAAiB;IAWjB,IAAI,UAAU,YASb;IAED,WAAW;IAmBX,IAAI;IAUJ,KAAK;IAWL,IAAI;IASJ,OAAO;IAkBP,mBAAmB;IAYnB,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE;IAarC,OAAO,CAAC,aAAa;IASrB,eAAe;IAIf,aAAa;CAGd"}
|
|
@@ -1,455 +0,0 @@
|
|
|
1
|
-
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a BSD-style
|
|
3
|
-
// license that can be found in the LICENSE file.
|
|
4
|
-
import { Events, HTML5Video, Log, Playback, PlayerError, Utils } from '@clappr/core';
|
|
5
|
-
import { trace } from '@gcorevideo/utils';
|
|
6
|
-
import assert from 'assert';
|
|
7
|
-
import DASHJS from 'dashjs';
|
|
8
|
-
import { PlaybackErrorCode } from '../../playback.types.js';
|
|
9
|
-
const AUTO = -1;
|
|
10
|
-
const { now } = Utils;
|
|
11
|
-
const T = 'playback.dash';
|
|
12
|
-
// @ts-expect-error
|
|
13
|
-
export default class DashPlayback extends HTML5Video {
|
|
14
|
-
_levels = null;
|
|
15
|
-
_currentLevel = null;
|
|
16
|
-
// true when the actual duration is longer than hlsjs's live sync point
|
|
17
|
-
// when this is false playableRegionDuration will be the actual duration
|
|
18
|
-
// when this is true playableRegionDuration will exclude the time after the sync point
|
|
19
|
-
_durationExcludesAfterLiveSyncPoint = false;
|
|
20
|
-
_isReadyState = false;
|
|
21
|
-
// if content is removed from the beginning then this empty area should
|
|
22
|
-
// be ignored. "playableRegionDuration" excludes the empty area
|
|
23
|
-
_playableRegionDuration = 0;
|
|
24
|
-
// for hls streams which have dvr with a sliding window,
|
|
25
|
-
// the content at the start of the playlist is removed as new
|
|
26
|
-
// content is appended at the end.
|
|
27
|
-
// this means the actual playable start time will increase as the
|
|
28
|
-
// start content is deleted
|
|
29
|
-
// For streams with dvr where the entire recording is kept from the
|
|
30
|
-
// beginning this should stay as 0
|
|
31
|
-
_playableRegionStartTime = 0;
|
|
32
|
-
_playbackType = Playback.VOD;
|
|
33
|
-
// #EXT-X-PLAYLIST-TYPE
|
|
34
|
-
_playlistType = null;
|
|
35
|
-
// #EXT-X-PROGRAM-DATE-TIME
|
|
36
|
-
_programDateTime = 0;
|
|
37
|
-
_dash = null;
|
|
38
|
-
_extrapolatedWindowDuration = 0;
|
|
39
|
-
_lastDuration = null;
|
|
40
|
-
_lastTimeUpdate = { current: 0, total: 0 };
|
|
41
|
-
// {local, remote} remote is the time in the video element that should represent 0
|
|
42
|
-
// local is the system time when the 'remote' measurment took place
|
|
43
|
-
_localStartTimeCorrelation = null;
|
|
44
|
-
// {local, remote} remote is the time in the video element that should represents the end
|
|
45
|
-
// local is the system time when the 'remote' measurment took place
|
|
46
|
-
_localEndTimeCorrelation = null;
|
|
47
|
-
startChangeQuality = false;
|
|
48
|
-
manifestInfo = null;
|
|
49
|
-
_timeUpdateTimer = null;
|
|
50
|
-
get name() {
|
|
51
|
-
return 'dash';
|
|
52
|
-
}
|
|
53
|
-
get levels() {
|
|
54
|
-
return this._levels || [];
|
|
55
|
-
}
|
|
56
|
-
get currentLevel() {
|
|
57
|
-
if (this._currentLevel === null) {
|
|
58
|
-
return AUTO;
|
|
59
|
-
}
|
|
60
|
-
// 0 is a valid level ID
|
|
61
|
-
return this._currentLevel;
|
|
62
|
-
}
|
|
63
|
-
get isReady() {
|
|
64
|
-
return this._isReadyState;
|
|
65
|
-
}
|
|
66
|
-
set currentLevel(id) {
|
|
67
|
-
this._currentLevel = id;
|
|
68
|
-
this.trigger(Events.PLAYBACK_LEVEL_SWITCH_START);
|
|
69
|
-
assert.ok(this._dash, 'An instance of dashjs MediaPlayer is required to switch levels');
|
|
70
|
-
const dash = this._dash;
|
|
71
|
-
// TODO use $.extend
|
|
72
|
-
const settings = this.options.dash ? structuredClone(this.options.dash) : {};
|
|
73
|
-
settings.streaming = settings.streaming || {};
|
|
74
|
-
settings.streaming.abr = settings.streaming.abr || {};
|
|
75
|
-
settings.streaming.abr.autoSwitchBitrate =
|
|
76
|
-
settings.streaming.abr.autoSwitchBitrate || {};
|
|
77
|
-
settings.streaming.abr.autoSwitchBitrate.video = id === -1;
|
|
78
|
-
dash.updateSettings(settings);
|
|
79
|
-
if (id !== -1) {
|
|
80
|
-
this._dash.setQualityFor('video', id);
|
|
81
|
-
}
|
|
82
|
-
if (this._playbackType === Playback.VOD) {
|
|
83
|
-
const curr_time = this._dash.time();
|
|
84
|
-
this.startChangeQuality = true;
|
|
85
|
-
dash.seek(0);
|
|
86
|
-
setTimeout(() => {
|
|
87
|
-
dash.seek(curr_time);
|
|
88
|
-
dash.play();
|
|
89
|
-
this.startChangeQuality = false;
|
|
90
|
-
}, 100);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
get _startTime() {
|
|
94
|
-
if (this._playbackType === Playback.LIVE &&
|
|
95
|
-
this._playlistType !== 'EVENT') {
|
|
96
|
-
return this._extrapolatedStartTime;
|
|
97
|
-
}
|
|
98
|
-
return this._playableRegionStartTime;
|
|
99
|
-
}
|
|
100
|
-
get _now() {
|
|
101
|
-
return now();
|
|
102
|
-
}
|
|
103
|
-
// the time in the video element which should represent the start of the sliding window
|
|
104
|
-
// extrapolated to increase in real time (instead of jumping as the early segments are removed)
|
|
105
|
-
get _extrapolatedStartTime() {
|
|
106
|
-
if (!this._localStartTimeCorrelation) {
|
|
107
|
-
return this._playableRegionStartTime;
|
|
108
|
-
}
|
|
109
|
-
const corr = this._localStartTimeCorrelation;
|
|
110
|
-
const timePassed = this._now - corr.local;
|
|
111
|
-
const extrapolatedWindowStartTime = (corr.remote + timePassed) / 1000;
|
|
112
|
-
// cap at the end of the extrapolated window duration
|
|
113
|
-
return Math.min(extrapolatedWindowStartTime, this._playableRegionStartTime + this._extrapolatedWindowDuration);
|
|
114
|
-
}
|
|
115
|
-
// the time in the video element which should represent the end of the content
|
|
116
|
-
// extrapolated to increase in real time (instead of jumping as segments are added)
|
|
117
|
-
get _extrapolatedEndTime() {
|
|
118
|
-
const actualEndTime = this._playableRegionStartTime + this._playableRegionDuration;
|
|
119
|
-
if (!this._localEndTimeCorrelation) {
|
|
120
|
-
return actualEndTime;
|
|
121
|
-
}
|
|
122
|
-
const corr = this._localEndTimeCorrelation;
|
|
123
|
-
const timePassed = this._now - corr.local;
|
|
124
|
-
const extrapolatedEndTime = (corr.remote + timePassed) / 1000;
|
|
125
|
-
return Math.max(actualEndTime - this._extrapolatedWindowDuration, Math.min(extrapolatedEndTime, actualEndTime));
|
|
126
|
-
}
|
|
127
|
-
get _duration() {
|
|
128
|
-
if (!this._dash) {
|
|
129
|
-
return Infinity;
|
|
130
|
-
}
|
|
131
|
-
return this._dash.duration() ?? Infinity;
|
|
132
|
-
}
|
|
133
|
-
constructor(options, i18n, playerError) {
|
|
134
|
-
super(options, i18n, playerError);
|
|
135
|
-
if (this.options.playbackType) {
|
|
136
|
-
this._playbackType = this.options.playbackType;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
_setup() {
|
|
140
|
-
const dash = DASHJS.MediaPlayer().create();
|
|
141
|
-
this._dash = dash;
|
|
142
|
-
this._dash.initialize();
|
|
143
|
-
if (this.options.dash) {
|
|
144
|
-
// TODO use $.extend
|
|
145
|
-
const settings = structuredClone(this.options.dash);
|
|
146
|
-
if (!settings.streaming) {
|
|
147
|
-
settings.streaming = {};
|
|
148
|
-
}
|
|
149
|
-
if (!settings.streaming.text) {
|
|
150
|
-
settings.streaming.text = {
|
|
151
|
-
defaultEnabled: false,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
this._dash.updateSettings(this.options.dash);
|
|
155
|
-
}
|
|
156
|
-
this._dash.attachView(this.el);
|
|
157
|
-
this._dash.setAutoPlay(false);
|
|
158
|
-
this._dash.attachSource(this.options.src);
|
|
159
|
-
this._dash.on(DASHJS.MediaPlayer.events.ERROR, this._onDASHJSSError);
|
|
160
|
-
this._dash.on(DASHJS.MediaPlayer.events.PLAYBACK_ERROR, this._onPlaybackError);
|
|
161
|
-
this._dash.on(DASHJS.MediaPlayer.events.STREAM_INITIALIZED, () => {
|
|
162
|
-
const bitrates = dash.getBitrateInfoListFor('video');
|
|
163
|
-
this._updatePlaybackType();
|
|
164
|
-
this._fillLevels(bitrates);
|
|
165
|
-
dash.on(DASHJS.MediaPlayer.events.QUALITY_CHANGE_REQUESTED, (evt) => {
|
|
166
|
-
// TODO
|
|
167
|
-
assert.ok(this._levels, 'An array of levels is required to change quality');
|
|
168
|
-
const newLevel = this._levels.find((level) => level.level === evt.newQuality); // TODO or simply this._levels[evt.newQuality]?
|
|
169
|
-
assert.ok(newLevel, 'A valid level is required to change quality');
|
|
170
|
-
this.onLevelSwitch(newLevel);
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
this._dash.on(DASHJS.MediaPlayer.events.METRIC_ADDED, (e) => {
|
|
174
|
-
// Listen for the first manifest request in order to update player UI
|
|
175
|
-
if (e.metric === 'DVRInfo') {
|
|
176
|
-
// TODO fix typings
|
|
177
|
-
assert.ok(this._dash, 'An instance of dashjs MediaPlayer is required to get metrics');
|
|
178
|
-
const dvrInfo = this._dash.getDashMetrics().getCurrentDVRInfo('video');
|
|
179
|
-
if (dvrInfo) {
|
|
180
|
-
// Extract time info
|
|
181
|
-
this.manifestInfo = dvrInfo.manifestInfo;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
this._dash.on(DASHJS.MediaPlayer.events.PLAYBACK_RATE_CHANGED, () => {
|
|
186
|
-
this.trigger('dash:playback-rate-changed');
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
render() {
|
|
190
|
-
this._ready();
|
|
191
|
-
return super.render();
|
|
192
|
-
}
|
|
193
|
-
_ready() {
|
|
194
|
-
this._isReadyState = true;
|
|
195
|
-
this.trigger(Events.PLAYBACK_READY, this.name);
|
|
196
|
-
}
|
|
197
|
-
// override
|
|
198
|
-
_setupSrc() {
|
|
199
|
-
// this playback manages the src on the video element itself
|
|
200
|
-
}
|
|
201
|
-
_startTimeUpdateTimer() {
|
|
202
|
-
this._stopTimeUpdateTimer();
|
|
203
|
-
this._timeUpdateTimer = setInterval(() => {
|
|
204
|
-
this._onDurationChange();
|
|
205
|
-
this._onTimeUpdate();
|
|
206
|
-
}, 100);
|
|
207
|
-
}
|
|
208
|
-
_stopTimeUpdateTimer() {
|
|
209
|
-
if (this._timeUpdateTimer) {
|
|
210
|
-
clearInterval(this._timeUpdateTimer);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
getProgramDateTime() {
|
|
214
|
-
return this._programDateTime;
|
|
215
|
-
}
|
|
216
|
-
// the duration on the video element itself should not be used
|
|
217
|
-
// as this does not necesarily represent the duration of the stream
|
|
218
|
-
// https://github.com/clappr/clappr/issues/668#issuecomment-157036678
|
|
219
|
-
getDuration() {
|
|
220
|
-
assert.ok(this._duration !== null, 'A valid duration is required to get the duration');
|
|
221
|
-
return this._duration;
|
|
222
|
-
}
|
|
223
|
-
getCurrentTime() {
|
|
224
|
-
return this._dash ? this._dash.time() : 0;
|
|
225
|
-
}
|
|
226
|
-
// the time that "0" now represents relative to when playback started
|
|
227
|
-
// for a stream with a sliding window this will increase as content is
|
|
228
|
-
// removed from the beginning
|
|
229
|
-
getStartTimeOffset() {
|
|
230
|
-
return this._startTime;
|
|
231
|
-
}
|
|
232
|
-
seekPercentage(percentage) {
|
|
233
|
-
let seekTo = this._duration;
|
|
234
|
-
if (percentage > 0) {
|
|
235
|
-
assert.ok(this._duration !== null, 'A valid duration is required to seek by percentage');
|
|
236
|
-
seekTo = this._duration * (percentage / 100);
|
|
237
|
-
}
|
|
238
|
-
assert.ok(seekTo !== null, 'A valid seek time is required');
|
|
239
|
-
this.seek(seekTo);
|
|
240
|
-
}
|
|
241
|
-
seek(time) {
|
|
242
|
-
if (time < 0) {
|
|
243
|
-
// eslint-disable-next-line max-len
|
|
244
|
-
Log.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.');
|
|
245
|
-
time = this.getDuration();
|
|
246
|
-
}
|
|
247
|
-
this.dvrEnabled && this._updateDvr(time < this.getDuration() - 10);
|
|
248
|
-
assert.ok(this._dash, 'An instance of dashjs MediaPlayer is required to seek');
|
|
249
|
-
this._dash.seek(time);
|
|
250
|
-
}
|
|
251
|
-
seekToLivePoint() {
|
|
252
|
-
this.seek(this.getDuration());
|
|
253
|
-
}
|
|
254
|
-
_updateDvr(status) {
|
|
255
|
-
this.trigger(Events.PLAYBACK_DVR, status);
|
|
256
|
-
this.trigger(Events.PLAYBACK_STATS_ADD, { dvr: status });
|
|
257
|
-
}
|
|
258
|
-
_updateSettings() {
|
|
259
|
-
if (this._playbackType === Playback.VOD) {
|
|
260
|
-
// @ts-expect-error
|
|
261
|
-
this.settings.left = ['playpause', 'position', 'duration'];
|
|
262
|
-
}
|
|
263
|
-
else if (this.dvrEnabled) {
|
|
264
|
-
// @ts-expect-error
|
|
265
|
-
this.settings.left = ['playpause'];
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
// @ts-expect-error
|
|
269
|
-
this.settings.left = ['playstop'];
|
|
270
|
-
}
|
|
271
|
-
// @ts-expect-error
|
|
272
|
-
this.settings.seekEnabled = this.isSeekEnabled();
|
|
273
|
-
this.trigger(Events.PLAYBACK_SETTINGSUPDATE);
|
|
274
|
-
}
|
|
275
|
-
_onPlaybackError = (event) => {
|
|
276
|
-
// TODO
|
|
277
|
-
trace(`${T} _onPlaybackError`, { event });
|
|
278
|
-
};
|
|
279
|
-
_onDASHJSSError = (event) => {
|
|
280
|
-
trace(`${T} _onDASHJSSError`, { event });
|
|
281
|
-
this._stopTimeUpdateTimer();
|
|
282
|
-
const e = event.error;
|
|
283
|
-
switch (e.code) {
|
|
284
|
-
case DASHJS.MediaPlayer.errors.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE:
|
|
285
|
-
case DASHJS.MediaPlayer.errors.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE:
|
|
286
|
-
case DASHJS.MediaPlayer.errors.DOWNLOAD_ERROR_ID_MANIFEST_CODE:
|
|
287
|
-
case DASHJS.MediaPlayer.errors.DOWNLOAD_ERROR_ID_CONTENT_CODE:
|
|
288
|
-
this.triggerError({
|
|
289
|
-
code: PlaybackErrorCode.MediaSourceUnavailable,
|
|
290
|
-
message: e.message,
|
|
291
|
-
description: e.message,
|
|
292
|
-
level: PlayerError.Levels.FATAL,
|
|
293
|
-
});
|
|
294
|
-
break;
|
|
295
|
-
// TODO more cases
|
|
296
|
-
default:
|
|
297
|
-
this.triggerError({
|
|
298
|
-
code: PlaybackErrorCode.Generic,
|
|
299
|
-
message: e.message,
|
|
300
|
-
description: e.message,
|
|
301
|
-
level: PlayerError.Levels.FATAL,
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
triggerError(error) {
|
|
306
|
-
trace(`${T} triggerError`, { error });
|
|
307
|
-
this.trigger(Events.PLAYBACK_ERROR, error);
|
|
308
|
-
// only reset the dash player in 10ms async, so that the rest of the
|
|
309
|
-
// calling function finishes
|
|
310
|
-
setTimeout(() => {
|
|
311
|
-
this.stop();
|
|
312
|
-
}, 10);
|
|
313
|
-
}
|
|
314
|
-
_onTimeUpdate() {
|
|
315
|
-
if (this.startChangeQuality) {
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
const update = {
|
|
319
|
-
current: this.getCurrentTime(),
|
|
320
|
-
total: this.getDuration(),
|
|
321
|
-
firstFragDateTime: this.getProgramDateTime(),
|
|
322
|
-
};
|
|
323
|
-
const isSame = this._lastTimeUpdate &&
|
|
324
|
-
update.current === this._lastTimeUpdate.current &&
|
|
325
|
-
update.total === this._lastTimeUpdate.total;
|
|
326
|
-
if (isSame) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
this._lastTimeUpdate = update;
|
|
330
|
-
this.trigger(Events.PLAYBACK_TIMEUPDATE, update, this.name);
|
|
331
|
-
}
|
|
332
|
-
_onDurationChange() {
|
|
333
|
-
const duration = this.getDuration();
|
|
334
|
-
if (this._lastDuration === duration) {
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
this._lastDuration = duration;
|
|
338
|
-
super._onDurationChange();
|
|
339
|
-
}
|
|
340
|
-
get dvrEnabled() {
|
|
341
|
-
if (!this._dash) {
|
|
342
|
-
trace(`${T} dvrEnable no dash player instance`);
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
return (this._dash?.getDVRWindowSize() >= this._minDvrSize &&
|
|
346
|
-
this.getPlaybackType() === Playback.LIVE);
|
|
347
|
-
}
|
|
348
|
-
_onProgress() {
|
|
349
|
-
if (!this._dash) {
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
let buffer = this._dash.getDashMetrics().getCurrentBufferLevel('video');
|
|
353
|
-
if (!buffer) {
|
|
354
|
-
buffer = this._dash.getDashMetrics().getCurrentBufferLevel('audio');
|
|
355
|
-
}
|
|
356
|
-
const progress = {
|
|
357
|
-
start: this.getCurrentTime(),
|
|
358
|
-
current: this.getCurrentTime() + buffer,
|
|
359
|
-
total: this.getDuration(),
|
|
360
|
-
};
|
|
361
|
-
this.trigger(Events.PLAYBACK_PROGRESS, progress, {});
|
|
362
|
-
}
|
|
363
|
-
play() {
|
|
364
|
-
trace(`${T} play`, { dash: !!this._dash });
|
|
365
|
-
if (!this._dash) {
|
|
366
|
-
this._setup();
|
|
367
|
-
}
|
|
368
|
-
super.play();
|
|
369
|
-
this._startTimeUpdateTimer();
|
|
370
|
-
}
|
|
371
|
-
pause() {
|
|
372
|
-
if (!this._dash) {
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
super.pause();
|
|
376
|
-
if (this.dvrEnabled) {
|
|
377
|
-
this._updateDvr(true);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
stop() {
|
|
381
|
-
if (this._dash) {
|
|
382
|
-
this._stopTimeUpdateTimer();
|
|
383
|
-
this._dash.reset();
|
|
384
|
-
super.stop();
|
|
385
|
-
this._dash = null;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
destroy() {
|
|
389
|
-
this._stopTimeUpdateTimer();
|
|
390
|
-
if (this._dash) {
|
|
391
|
-
this._dash.off(DASHJS.MediaPlayer.events.ERROR, this._onDASHJSSError);
|
|
392
|
-
this._dash.off(DASHJS.MediaPlayer.events.PLAYBACK_ERROR, this._onPlaybackError);
|
|
393
|
-
this._dash.off(DASHJS.MediaPlayer.events.MANIFEST_LOADED, this.getDuration);
|
|
394
|
-
this._dash.reset();
|
|
395
|
-
}
|
|
396
|
-
this._dash = null;
|
|
397
|
-
return super.destroy();
|
|
398
|
-
}
|
|
399
|
-
_updatePlaybackType() {
|
|
400
|
-
assert.ok(this._dash, 'An instance of dashjs MediaPlayer is required to update the playback type');
|
|
401
|
-
const prevPlaybackType = this._playbackType;
|
|
402
|
-
this._playbackType = this._dash.isDynamic() ? Playback.LIVE : Playback.VOD;
|
|
403
|
-
if (prevPlaybackType !== this._playbackType) {
|
|
404
|
-
this._updateSettings();
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
_fillLevels(levels) {
|
|
408
|
-
// TOOD check that levels[i].qualityIndex === i
|
|
409
|
-
this._levels = levels.map((level) => {
|
|
410
|
-
return {
|
|
411
|
-
level: level.qualityIndex,
|
|
412
|
-
bitrate: level.bitrate,
|
|
413
|
-
width: level.width,
|
|
414
|
-
height: level.height,
|
|
415
|
-
};
|
|
416
|
-
});
|
|
417
|
-
this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this._levels);
|
|
418
|
-
}
|
|
419
|
-
onLevelSwitch(currentLevel) {
|
|
420
|
-
// TODO check the two below
|
|
421
|
-
this.trigger(Events.PLAYBACK_LEVEL_SWITCH, currentLevel);
|
|
422
|
-
this.trigger(Events.PLAYBACK_LEVEL_SWITCH_END);
|
|
423
|
-
const isHD = (currentLevel.height >= 720 || (currentLevel.bitrate / 1000) >= 2000);
|
|
424
|
-
this.trigger(Events.PLAYBACK_HIGHDEFINITIONUPDATE, isHD);
|
|
425
|
-
this.trigger(Events.PLAYBACK_BITRATE, currentLevel);
|
|
426
|
-
}
|
|
427
|
-
getPlaybackType() {
|
|
428
|
-
return this._playbackType;
|
|
429
|
-
}
|
|
430
|
-
isSeekEnabled() {
|
|
431
|
-
return this._playbackType === Playback.VOD || this.dvrEnabled;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
DashPlayback.canPlay = function (resource, mimeType) {
|
|
435
|
-
const resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || [];
|
|
436
|
-
// There is an ambiguity in the mimeType, as 'video/mp4' is playable by dash.js as well as hls.js
|
|
437
|
-
// and even native html video
|
|
438
|
-
// Needs investigation and probably a fallback mechanism
|
|
439
|
-
const isDash = (resourceParts.length > 1 && resourceParts[1].toLowerCase() === 'mpd') ||
|
|
440
|
-
mimeType === 'application/dash+xml'; /* ||
|
|
441
|
-
mimeType === 'video/mp4' */
|
|
442
|
-
trace(`${T} canPlay`, {
|
|
443
|
-
isDash,
|
|
444
|
-
resource,
|
|
445
|
-
mimeType,
|
|
446
|
-
});
|
|
447
|
-
if (!isDash) {
|
|
448
|
-
return false;
|
|
449
|
-
}
|
|
450
|
-
const ms = window.MediaSource;
|
|
451
|
-
const mms = 'ManagedMediaSource' in window ? window.ManagedMediaSource : undefined;
|
|
452
|
-
const wms = 'WebKitMediaSource' in window ? window.WebKitMediaSource : undefined;
|
|
453
|
-
const ctor = ms || mms || wms;
|
|
454
|
-
return typeof ctor === 'function';
|
|
455
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/dash-playback/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;CACd,CAAA"}
|