@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
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import assert from 'assert';
|
|
8
8
|
import { Events, UICorePlugin, Browser, Playback, Utils, template, $, } from '@clappr/core';
|
|
9
|
-
import { reportError
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
9
|
+
import { reportError } from '@gcorevideo/utils';
|
|
10
|
+
import { Kibo } from '../kibo/index.js';
|
|
11
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
12
|
+
import { getPageX, isFullscreen } from '../utils.js';
|
|
13
|
+
import '../../../assets/media-control/media-control.scss';
|
|
14
|
+
import '../../../assets/media-control/plugins.scss';
|
|
15
|
+
import mediaControlHTML from '../../../assets/media-control/media-control.ejs';
|
|
15
16
|
import playIcon from '../../../assets/icons/new/play.svg';
|
|
16
17
|
import pauseIcon from '../../../assets/icons/new/pause.svg';
|
|
17
18
|
import stopIcon from '../../../assets/icons/new/stop.svg';
|
|
@@ -19,17 +20,15 @@ import volumeMaxIcon from '../../../assets/icons/new/volume-max.svg';
|
|
|
19
20
|
import volumeOffIcon from '../../../assets/icons/new/volume-off.svg';
|
|
20
21
|
import fullscreenOffIcon from '../../../assets/icons/new/fullscreen-off.svg';
|
|
21
22
|
import fullscreenOnIcon from '../../../assets/icons/new/fullscreen-on.svg';
|
|
22
|
-
assert(process.env.CLAPPR_VERSION, 'CLAPPR_VERSION is required');
|
|
23
|
-
const CLAPPR_VERSION = process.env.CLAPPR_VERSION;
|
|
24
23
|
const T = 'plugins.media_control';
|
|
25
24
|
const { Config, Fullscreen, formatTime, extend, removeArrayItem } = Utils;
|
|
26
25
|
function orderByOrderPattern(arr, order) {
|
|
27
26
|
const arrWithoutDuplicates = [...new Set(arr)];
|
|
28
|
-
const ordered = order.filter(item => arrWithoutDuplicates.includes(item));
|
|
29
|
-
const rest = arrWithoutDuplicates.filter(item => !order.includes(item));
|
|
27
|
+
const ordered = order.filter((item) => arrWithoutDuplicates.includes(item));
|
|
28
|
+
const rest = arrWithoutDuplicates.filter((item) => !order.includes(item));
|
|
30
29
|
return [...ordered, ...rest];
|
|
31
30
|
}
|
|
32
|
-
export
|
|
31
|
+
export class MediaControl extends UICorePlugin {
|
|
33
32
|
advertisementPlaying = false;
|
|
34
33
|
buttonsColor = null;
|
|
35
34
|
currentDurationValue = 0;
|
|
@@ -99,8 +98,8 @@ export default class MediaControl extends UICorePlugin {
|
|
|
99
98
|
}
|
|
100
99
|
get attributes() {
|
|
101
100
|
return {
|
|
102
|
-
|
|
103
|
-
'data-media-control-skin-1': ''
|
|
101
|
+
class: 'media-control-skin-1',
|
|
102
|
+
'data-media-control-skin-1': '',
|
|
104
103
|
};
|
|
105
104
|
}
|
|
106
105
|
get events() {
|
|
@@ -129,14 +128,16 @@ export default class MediaControl extends UICorePlugin {
|
|
|
129
128
|
'mouseleave .bar-container[data-seekbar]': 'mouseleaveOnSeekBar',
|
|
130
129
|
'touchend .bar-container[data-seekbar]': 'mouseleaveOnSeekBar',
|
|
131
130
|
'mouseenter .media-control-layer[data-controls]': 'setUserKeepVisible',
|
|
132
|
-
'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible'
|
|
131
|
+
'mouseleave .media-control-layer[data-controls]': 'resetUserKeepVisible',
|
|
133
132
|
};
|
|
134
133
|
}
|
|
135
134
|
get template() {
|
|
136
135
|
return template(mediaControlHTML);
|
|
137
136
|
}
|
|
138
137
|
get volume() {
|
|
139
|
-
return
|
|
138
|
+
return this.container && this.container.isReady
|
|
139
|
+
? this.container.volume
|
|
140
|
+
: this.intendedVolume;
|
|
140
141
|
}
|
|
141
142
|
get muted() {
|
|
142
143
|
return this.volume === 0;
|
|
@@ -148,7 +149,8 @@ export default class MediaControl extends UICorePlugin {
|
|
|
148
149
|
this.kibo = new Kibo(this.options.focusElement);
|
|
149
150
|
this.bindKeyEvents();
|
|
150
151
|
this.userDisabled = false;
|
|
151
|
-
if ((this.container && this.container.mediaControlDisabled) ||
|
|
152
|
+
if ((this.container && this.container.mediaControlDisabled) ||
|
|
153
|
+
this.options.chromeless) {
|
|
152
154
|
this.disable();
|
|
153
155
|
}
|
|
154
156
|
$(document).bind('mouseup', this.stopDrag);
|
|
@@ -224,10 +226,6 @@ export default class MediaControl extends UICorePlugin {
|
|
|
224
226
|
this.$el.hide();
|
|
225
227
|
}
|
|
226
228
|
enable() {
|
|
227
|
-
trace(`${T} enable`, {
|
|
228
|
-
userDisabled: this.userDisabled,
|
|
229
|
-
chromeless: this.options.chromeless,
|
|
230
|
-
});
|
|
231
229
|
if (this.options.chromeless) {
|
|
232
230
|
return;
|
|
233
231
|
}
|
|
@@ -236,20 +234,17 @@ export default class MediaControl extends UICorePlugin {
|
|
|
236
234
|
this.show();
|
|
237
235
|
}
|
|
238
236
|
play() {
|
|
239
|
-
trace(`${T} play`);
|
|
240
237
|
this.container && this.container.play();
|
|
241
238
|
}
|
|
242
239
|
pause() {
|
|
243
|
-
trace(`${T} pause`);
|
|
244
240
|
this.container && this.container.pause();
|
|
245
241
|
}
|
|
246
242
|
stop() {
|
|
247
|
-
trace(`${T} stop`);
|
|
248
243
|
this.container && this.container.stop();
|
|
249
244
|
}
|
|
250
245
|
setInitialVolume() {
|
|
251
|
-
const initialVolume =
|
|
252
|
-
const options = this.container && this.container.options || this.options;
|
|
246
|
+
const initialVolume = this.persistConfig ? Config.restore('volume') : 100;
|
|
247
|
+
const options = (this.container && this.container.options) || this.options;
|
|
253
248
|
this.setVolume(options.mute ? 0 : initialVolume, true);
|
|
254
249
|
}
|
|
255
250
|
onVolumeChanged() {
|
|
@@ -257,12 +252,11 @@ export default class MediaControl extends UICorePlugin {
|
|
|
257
252
|
}
|
|
258
253
|
onLoadedMetadataOnVideoTag(event) {
|
|
259
254
|
const video = this.playback && this.playback.el;
|
|
260
|
-
trace(`${T} onLoadedMetadataOnVideoTag`, { event });
|
|
261
255
|
// video.webkitSupportsFullscreen is deprecated but iOS appears to only use this
|
|
262
256
|
// see https://github.com/clappr/clappr/issues/1127
|
|
263
257
|
if (!Fullscreen.fullscreenEnabled() && video.webkitSupportsFullscreen) {
|
|
264
258
|
this.fullScreenOnVideoTagSupported = true;
|
|
265
|
-
this.settingsUpdate(
|
|
259
|
+
this.settingsUpdate();
|
|
266
260
|
}
|
|
267
261
|
}
|
|
268
262
|
updateVolumeUI() {
|
|
@@ -277,7 +271,7 @@ export default class MediaControl extends UICorePlugin {
|
|
|
277
271
|
assert.ok(this.$volumeBarBackground, 'volume bar background must be present');
|
|
278
272
|
const barWidth = this.$volumeBarBackground.width();
|
|
279
273
|
const offset = (containerWidth - barWidth) / 2.0;
|
|
280
|
-
const pos = barWidth * this.volume / 100.0 + offset;
|
|
274
|
+
const pos = (barWidth * this.volume) / 100.0 + offset;
|
|
281
275
|
assert.ok(this.$volumeBarFill, 'volume bar fill must be present');
|
|
282
276
|
this.$volumeBarFill.css({ width: `${this.volume}%` });
|
|
283
277
|
this.$volumeBarFill.css({ width: `${this.volume}%` });
|
|
@@ -286,7 +280,10 @@ export default class MediaControl extends UICorePlugin {
|
|
|
286
280
|
// update volume bar segments on segmented bar mode
|
|
287
281
|
this.$volumeBarContainer.find('.segmented-bar-element').removeClass('fill');
|
|
288
282
|
const item = Math.ceil(this.volume / 10.0);
|
|
289
|
-
this.$volumeBarContainer
|
|
283
|
+
this.$volumeBarContainer
|
|
284
|
+
.find('.segmented-bar-element')
|
|
285
|
+
.slice(0, item)
|
|
286
|
+
.addClass('fill');
|
|
290
287
|
assert.ok(this.$volumeIcon, 'volume icon must be present');
|
|
291
288
|
this.$volumeIcon.html('');
|
|
292
289
|
this.$volumeIcon.removeClass('muted');
|
|
@@ -335,7 +332,9 @@ export default class MediaControl extends UICorePlugin {
|
|
|
335
332
|
if (this.settings.seekEnabled) {
|
|
336
333
|
// assert.ok(this.$seekBarHover && this.$seekBarContainer, 'seek bar elements must be present');
|
|
337
334
|
if (this.$seekBarHover && this.$seekBarContainer) {
|
|
338
|
-
const offsetX = MediaControl.getPageX(event) -
|
|
335
|
+
const offsetX = MediaControl.getPageX(event) -
|
|
336
|
+
this.$seekBarContainer.offset().left -
|
|
337
|
+
this.$seekBarHover.width() / 2;
|
|
339
338
|
this.$seekBarHover.css({ left: offsetX });
|
|
340
339
|
}
|
|
341
340
|
}
|
|
@@ -351,12 +350,13 @@ export default class MediaControl extends UICorePlugin {
|
|
|
351
350
|
this.draggingVolumeBar && this.setVolume(this.getVolumeFromUIEvent(event));
|
|
352
351
|
}
|
|
353
352
|
playerResize(size) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
353
|
+
if (this.container.el) {
|
|
354
|
+
if (isFullscreen(this.container.el)) {
|
|
355
|
+
this.$fullscreenToggle?.html(fullscreenOnIcon);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
this.$fullscreenToggle?.html(fullscreenOffIcon);
|
|
359
|
+
}
|
|
360
360
|
}
|
|
361
361
|
this.applyButtonStyle(this.$fullscreenToggle);
|
|
362
362
|
this.$el.removeClass('w370');
|
|
@@ -415,7 +415,7 @@ export default class MediaControl extends UICorePlugin {
|
|
|
415
415
|
const pageX = MediaControl.getPageX(event);
|
|
416
416
|
assert.ok(this.$seekBarContainer, 'seek bar container must be present');
|
|
417
417
|
const offsetX = pageX - this.$seekBarContainer.offset().left;
|
|
418
|
-
let pos = offsetX / this.$seekBarContainer.width() * 100;
|
|
418
|
+
let pos = (offsetX / this.$seekBarContainer.width()) * 100;
|
|
419
419
|
pos = Math.min(100, Math.max(pos, 0));
|
|
420
420
|
this.setSeekPercentage(pos);
|
|
421
421
|
}
|
|
@@ -432,8 +432,9 @@ export default class MediaControl extends UICorePlugin {
|
|
|
432
432
|
volumeFromUI = (offsetY / this.$volumeBarContainer.width()) * 100;
|
|
433
433
|
}
|
|
434
434
|
else {
|
|
435
|
-
const offsetX = 80 -
|
|
436
|
-
|
|
435
|
+
const offsetX = 80 -
|
|
436
|
+
Math.abs(this.$volumeBarContainer.offset().top - MediaControl.getPageY(event));
|
|
437
|
+
volumeFromUI = (offsetX / this.$volumeBarContainer.height()) * 100;
|
|
437
438
|
}
|
|
438
439
|
return volumeFromUI;
|
|
439
440
|
}
|
|
@@ -473,15 +474,15 @@ export default class MediaControl extends UICorePlugin {
|
|
|
473
474
|
}
|
|
474
475
|
}
|
|
475
476
|
onActiveContainerChanged() {
|
|
476
|
-
trace(`${T} onActiveContainerChanged`);
|
|
477
477
|
this.fullScreenOnVideoTagSupported = null;
|
|
478
478
|
this.bindEvents();
|
|
479
479
|
// set the new container to match the volume of the last one
|
|
480
480
|
this.setInitialVolume();
|
|
481
481
|
this.changeTogglePlay();
|
|
482
482
|
this.bindContainerEvents();
|
|
483
|
-
this.settingsUpdate(
|
|
484
|
-
this.container &&
|
|
483
|
+
this.settingsUpdate();
|
|
484
|
+
this.container &&
|
|
485
|
+
this.container.trigger(Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.container.isDvrInUse());
|
|
485
486
|
this.container && this.container.mediaControlDisabled && this.disable();
|
|
486
487
|
this.trigger(Events.MEDIACONTROL_CONTAINERCHANGED);
|
|
487
488
|
if (this.container.$el) {
|
|
@@ -516,9 +517,12 @@ export default class MediaControl extends UICorePlugin {
|
|
|
516
517
|
this.changeTogglePlay();
|
|
517
518
|
}
|
|
518
519
|
updateProgressBar(progress) {
|
|
519
|
-
const loadedStart = progress.start / progress.total * 100;
|
|
520
|
-
const loadedEnd = progress.current / progress.total * 100;
|
|
521
|
-
this.$seekBarLoaded?.css({
|
|
520
|
+
const loadedStart = (progress.start / progress.total) * 100;
|
|
521
|
+
const loadedEnd = (progress.current / progress.total) * 100;
|
|
522
|
+
this.$seekBarLoaded?.css({
|
|
523
|
+
left: `${loadedStart}%`,
|
|
524
|
+
width: `${loadedEnd - loadedStart}%`,
|
|
525
|
+
});
|
|
522
526
|
}
|
|
523
527
|
onTimeUpdate(timeProgress) {
|
|
524
528
|
if (this.draggingSeekBar) {
|
|
@@ -534,13 +538,17 @@ export default class MediaControl extends UICorePlugin {
|
|
|
534
538
|
}
|
|
535
539
|
renderSeekBar() {
|
|
536
540
|
// this will be triggered as soon as these become available
|
|
537
|
-
if (this.currentPositionValue === null ||
|
|
541
|
+
if (this.currentPositionValue === null ||
|
|
542
|
+
this.currentDurationValue === null) {
|
|
538
543
|
return;
|
|
539
544
|
}
|
|
540
545
|
// default to 100%
|
|
541
546
|
this.currentSeekBarPercentage = 100;
|
|
542
|
-
if (this.container &&
|
|
543
|
-
this.
|
|
547
|
+
if (this.container &&
|
|
548
|
+
(this.container.getPlaybackType() !== Playback.LIVE ||
|
|
549
|
+
this.container.isDvrInUse())) {
|
|
550
|
+
this.currentSeekBarPercentage =
|
|
551
|
+
(this.currentPositionValue / this.currentDurationValue) * 100;
|
|
544
552
|
}
|
|
545
553
|
this.setSeekPercentage(this.currentSeekBarPercentage);
|
|
546
554
|
this.drawDurationAndPosition();
|
|
@@ -563,7 +571,7 @@ export default class MediaControl extends UICorePlugin {
|
|
|
563
571
|
}
|
|
564
572
|
assert.ok(this.$seekBarContainer, 'seek bar container must be present');
|
|
565
573
|
const offsetX = MediaControl.getPageX(event) - this.$seekBarContainer.offset().left;
|
|
566
|
-
let pos = offsetX / this.$seekBarContainer.width() * 100;
|
|
574
|
+
let pos = (offsetX / this.$seekBarContainer.width()) * 100;
|
|
567
575
|
pos = Math.min(100, Math.max(pos, 0));
|
|
568
576
|
this.container && this.container.seekPercentage(pos);
|
|
569
577
|
this.setSeekPercentage(pos);
|
|
@@ -589,7 +597,9 @@ export default class MediaControl extends UICorePlugin {
|
|
|
589
597
|
return;
|
|
590
598
|
}
|
|
591
599
|
const timeout = 2000;
|
|
592
|
-
const mousePointerMoved = event &&
|
|
600
|
+
const mousePointerMoved = event &&
|
|
601
|
+
event.clientX !== this.lastMouseX &&
|
|
602
|
+
event.clientY !== this.lastMouseY;
|
|
593
603
|
if (!event || mousePointerMoved || navigator.userAgent.match(/firefox/i)) {
|
|
594
604
|
if (this.hideId !== null) {
|
|
595
605
|
clearTimeout(this.hideId);
|
|
@@ -597,7 +607,8 @@ export default class MediaControl extends UICorePlugin {
|
|
|
597
607
|
}
|
|
598
608
|
this.$el.show();
|
|
599
609
|
this.trigger(Events.MEDIACONTROL_SHOW, this.name);
|
|
600
|
-
this.container &&
|
|
610
|
+
this.container &&
|
|
611
|
+
this.container.trigger(Events.CONTAINER_MEDIACONTROL_SHOW, this.name);
|
|
601
612
|
this.$el.removeClass('media-control-hide');
|
|
602
613
|
this.hideId = setTimeout(() => this.hide(), timeout);
|
|
603
614
|
if (event) {
|
|
@@ -621,7 +632,8 @@ export default class MediaControl extends UICorePlugin {
|
|
|
621
632
|
}
|
|
622
633
|
const hasKeepVisibleRequested = this.userKeepVisible || this.keepVisible;
|
|
623
634
|
const hasDraggingAction = this.draggingSeekBar || this.draggingVolumeBar;
|
|
624
|
-
if (!this.disabled &&
|
|
635
|
+
if (!this.disabled &&
|
|
636
|
+
(delay || hasKeepVisibleRequested || hasDraggingAction)) {
|
|
625
637
|
this.hideId = setTimeout(() => this.hide(), timeout);
|
|
626
638
|
}
|
|
627
639
|
else {
|
|
@@ -642,19 +654,21 @@ export default class MediaControl extends UICorePlugin {
|
|
|
642
654
|
this.core.$el.addClass('nocursor');
|
|
643
655
|
}
|
|
644
656
|
}
|
|
645
|
-
settingsUpdate(
|
|
657
|
+
settingsUpdate() {
|
|
646
658
|
const newSettings = this.getSettings();
|
|
647
|
-
trace(`${T} settingsUpdate`, {
|
|
648
|
-
event,
|
|
649
|
-
newSettings,
|
|
650
|
-
settings: this.settings,
|
|
651
|
-
});
|
|
652
659
|
$.extend(true, newSettings, {
|
|
653
660
|
left: [],
|
|
654
661
|
default: [],
|
|
655
662
|
right: [],
|
|
656
663
|
});
|
|
657
|
-
const LEFT_ORDER = [
|
|
664
|
+
const LEFT_ORDER = [
|
|
665
|
+
'playpause',
|
|
666
|
+
'playstop',
|
|
667
|
+
'live',
|
|
668
|
+
'volume',
|
|
669
|
+
'position',
|
|
670
|
+
'duration',
|
|
671
|
+
];
|
|
658
672
|
newSettings.left = orderByOrderPattern([...newSettings.left, 'clipsText', 'volume'], LEFT_ORDER);
|
|
659
673
|
newSettings.right = [
|
|
660
674
|
'fullscreen',
|
|
@@ -666,7 +680,9 @@ export default class MediaControl extends UICorePlugin {
|
|
|
666
680
|
'vr',
|
|
667
681
|
'audiotracks',
|
|
668
682
|
];
|
|
669
|
-
if ((!this.fullScreenOnVideoTagSupported &&
|
|
683
|
+
if ((!this.fullScreenOnVideoTagSupported &&
|
|
684
|
+
!Fullscreen.fullscreenEnabled()) ||
|
|
685
|
+
this.options.fullscreenDisable) {
|
|
670
686
|
// remove fullscreen from settings if it is present
|
|
671
687
|
removeArrayItem(newSettings.default, 'fullscreen');
|
|
672
688
|
removeArrayItem(newSettings.left, 'fullscreen');
|
|
@@ -719,6 +735,13 @@ export default class MediaControl extends UICorePlugin {
|
|
|
719
735
|
this.resetIndicators();
|
|
720
736
|
this.initializeIcons();
|
|
721
737
|
}
|
|
738
|
+
getElement(name) {
|
|
739
|
+
switch (name) {
|
|
740
|
+
case 'pip':
|
|
741
|
+
return this.$pip;
|
|
742
|
+
}
|
|
743
|
+
return null;
|
|
744
|
+
}
|
|
722
745
|
resetIndicators() {
|
|
723
746
|
assert.ok(this.$duration && this.$position, 'duration and position elements must be present');
|
|
724
747
|
this.displayedPosition = this.$position.text();
|
|
@@ -754,10 +777,11 @@ export default class MediaControl extends UICorePlugin {
|
|
|
754
777
|
const currentTime = this.container.getCurrentTime();
|
|
755
778
|
const duration = this.container.getDuration();
|
|
756
779
|
let position = Math.min(Math.max(currentTime + delta, 0), duration);
|
|
757
|
-
position = Math.min(position * 100 / duration, 100);
|
|
780
|
+
position = Math.min((position * 100) / duration, 100);
|
|
758
781
|
this.container.seekPercentage(position);
|
|
759
782
|
}
|
|
760
783
|
bindKeyAndShow(key, callback) {
|
|
784
|
+
// TODO or boolean return type
|
|
761
785
|
this.kibo.down(key, () => {
|
|
762
786
|
this.show();
|
|
763
787
|
return callback();
|
|
@@ -770,16 +794,37 @@ export default class MediaControl extends UICorePlugin {
|
|
|
770
794
|
this.unbindKeyEvents();
|
|
771
795
|
this.kibo = new Kibo(this.options.focusElement || this.options.parentElement);
|
|
772
796
|
this.bindKeyAndShow('space', () => this.togglePlayPause());
|
|
773
|
-
this.bindKeyAndShow('left', () =>
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
this.bindKeyAndShow('
|
|
778
|
-
|
|
797
|
+
this.bindKeyAndShow('left', () => {
|
|
798
|
+
this.seekRelative(-5);
|
|
799
|
+
return true;
|
|
800
|
+
});
|
|
801
|
+
this.bindKeyAndShow('right', () => {
|
|
802
|
+
this.seekRelative(5);
|
|
803
|
+
return true;
|
|
804
|
+
});
|
|
805
|
+
this.bindKeyAndShow('shift left', () => {
|
|
806
|
+
this.seekRelative(-10);
|
|
807
|
+
return true;
|
|
808
|
+
});
|
|
809
|
+
this.bindKeyAndShow('shift right', () => {
|
|
810
|
+
this.seekRelative(10);
|
|
811
|
+
return true;
|
|
812
|
+
});
|
|
813
|
+
this.bindKeyAndShow('shift ctrl left', () => {
|
|
814
|
+
this.seekRelative(-15);
|
|
815
|
+
return true;
|
|
816
|
+
});
|
|
817
|
+
this.bindKeyAndShow('shift ctrl right', () => {
|
|
818
|
+
this.seekRelative(15);
|
|
819
|
+
return true;
|
|
820
|
+
});
|
|
779
821
|
const keys = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
|
|
780
822
|
keys.forEach((i) => {
|
|
781
823
|
this.bindKeyAndShow(i, () => {
|
|
782
|
-
this.settings.seekEnabled &&
|
|
824
|
+
this.settings.seekEnabled &&
|
|
825
|
+
this.container &&
|
|
826
|
+
this.container.seekPercentage(Number(i) * 10);
|
|
827
|
+
return false;
|
|
783
828
|
});
|
|
784
829
|
});
|
|
785
830
|
}
|
|
@@ -796,40 +841,38 @@ export default class MediaControl extends UICorePlugin {
|
|
|
796
841
|
}
|
|
797
842
|
}
|
|
798
843
|
parseColors() {
|
|
799
|
-
|
|
800
|
-
if (!design) {
|
|
801
|
-
design = {};
|
|
802
|
-
}
|
|
844
|
+
const design = this.options.design || {};
|
|
803
845
|
let variables = [];
|
|
804
846
|
if (!template) {
|
|
805
847
|
return;
|
|
806
848
|
}
|
|
849
|
+
// TODO camel case
|
|
807
850
|
if (design.background_color) {
|
|
808
851
|
variables = variables.concat([
|
|
809
|
-
`--theme-background-color: ${design.background_color}
|
|
852
|
+
`--theme-background-color: ${design.background_color};`,
|
|
810
853
|
]);
|
|
811
854
|
}
|
|
812
855
|
if (design.text_color) {
|
|
813
856
|
variables = variables.concat([
|
|
814
|
-
`--theme-text-color: ${design.text_color}
|
|
857
|
+
`--theme-text-color: ${design.text_color};`,
|
|
815
858
|
]);
|
|
816
859
|
}
|
|
817
860
|
if (design.foreground_color) {
|
|
818
861
|
variables = variables.concat([
|
|
819
|
-
`--theme-foreground-color: ${design.foreground_color}
|
|
862
|
+
`--theme-foreground-color: ${design.foreground_color};`,
|
|
820
863
|
]);
|
|
821
864
|
}
|
|
822
865
|
if (design.hover_color) {
|
|
823
866
|
variables = variables.concat([
|
|
824
|
-
`--theme-hover-color: ${design.hover_color}
|
|
867
|
+
`--theme-hover-color: ${design.hover_color};`,
|
|
825
868
|
]);
|
|
826
869
|
}
|
|
827
870
|
this.$el.append(`<style>:root {${variables.join('\n')}}</style>`);
|
|
828
871
|
}
|
|
829
872
|
applyButtonStyle(element) {
|
|
830
|
-
this.buttonsColor
|
|
831
|
-
&&
|
|
832
|
-
|
|
873
|
+
this.buttonsColor &&
|
|
874
|
+
element &&
|
|
875
|
+
$(element).find('svg path').css({ fill: this.buttonsColor });
|
|
833
876
|
}
|
|
834
877
|
destroy() {
|
|
835
878
|
$(document).unbind('mouseup', this.stopDrag);
|
|
@@ -844,21 +887,9 @@ export default class MediaControl extends UICorePlugin {
|
|
|
844
887
|
this.trigger(Events.MEDIACONTROL_OPTIONS_CHANGE);
|
|
845
888
|
}
|
|
846
889
|
render() {
|
|
847
|
-
trace(`${T} render`, {
|
|
848
|
-
settings: !!this.settings,
|
|
849
|
-
rendered: this.rendered,
|
|
850
|
-
disabled: this.disabled,
|
|
851
|
-
options: !!this.options,
|
|
852
|
-
$el: !!this.$el,
|
|
853
|
-
});
|
|
854
|
-
console.log(`${T} render settings`, JSON.stringify(this.settings));
|
|
855
890
|
const timeout = this.options.hideMediaControlDelay || 2000;
|
|
856
|
-
// if (this.settings) {
|
|
857
891
|
const html = this.template({ settings: this.settings ?? {} });
|
|
858
|
-
// trace(`${T} render html`, { html });
|
|
859
892
|
this.$el.html(html);
|
|
860
|
-
// }
|
|
861
|
-
// this.settings && this.$el.html(html);
|
|
862
893
|
// const style = Styler.getStyleFor(mediaControlStyle, { baseUrl: this.options.baseUrl });
|
|
863
894
|
// this.$el.append(style[0]);
|
|
864
895
|
this.createCachedElements();
|
|
@@ -874,10 +905,10 @@ export default class MediaControl extends UICorePlugin {
|
|
|
874
905
|
// Display mute/unmute icon only if Safari version >= 10
|
|
875
906
|
if (Browser.isSafari && Browser.isMobile) {
|
|
876
907
|
if (Browser.version < 10) {
|
|
877
|
-
this.$volumeContainer?.css({
|
|
908
|
+
this.$volumeContainer?.css({ display: 'none' });
|
|
878
909
|
}
|
|
879
910
|
else {
|
|
880
|
-
this.$volumeBarContainer?.css({
|
|
911
|
+
this.$volumeBarContainer?.css({ display: 'none' });
|
|
881
912
|
}
|
|
882
913
|
}
|
|
883
914
|
this.$seekBarPosition?.addClass('media-control-notransition');
|
|
@@ -889,9 +920,15 @@ export default class MediaControl extends UICorePlugin {
|
|
|
889
920
|
this.displayedSeekBarPercentage = null;
|
|
890
921
|
this.setSeekPercentage(previousSeekPercentage);
|
|
891
922
|
setTimeout(() => {
|
|
892
|
-
!this.settings.seekEnabled &&
|
|
893
|
-
|
|
894
|
-
|
|
923
|
+
!this.settings.seekEnabled &&
|
|
924
|
+
this.$seekBarContainer?.addClass('seek-disabled');
|
|
925
|
+
!Browser.isMobile &&
|
|
926
|
+
!this.options.disableKeyboardShortcuts &&
|
|
927
|
+
this.bindKeyEvents();
|
|
928
|
+
this.playerResize({
|
|
929
|
+
width: this.options.width,
|
|
930
|
+
height: this.options.height,
|
|
931
|
+
});
|
|
895
932
|
this.hideVolumeBar(0);
|
|
896
933
|
}, 0);
|
|
897
934
|
this.parseColors();
|
|
@@ -899,9 +936,7 @@ export default class MediaControl extends UICorePlugin {
|
|
|
899
936
|
this.core.$el.append(this.el);
|
|
900
937
|
this.rendered = true;
|
|
901
938
|
this.updateVolumeUI();
|
|
902
|
-
trace(`${T} render triggering rendered`);
|
|
903
939
|
this.trigger(Events.MEDIACONTROL_RENDERED);
|
|
904
|
-
trace(`${T} render triggered rendered`);
|
|
905
940
|
return this;
|
|
906
941
|
}
|
|
907
942
|
get bigPlayButton() {
|
|
@@ -939,7 +974,8 @@ export default class MediaControl extends UICorePlugin {
|
|
|
939
974
|
}
|
|
940
975
|
}
|
|
941
976
|
hideControllAds() {
|
|
942
|
-
if (this.container.advertisement &&
|
|
977
|
+
if (this.container.advertisement &&
|
|
978
|
+
this.container.advertisement.type !== 'idle') {
|
|
943
979
|
this.hide();
|
|
944
980
|
}
|
|
945
981
|
}
|
|
@@ -958,13 +994,7 @@ export default class MediaControl extends UICorePlugin {
|
|
|
958
994
|
this.container.options.mute = value;
|
|
959
995
|
}
|
|
960
996
|
static getPageX(event) {
|
|
961
|
-
|
|
962
|
-
return event.pageX;
|
|
963
|
-
}
|
|
964
|
-
if (event.changedTouches) {
|
|
965
|
-
return event.changedTouches[event.changedTouches.length - 1].pageX;
|
|
966
|
-
}
|
|
967
|
-
return 0;
|
|
997
|
+
return getPageX(event);
|
|
968
998
|
}
|
|
969
999
|
static getPageY(event) {
|
|
970
1000
|
if (event.pageY) {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Core, UICorePlugin } from '@clappr/core';
|
|
2
|
+
import '../../../assets/multi-camera/style.scss';
|
|
3
|
+
type MediaSourceInfo = {
|
|
4
|
+
live: boolean;
|
|
5
|
+
source: string;
|
|
6
|
+
id: number;
|
|
7
|
+
dvr: boolean;
|
|
8
|
+
projection: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare class MultiCamera extends UICorePlugin {
|
|
11
|
+
private currentCamera;
|
|
12
|
+
private currentTime;
|
|
13
|
+
private playing;
|
|
14
|
+
private multicamera;
|
|
15
|
+
private noActiveStreams;
|
|
16
|
+
get name(): string;
|
|
17
|
+
get supportedVersion(): {
|
|
18
|
+
min: string;
|
|
19
|
+
};
|
|
20
|
+
static get version(): string;
|
|
21
|
+
get template(): any;
|
|
22
|
+
get attributes(): {
|
|
23
|
+
class: string;
|
|
24
|
+
'data-multicamera': string;
|
|
25
|
+
};
|
|
26
|
+
get events(): {
|
|
27
|
+
'click [data-multicamera-selector-select]': string;
|
|
28
|
+
'click [data-multicamera-button]': string;
|
|
29
|
+
};
|
|
30
|
+
constructor(core: Core);
|
|
31
|
+
bindEvents(): void;
|
|
32
|
+
unBindEvents(): void;
|
|
33
|
+
private onPlay;
|
|
34
|
+
private bindPlaybackEvents;
|
|
35
|
+
private reload;
|
|
36
|
+
private shouldRender;
|
|
37
|
+
render(): this;
|
|
38
|
+
private onCameraSelect;
|
|
39
|
+
activeById(id: number, active: boolean): void;
|
|
40
|
+
private setLiveStatus;
|
|
41
|
+
private behaviorLive;
|
|
42
|
+
private behaviorOne;
|
|
43
|
+
private behaviorAll;
|
|
44
|
+
private findAndInitNextStream;
|
|
45
|
+
private showError;
|
|
46
|
+
private hideError;
|
|
47
|
+
private changeById;
|
|
48
|
+
getCamerasList(): MediaSourceInfo[];
|
|
49
|
+
getCurrentCamera(): MediaSourceInfo | null;
|
|
50
|
+
private findElementById;
|
|
51
|
+
private findIndexById;
|
|
52
|
+
private onShowLevelSelectMenu;
|
|
53
|
+
private hideSelectLevelMenu;
|
|
54
|
+
private toggleContextMenu;
|
|
55
|
+
private levelElement;
|
|
56
|
+
private highlightCurrentLevel;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=MultiCamera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiCamera.d.ts","sourceRoot":"","sources":["../../../src/plugins/multi-camera/MultiCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAA8B,YAAY,EAAE,MAAM,cAAc,CAAC;AAMvF,OAAO,yCAAyC,CAAC;AASjD,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAA;AAMD,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,aAAa,CAAgC;IAErD,OAAO,CAAC,WAAW,CAAa;IAEhC,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,WAAW,CAAyB;IAE5C,OAAO,CAAC,eAAe,CAAS;IAEhC,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,MAAM,KAAK,OAAO,WAEjB;IAED,IAAI,QAAQ,QAEX;IAED,IAAa,UAAU;;;MAKtB;IAED,IAAa,MAAM;;;MAKlB;gBAEW,IAAI,EAAE,IAAI;IAYb,UAAU;IAOnB,YAAY;IAaZ,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,YAAY;IAYX,MAAM;IAwEf,OAAO,CAAC,cAAc;IAUtB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IA8BtC,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,SAAS;IAoBjB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,UAAU;IA4ClB,cAAc;IAId,gBAAgB;IAIhB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,qBAAqB;CAK9B"}
|