@gcorevideo/player 2.18.3 → 2.19.0
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/plugins/index.js/index.plugins.js +40837 -0
- package/dist/plugins/index.plugins.js +40837 -0
- 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 +38 -0
- package/lib/index.plugins.d.ts.map +1 -0
- package/lib/index.plugins.js +40 -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/speedtest/types.js +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-nerd-stats/types.js +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 +4 -4
- package/lib/plugins/dvr-controls/DVRControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/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 +42 -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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { UICorePlugin, Events, template, $ } from '@clappr/core';
|
|
2
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
3
|
+
import '../../../assets/context-menu/context_menu.scss';
|
|
4
|
+
import templateHtml from '../../../assets/context-menu/context_menu.ejs';
|
|
5
|
+
export class ContextMenu extends UICorePlugin {
|
|
6
|
+
_label = '';
|
|
7
|
+
_url = '';
|
|
8
|
+
container = null;
|
|
9
|
+
menuOptions = [];
|
|
10
|
+
get name() {
|
|
11
|
+
return 'context_menu';
|
|
12
|
+
}
|
|
13
|
+
get supportedVersion() {
|
|
14
|
+
return { min: CLAPPR_VERSION };
|
|
15
|
+
}
|
|
16
|
+
get attributes() {
|
|
17
|
+
return { 'class': 'context-menu' };
|
|
18
|
+
}
|
|
19
|
+
get mediaControl() {
|
|
20
|
+
return this.core.mediaControl;
|
|
21
|
+
}
|
|
22
|
+
get template() {
|
|
23
|
+
return template(templateHtml);
|
|
24
|
+
}
|
|
25
|
+
get label() {
|
|
26
|
+
return this._label || 'Gcore player ver. ' + process.env.VERSION;
|
|
27
|
+
}
|
|
28
|
+
get url() {
|
|
29
|
+
return this._url || 'https://gcore.com/';
|
|
30
|
+
}
|
|
31
|
+
get exposeVersion() {
|
|
32
|
+
return {
|
|
33
|
+
label: this.label,
|
|
34
|
+
name: 'version'
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
get events() {
|
|
38
|
+
return {
|
|
39
|
+
'click [data-version]': 'onOpenMainPage'
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
constructor(core) {
|
|
43
|
+
super(core);
|
|
44
|
+
if (this.options.contextMenu && this.options.contextMenu.label) {
|
|
45
|
+
this._label = this.options.contextMenu.label;
|
|
46
|
+
}
|
|
47
|
+
if (this.options.contextMenu && this.options.contextMenu.url) {
|
|
48
|
+
this._url = this.options.contextMenu.url;
|
|
49
|
+
}
|
|
50
|
+
this.render();
|
|
51
|
+
this.bindEvents();
|
|
52
|
+
}
|
|
53
|
+
bindEvents() {
|
|
54
|
+
if (this.mediaControl) {
|
|
55
|
+
this.listenTo(this.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);
|
|
56
|
+
if (this.container) {
|
|
57
|
+
this.listenTo(this.container, Events.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
|
|
58
|
+
this.listenTo(this.container, Events.CONTAINER_CLICK, this.hide);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
$('body').on('click', this.hide.bind(this));
|
|
62
|
+
}
|
|
63
|
+
destroy() {
|
|
64
|
+
$('body').off('click', this.hide.bind(this));
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
this.stopListening();
|
|
67
|
+
return super.destroy();
|
|
68
|
+
}
|
|
69
|
+
containerChanged() {
|
|
70
|
+
this.container = this.core.activeContainer;
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
this.stopListening();
|
|
73
|
+
this.bindEvents();
|
|
74
|
+
}
|
|
75
|
+
toggleContextMenu(event) {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
const offset = this.container?.$el.offset();
|
|
78
|
+
this.show(event.pageY - offset.top, event.pageX - offset.left);
|
|
79
|
+
}
|
|
80
|
+
show(top, left) {
|
|
81
|
+
this.hide();
|
|
82
|
+
if (this.options.contextMenu && this.options.contextMenu.preventShowContextMenu) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.$el.css({ top, left });
|
|
86
|
+
this.$el.show();
|
|
87
|
+
}
|
|
88
|
+
hide() {
|
|
89
|
+
this.$el.hide();
|
|
90
|
+
}
|
|
91
|
+
onOpenMainPage() {
|
|
92
|
+
window.open(this.url, '_blank');
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
this.menuOptions = [this.exposeVersion];
|
|
96
|
+
this.$el.html(this.template({ options: this.menuOptions }));
|
|
97
|
+
this.core.$el.append(this.$el);
|
|
98
|
+
this.hide();
|
|
99
|
+
this.disable();
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/disable-controls/DisableControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAU,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DisableControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/disable-controls/DisableControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAU,MAAM,cAAc,CAAC;AAIpD,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,IAAI,IAAI,WAEP;IAED,IAAI,SAAS,QAEZ;IAED,IAAI,gBAAgB;;MAEnB;IAEQ,UAAU;IAcnB,YAAY;IAqBZ,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,kBAAkB;CAQ3B"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { UICorePlugin, Events } from '@clappr/core';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const CLAPPR_VERSION = process.env.CLAPPR_VERSION;
|
|
5
|
-
export default class DisableControls extends UICorePlugin {
|
|
2
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
3
|
+
export class DisableControls extends UICorePlugin {
|
|
6
4
|
get name() {
|
|
7
|
-
return '
|
|
5
|
+
return 'disable_controls';
|
|
8
6
|
}
|
|
9
7
|
get container() {
|
|
10
8
|
return this.core && this.core.activeContainer;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Core, UICorePlugin } from '@clappr/core';
|
|
2
|
-
import '../../../assets/
|
|
3
|
-
export
|
|
2
|
+
import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
3
|
+
export declare class DvrControls extends UICorePlugin {
|
|
4
4
|
get template(): any;
|
|
5
5
|
get name(): string;
|
|
6
6
|
get supportedVersion(): {
|
|
7
|
-
min: string
|
|
7
|
+
min: string;
|
|
8
8
|
};
|
|
9
9
|
get events(): {
|
|
10
10
|
'click .live-button': string;
|
|
@@ -24,4 +24,4 @@ export default class DVRControls extends UICorePlugin {
|
|
|
24
24
|
shouldRender(): boolean;
|
|
25
25
|
render(): this;
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=DvrControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"DvrControls.d.ts","sourceRoot":"","sources":["../../../src/plugins/dvr-controls/DvrControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,YAAY,EAAY,MAAM,cAAc,CAAC;AAK9E,OAAO,gDAAgD,CAAC;AAExD,qBAAa,WAAY,SAAQ,YAAY;IAC3C,IAAI,QAAQ,QAEX;IAED,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAa,MAAM;;MAIlB;IAED,IAAa,UAAU;;;MAKtB;gBAEW,IAAI,EAAE,IAAI;IAKb,UAAU;IASnB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,UAAU;IAkBlB,KAAK;IAaL,cAAc;IAWd,YAAY;IAMH,MAAM;CAYhB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Events, Playback, UICorePlugin, template } from '@clappr/core';
|
|
2
|
-
import
|
|
3
|
-
import '../../../assets/
|
|
4
|
-
|
|
2
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
3
|
+
import dvrHTML from '../../../assets/dvr-controls/index.ejs';
|
|
4
|
+
import '../../../assets/dvr-controls/dvr_controls.scss';
|
|
5
|
+
export class DvrControls extends UICorePlugin {
|
|
5
6
|
get template() {
|
|
6
7
|
return template(dvrHTML);
|
|
7
8
|
}
|
|
@@ -9,7 +10,7 @@ export default class DVRControls extends UICorePlugin {
|
|
|
9
10
|
return 'dvr_controls';
|
|
10
11
|
}
|
|
11
12
|
get supportedVersion() {
|
|
12
|
-
return { min:
|
|
13
|
+
return { min: CLAPPR_VERSION };
|
|
13
14
|
}
|
|
14
15
|
get events() {
|
|
15
16
|
return {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { UICorePlugin } from '@clappr/core';
|
|
2
|
+
import '../../../assets/error-screen/error_screen.scss';
|
|
3
|
+
type PresentationalError = {
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
code: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
reloadIcon: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class ErrorScreen extends UICorePlugin {
|
|
11
|
+
private _retry;
|
|
12
|
+
private err;
|
|
13
|
+
private hideValue;
|
|
14
|
+
private timeout;
|
|
15
|
+
private reloadButton;
|
|
16
|
+
get name(): string;
|
|
17
|
+
get supportedVersion(): {
|
|
18
|
+
min: string;
|
|
19
|
+
};
|
|
20
|
+
get template(): any;
|
|
21
|
+
get container(): any;
|
|
22
|
+
get attributes(): {
|
|
23
|
+
class: string;
|
|
24
|
+
'data-error-screen': string;
|
|
25
|
+
};
|
|
26
|
+
bindEvents(): void;
|
|
27
|
+
private onCoreReady;
|
|
28
|
+
private onPlay;
|
|
29
|
+
private destroyError;
|
|
30
|
+
unBindEvents(): void;
|
|
31
|
+
private bindReload;
|
|
32
|
+
private reload;
|
|
33
|
+
private unbindReload;
|
|
34
|
+
private onContainerChanged;
|
|
35
|
+
private onStartAd;
|
|
36
|
+
private onFinishAd;
|
|
37
|
+
private onError;
|
|
38
|
+
private drying;
|
|
39
|
+
show(err?: PresentationalError): void;
|
|
40
|
+
hide(): void;
|
|
41
|
+
render(): this;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=ErrorScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorScreen.d.ts","sourceRoot":"","sources":["../../../src/plugins/error-screen/ErrorScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiC,MAAM,cAAc,CAAC;AAQ3E,OAAO,gDAAgD,CAAC;AAaxD,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAID,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,MAAM,CAAK;IAEnB,OAAO,CAAC,GAAG,CAAoC;IAE/C,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,YAAY,CAA4B;IAEhD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,IAAI,QAAQ,QAEX;IAED,IAAI,SAAS,QAEZ;IAED,IAAa,UAAU;;;MAKtB;IAEQ,UAAU;IAQnB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,YAAY;IAWpB,YAAY;IASZ,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,OAAO;IAqDf,OAAO,CAAC,MAAM;IAad,IAAI,CAAC,GAAG,CAAC,EAAE,mBAAmB;IAS9B,IAAI;IAIK,MAAM;CAYhB"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { UICorePlugin, Events, template, PlayerError } from '@clappr/core';
|
|
2
|
+
import { trace } from '@gcorevideo/utils';
|
|
3
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
4
|
+
import reloadIcon from '../../../assets/icons/old/reload.svg';
|
|
5
|
+
import templateHtml from '../../../assets/error-screen/error_screen.ejs';
|
|
6
|
+
import '../../../assets/error-screen/error_screen.scss';
|
|
7
|
+
const TIME_FOR_UPDATE = 10000;
|
|
8
|
+
const MAX_RETRY = 10;
|
|
9
|
+
const T = 'plugins.error_screen';
|
|
10
|
+
export class ErrorScreen extends UICorePlugin {
|
|
11
|
+
_retry = 0;
|
|
12
|
+
err = null;
|
|
13
|
+
hideValue = false;
|
|
14
|
+
timeout = null;
|
|
15
|
+
reloadButton = null;
|
|
16
|
+
get name() {
|
|
17
|
+
return 'error_gplayer';
|
|
18
|
+
}
|
|
19
|
+
get supportedVersion() {
|
|
20
|
+
return { min: CLAPPR_VERSION };
|
|
21
|
+
}
|
|
22
|
+
get template() {
|
|
23
|
+
return template(templateHtml);
|
|
24
|
+
}
|
|
25
|
+
get container() {
|
|
26
|
+
return this.core.activeContainer;
|
|
27
|
+
}
|
|
28
|
+
get attributes() {
|
|
29
|
+
return {
|
|
30
|
+
'class': 'player-error-screen',
|
|
31
|
+
'data-error-screen': '',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
bindEvents() {
|
|
35
|
+
this.listenTo(this.core, Events.ERROR, this.onError);
|
|
36
|
+
this.listenTo(this.core, Events.CORE_READY, this.onCoreReady);
|
|
37
|
+
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
38
|
+
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
39
|
+
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged);
|
|
40
|
+
}
|
|
41
|
+
onCoreReady() {
|
|
42
|
+
trace(`${T} onCoreReady`);
|
|
43
|
+
if (this.core.activePlayback) {
|
|
44
|
+
this.listenTo(this.core.activePlayback, Events.PLAYBACK_PLAY, this.onPlay);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
onPlay() {
|
|
48
|
+
trace(`${T} onPlay`);
|
|
49
|
+
this.destroyError();
|
|
50
|
+
}
|
|
51
|
+
destroyError() {
|
|
52
|
+
trace(`${T} destroyError`);
|
|
53
|
+
this._retry = 0;
|
|
54
|
+
this.err = null;
|
|
55
|
+
if (this.timeout !== null) {
|
|
56
|
+
clearTimeout(this.timeout);
|
|
57
|
+
this.timeout = null;
|
|
58
|
+
}
|
|
59
|
+
this.$el.hide();
|
|
60
|
+
}
|
|
61
|
+
unBindEvents() {
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
this.stopListening(this.core, 'core:advertisement:start');
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
this.stopListening(this.core, 'core:advertisement:finish');
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
this.stopListening(this.core, Events.ERROR);
|
|
68
|
+
}
|
|
69
|
+
bindReload() {
|
|
70
|
+
this.reloadButton = this.$el.find('.player-error-screen__reload');
|
|
71
|
+
this.reloadButton && this.reloadButton.on('click', this.reload.bind(this));
|
|
72
|
+
}
|
|
73
|
+
reload() {
|
|
74
|
+
this._retry++;
|
|
75
|
+
this.core.configure({
|
|
76
|
+
...this.options,
|
|
77
|
+
autoPlay: true
|
|
78
|
+
});
|
|
79
|
+
this.core.activeContainer.mediaControlDisabled = false;
|
|
80
|
+
this.unbindReload();
|
|
81
|
+
}
|
|
82
|
+
unbindReload() {
|
|
83
|
+
this.reloadButton && this.reloadButton.off('click');
|
|
84
|
+
}
|
|
85
|
+
onContainerChanged() {
|
|
86
|
+
this.err = null;
|
|
87
|
+
if (this.core.getPlugin('error_screen')) {
|
|
88
|
+
this.core.getPlugin('error_screen').disable();
|
|
89
|
+
}
|
|
90
|
+
this.unbindReload();
|
|
91
|
+
this.hide();
|
|
92
|
+
}
|
|
93
|
+
onStartAd() {
|
|
94
|
+
this.hideValue = true;
|
|
95
|
+
if (this.err) {
|
|
96
|
+
this.hide();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
onFinishAd() {
|
|
100
|
+
this.hideValue = false;
|
|
101
|
+
if (this.err) {
|
|
102
|
+
this.container.disableMediaControl();
|
|
103
|
+
this.container.stop();
|
|
104
|
+
this.show();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
onError(err) {
|
|
108
|
+
trace(`${T} onError`, { err });
|
|
109
|
+
if (err.level === PlayerError.Levels.FATAL ||
|
|
110
|
+
err.details === 'bufferStalledError' ||
|
|
111
|
+
err.details === 'manifestParsingError') {
|
|
112
|
+
this.err = {
|
|
113
|
+
title: this.core.i18n.t('no_broadcast'),
|
|
114
|
+
message: '',
|
|
115
|
+
code: '',
|
|
116
|
+
// icon: (this.err.UI && this.err.UI.icon) || '',
|
|
117
|
+
icon: '',
|
|
118
|
+
reloadIcon,
|
|
119
|
+
};
|
|
120
|
+
if (this.options.errorScreen?.reloadOnError === false) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (this.options.errorScreen?.neverStopToRetry) {
|
|
124
|
+
this._retry = 0;
|
|
125
|
+
}
|
|
126
|
+
if (this._retry >= MAX_RETRY) {
|
|
127
|
+
this.drying();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const ctp = this.container.getPlugin('click_to_pause_custom');
|
|
131
|
+
const toggleCTP = !!ctp?.enabled;
|
|
132
|
+
if (toggleCTP) {
|
|
133
|
+
// clickToPausePlugin.afterEnabled = true;
|
|
134
|
+
ctp.disable();
|
|
135
|
+
}
|
|
136
|
+
this.timeout = setTimeout(() => {
|
|
137
|
+
if (toggleCTP) {
|
|
138
|
+
ctp.enable();
|
|
139
|
+
}
|
|
140
|
+
this.reload();
|
|
141
|
+
}, TIME_FOR_UPDATE);
|
|
142
|
+
const spinnerPlugin = this.container.getPlugin('spinner');
|
|
143
|
+
if (spinnerPlugin) {
|
|
144
|
+
spinnerPlugin.show(); // TODO remove?
|
|
145
|
+
setTimeout(() => spinnerPlugin.show(), 0);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
drying() {
|
|
150
|
+
const spinnerPlugin = this.container.getPlugin('spinner');
|
|
151
|
+
spinnerPlugin?.hide();
|
|
152
|
+
this._retry = 0;
|
|
153
|
+
if (!this.hideValue) {
|
|
154
|
+
this.container.disableMediaControl();
|
|
155
|
+
this.container.stop();
|
|
156
|
+
this.show();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
show(err) {
|
|
160
|
+
if (err) {
|
|
161
|
+
this.err = err;
|
|
162
|
+
}
|
|
163
|
+
this.core.mediaControl.disable();
|
|
164
|
+
this.render();
|
|
165
|
+
this.$el.show();
|
|
166
|
+
}
|
|
167
|
+
hide() {
|
|
168
|
+
this.$el.hide();
|
|
169
|
+
}
|
|
170
|
+
render() {
|
|
171
|
+
if (!this.err) {
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
this.$el.html(this.template(this.err));
|
|
175
|
+
this.core.$el.append(this.el);
|
|
176
|
+
this.bindReload();
|
|
177
|
+
return this;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CorePlugin, Core } from '@clappr/core';
|
|
2
|
+
export declare class Favicon extends CorePlugin {
|
|
3
|
+
private _container;
|
|
4
|
+
private oldIcon;
|
|
5
|
+
private playIcon;
|
|
6
|
+
private pauseIcon;
|
|
7
|
+
private stopIcon;
|
|
8
|
+
get name(): string;
|
|
9
|
+
get supportedVersion(): {
|
|
10
|
+
min: string;
|
|
11
|
+
};
|
|
12
|
+
constructor(core: Core);
|
|
13
|
+
configure(): void;
|
|
14
|
+
bindEvents(): void;
|
|
15
|
+
private containerChanged;
|
|
16
|
+
disable(): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
private createIcon;
|
|
19
|
+
private setPlayIcon;
|
|
20
|
+
private setPauseIcon;
|
|
21
|
+
private resetIcon;
|
|
22
|
+
private changeIcon;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=Favicon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Favicon.d.ts","sourceRoot":"","sources":["../../../src/plugins/favicon/Favicon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,IAAI,EAAa,MAAM,cAAc,CAAC;AActE,qBAAa,OAAQ,SAAQ,UAAU;IACrC,OAAO,CAAC,UAAU,CAA0B;IAE5C,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,QAAQ,CAA4B;IAE5C,OAAO,CAAC,SAAS,CAA4B;IAE7C,OAAO,CAAC,QAAQ,CAA4B;IAE5C,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;gBAMW,IAAI,EAAE,IAAI;IAUtB,SAAS;IAaA,UAAU;IAMnB,OAAO,CAAC,gBAAgB;IAYf,OAAO;IAKP,OAAO;IAKhB,OAAO,CAAC,UAAU;IAmBlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;CAMnB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { CorePlugin, Events, $ } from '@clappr/core';
|
|
2
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
3
|
+
import playIcon from '../../../assets/icons/new/play.svg';
|
|
4
|
+
import pauseIcon from '../../../assets/icons/new/pause.svg';
|
|
5
|
+
import stopIcon from '../../../assets/icons/new/stop.svg';
|
|
6
|
+
const FAVICON_COLOR = '#567';
|
|
7
|
+
const FAVICON_SELECTOR = 'link[rel="shortcut icon"]';
|
|
8
|
+
// const oldIcon = $(FAVICON_SELECTOR);
|
|
9
|
+
export class Favicon extends CorePlugin {
|
|
10
|
+
_container = null;
|
|
11
|
+
oldIcon;
|
|
12
|
+
playIcon = null;
|
|
13
|
+
pauseIcon = null;
|
|
14
|
+
stopIcon = null;
|
|
15
|
+
get name() {
|
|
16
|
+
return 'favicon';
|
|
17
|
+
}
|
|
18
|
+
get supportedVersion() {
|
|
19
|
+
return { min: CLAPPR_VERSION };
|
|
20
|
+
}
|
|
21
|
+
// get oldIcon() {
|
|
22
|
+
// return oldIcon;
|
|
23
|
+
// }
|
|
24
|
+
constructor(core) {
|
|
25
|
+
super(core);
|
|
26
|
+
this.oldIcon = $(FAVICON_SELECTOR);
|
|
27
|
+
if (this.oldIcon.length === 0) {
|
|
28
|
+
this.stopIcon = this.createIcon(stopIcon);
|
|
29
|
+
this.changeIcon(this.stopIcon);
|
|
30
|
+
}
|
|
31
|
+
this.configure();
|
|
32
|
+
}
|
|
33
|
+
configure() {
|
|
34
|
+
if (this.core.options.changeFavicon) {
|
|
35
|
+
if (!this.enabled) {
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
this.stopListening(this.core, Events.CORE_OPTIONS_CHANGE);
|
|
38
|
+
this.enable();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (this.enabled) {
|
|
42
|
+
this.disable();
|
|
43
|
+
this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.configure);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
bindEvents() {
|
|
47
|
+
this.listenTo(this.core, Events.CORE_OPTIONS_CHANGE, this.configure);
|
|
48
|
+
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged);
|
|
49
|
+
this.core.activeContainer && this.containerChanged();
|
|
50
|
+
}
|
|
51
|
+
containerChanged() {
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
this._container && this.stopListening(this._container);
|
|
54
|
+
this._container = this.core.activeContainer;
|
|
55
|
+
this.listenTo(this._container, Events.CONTAINER_PLAY, this.setPlayIcon);
|
|
56
|
+
this.listenTo(this._container, Events.CONTAINER_PAUSE, this.setPauseIcon);
|
|
57
|
+
this.listenTo(this._container, Events.CONTAINER_STOP, this.resetIcon);
|
|
58
|
+
this.listenTo(this._container, Events.CONTAINER_ENDED, this.resetIcon);
|
|
59
|
+
this.listenTo(this._container, Events.CONTAINER_ERROR, this.resetIcon);
|
|
60
|
+
this.resetIcon();
|
|
61
|
+
}
|
|
62
|
+
disable() {
|
|
63
|
+
super.disable();
|
|
64
|
+
this.resetIcon();
|
|
65
|
+
}
|
|
66
|
+
destroy() {
|
|
67
|
+
super.destroy();
|
|
68
|
+
this.resetIcon();
|
|
69
|
+
}
|
|
70
|
+
createIcon(svg) {
|
|
71
|
+
const canvas = $('<canvas/>');
|
|
72
|
+
canvas[0].width = 24;
|
|
73
|
+
canvas[0].height = 24;
|
|
74
|
+
const ctx = canvas[0].getContext('2d');
|
|
75
|
+
ctx.fillStyle = this.core.options.faviconColor || FAVICON_COLOR;
|
|
76
|
+
const d = $(svg).find('path').attr('d');
|
|
77
|
+
const path = new Path2D(d);
|
|
78
|
+
ctx.fill(path);
|
|
79
|
+
const icon = $('<link rel="shortcut icon" type="image/png"/>');
|
|
80
|
+
icon.attr('href', canvas[0].toDataURL('image/png'));
|
|
81
|
+
return icon;
|
|
82
|
+
}
|
|
83
|
+
setPlayIcon() {
|
|
84
|
+
if (!this.playIcon) {
|
|
85
|
+
this.playIcon = this.createIcon(playIcon);
|
|
86
|
+
}
|
|
87
|
+
this.changeIcon(this.playIcon);
|
|
88
|
+
}
|
|
89
|
+
setPauseIcon() {
|
|
90
|
+
if (!this.pauseIcon) {
|
|
91
|
+
this.pauseIcon = this.createIcon(pauseIcon);
|
|
92
|
+
}
|
|
93
|
+
this.changeIcon(this.pauseIcon);
|
|
94
|
+
}
|
|
95
|
+
resetIcon() {
|
|
96
|
+
$(FAVICON_SELECTOR).remove();
|
|
97
|
+
const icon = this.oldIcon.length > 0 ? this.oldIcon : this.stopIcon;
|
|
98
|
+
this.changeIcon(icon);
|
|
99
|
+
}
|
|
100
|
+
changeIcon(icon) {
|
|
101
|
+
if (icon) {
|
|
102
|
+
$('link[rel="shortcut icon"]').remove();
|
|
103
|
+
$('head').append(icon);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Container, ContainerPlugin } from '@clappr/core';
|
|
2
|
+
export declare class GoogleAnalytics extends ContainerPlugin {
|
|
3
|
+
private account;
|
|
4
|
+
private trackerName;
|
|
5
|
+
private domainName;
|
|
6
|
+
private currentHDState;
|
|
7
|
+
get name(): string;
|
|
8
|
+
get supportedVersion(): {
|
|
9
|
+
min: string;
|
|
10
|
+
};
|
|
11
|
+
constructor(container: Container);
|
|
12
|
+
embedScript(): void;
|
|
13
|
+
addEventListeners(): void;
|
|
14
|
+
onReady(): void;
|
|
15
|
+
onPlay(): void;
|
|
16
|
+
onStop(): void;
|
|
17
|
+
onEnded(): void;
|
|
18
|
+
onBuffering(): void;
|
|
19
|
+
onBufferFull(): void;
|
|
20
|
+
onError(): void;
|
|
21
|
+
onHD(isHD: boolean): void;
|
|
22
|
+
private onPlaybackChanged;
|
|
23
|
+
onDVR(dvrInUse: boolean): void;
|
|
24
|
+
onPause(): void;
|
|
25
|
+
onSeek(): void;
|
|
26
|
+
onVolumeChanged(): void;
|
|
27
|
+
onFullscreen(): void;
|
|
28
|
+
push(array: string[]): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=GoogleAnalytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleAnalytics.d.ts","sourceRoot":"","sources":["../../../src/plugins/google-analytics/GoogleAnalytics.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAU,MAAM,cAAc,CAAC;AAQlE,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAO,CAAC,OAAO,CAAc;IAE7B,OAAO,CAAC,WAAW,CAAc;IAEjC,OAAO,CAAC,UAAU,CAAc;IAEhC,OAAO,CAAC,cAAc,CAAoB;IAE1C,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;gBAEW,SAAS,EAAE,SAAS;IAUhC,WAAW;IAcX,iBAAiB;IAuBjB,OAAO;IAIP,MAAM;IAIN,MAAM;IAIN,OAAO;IAIP,WAAW;IAIX,YAAY;IAIZ,OAAO;IAIP,IAAI,CAAC,IAAI,EAAE,OAAO;IASlB,OAAO,CAAC,iBAAiB;IAMzB,KAAK,CAAC,QAAQ,EAAE,OAAO;IAMvB,OAAO;IAIP,MAAM;IAIN,eAAe;IAIf,YAAY;IAIZ,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;CAKrB"}
|