@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,114 @@
|
|
|
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 { ContainerPlugin, Events } from '@clappr/core';
|
|
5
|
+
import { CLAPPR_VERSION } from '../build.js';
|
|
6
|
+
export class GoogleAnalytics extends ContainerPlugin {
|
|
7
|
+
account = '';
|
|
8
|
+
trackerName = '';
|
|
9
|
+
domainName = '';
|
|
10
|
+
currentHDState;
|
|
11
|
+
get name() {
|
|
12
|
+
return 'google_analytics';
|
|
13
|
+
}
|
|
14
|
+
get supportedVersion() {
|
|
15
|
+
return { min: CLAPPR_VERSION };
|
|
16
|
+
}
|
|
17
|
+
constructor(container) {
|
|
18
|
+
super(container);
|
|
19
|
+
if (this.container.options.gaAccount) {
|
|
20
|
+
this.account = this.container.options.gaAccount;
|
|
21
|
+
this.trackerName = (this.container.options.gaTrackerName) ? this.container.options.gaTrackerName + '.' : 'Player.';
|
|
22
|
+
this.domainName = this.container.options.gaDomainName;
|
|
23
|
+
this.embedScript();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
embedScript() {
|
|
27
|
+
if (!('_gat' in window)) { // TODO
|
|
28
|
+
const script = document.createElement('script');
|
|
29
|
+
script.setAttribute('type', 'text/javascript');
|
|
30
|
+
script.setAttribute('async', 'async');
|
|
31
|
+
script.setAttribute('src', '//www.google-analytics.com/ga.js');
|
|
32
|
+
script.onload = () => this.addEventListeners();
|
|
33
|
+
document.body.appendChild(script);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.addEventListeners();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
addEventListeners() {
|
|
40
|
+
if (this.container) {
|
|
41
|
+
this.listenTo(this.container, Events.CONTAINER_READY, this.onReady);
|
|
42
|
+
this.listenTo(this.container, Events.CONTAINER_PLAY, this.onPlay);
|
|
43
|
+
this.listenTo(this.container, Events.CONTAINER_STOP, this.onStop);
|
|
44
|
+
this.listenTo(this.container, Events.CONTAINER_PAUSE, this.onPause);
|
|
45
|
+
this.listenTo(this.container, Events.CONTAINER_ENDED, this.onEnded);
|
|
46
|
+
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERING, this.onBuffering);
|
|
47
|
+
this.listenTo(this.container, Events.CONTAINER_STATE_BUFFERFULL, this.onBufferFull);
|
|
48
|
+
this.listenTo(this.container, Events.CONTAINER_ERROR, this.onError);
|
|
49
|
+
this.listenTo(this.container, Events.CONTAINER_PLAYBACKSTATE, this.onPlaybackChanged);
|
|
50
|
+
this.listenTo(this.container, Events.CONTAINER_VOLUME, this.onVolumeChanged);
|
|
51
|
+
this.listenTo(this.container, Events.CONTAINER_SEEK, this.onSeek);
|
|
52
|
+
this.listenTo(this.container, Events.CONTAINER_FULLSCREEN, this.onFullscreen);
|
|
53
|
+
this.listenTo(this.container, Events.CONTAINER_HIGHDEFINITIONUPDATE, this.onHD);
|
|
54
|
+
this.listenTo(this.container, Events.CONTAINER_PLAYBACKDVRSTATECHANGED, this.onDVR);
|
|
55
|
+
}
|
|
56
|
+
_gaq.push([this.trackerName + '_setAccount', this.account]);
|
|
57
|
+
if (this.domainName) {
|
|
58
|
+
_gaq.push([this.trackerName + '_setDomainName', this.domainName]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
onReady() {
|
|
62
|
+
this.push(['Video', 'Playback', this.container.playback.name]);
|
|
63
|
+
}
|
|
64
|
+
onPlay() {
|
|
65
|
+
this.push(['Video', 'Play', this.container.playback.src]);
|
|
66
|
+
}
|
|
67
|
+
onStop() {
|
|
68
|
+
this.push(['Video', 'Stop', this.container.playback.src]);
|
|
69
|
+
}
|
|
70
|
+
onEnded() {
|
|
71
|
+
this.push(['Video', 'Ended', this.container.playback.src]);
|
|
72
|
+
}
|
|
73
|
+
onBuffering() {
|
|
74
|
+
this.push(['Video', 'Buffering', this.container.playback.src]);
|
|
75
|
+
}
|
|
76
|
+
onBufferFull() {
|
|
77
|
+
this.push(['Video', 'Bufferfull', this.container.playback.src]);
|
|
78
|
+
}
|
|
79
|
+
onError() {
|
|
80
|
+
this.push(['Video', 'Error', this.container.playback.src]);
|
|
81
|
+
}
|
|
82
|
+
onHD(isHD) {
|
|
83
|
+
const status = isHD ? 'ON' : 'OFF';
|
|
84
|
+
if (status !== this.currentHDState) {
|
|
85
|
+
this.currentHDState = status;
|
|
86
|
+
this.push(['Video', 'HD - ' + status, this.container.playback.src]);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
onPlaybackChanged(playbackState) {
|
|
90
|
+
if (playbackState.type !== null) {
|
|
91
|
+
this.push(['Video', 'Playback Type - ' + playbackState.type, this.container.playback.src]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
onDVR(dvrInUse) {
|
|
95
|
+
const status = dvrInUse ? 'ON' : 'OFF';
|
|
96
|
+
this.push(['Interaction', 'DVR - ' + status, this.container.playback.src]);
|
|
97
|
+
}
|
|
98
|
+
onPause() {
|
|
99
|
+
this.push(['Video', 'Pause', this.container.playback.src]);
|
|
100
|
+
}
|
|
101
|
+
onSeek() {
|
|
102
|
+
this.push(['Video', 'Seek', this.container.playback.src]);
|
|
103
|
+
}
|
|
104
|
+
onVolumeChanged() {
|
|
105
|
+
this.push(['Interaction', 'Volume', this.container.playback.src]);
|
|
106
|
+
}
|
|
107
|
+
onFullscreen() {
|
|
108
|
+
this.push(['Interaction', 'Fullscreen', this.container.playback.src]);
|
|
109
|
+
}
|
|
110
|
+
push(array) {
|
|
111
|
+
const res = [this.trackerName + '_trackEvent'].concat(array);
|
|
112
|
+
_gaq.push(res);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @beta
|
|
4
|
+
* A collection of plugins for the Gcore video player
|
|
5
|
+
*/
|
|
6
|
+
import '../assets/style/main.scss';
|
|
7
|
+
export * from "./audio-selector/AudioSelector.js";
|
|
8
|
+
export * from "./big-mute-button/BigMuteButton.js";
|
|
9
|
+
export * from "./bottom-gear/BottomGear.js";
|
|
10
|
+
export * from "./clappr-nerd-stats/ClapprNerdStats.js";
|
|
11
|
+
export * from "./clappr-stats/ClapprStats.js";
|
|
12
|
+
export * from "./click-to-pause/ClickToPause.js";
|
|
13
|
+
export * from "./clips/Clips.js";
|
|
14
|
+
export * from "./context-menu/ContextMenu.js";
|
|
15
|
+
export * from "./disable-controls/DisableControls.js";
|
|
16
|
+
export * from "./dvr-controls/DvrControls.js";
|
|
17
|
+
export * from "./error-screen/ErrorScreen.js";
|
|
18
|
+
export * from "./favicon/Favicon.js";
|
|
19
|
+
export * from "./google-analytics/GoogleAnalytics.js";
|
|
20
|
+
export * from "./kibo/index.js";
|
|
21
|
+
export * from "./level-selector/LevelSelector.js";
|
|
22
|
+
export * from "./logo/Logo.js";
|
|
23
|
+
export * from "./media-control/MediaControl.js";
|
|
24
|
+
export * from "./multi-camera/MultiCamera.js";
|
|
25
|
+
export * from "./picture-in-picture/PictureInPicture.js";
|
|
26
|
+
export * from "./playback-rate/PlaybackRate.js";
|
|
27
|
+
export * from "./poster/Poster.js";
|
|
28
|
+
export * from "./seek-time/SeekTime.js";
|
|
29
|
+
export * from "./share/Share.js";
|
|
30
|
+
export * from "./skip-time/SkipTime.js";
|
|
31
|
+
export * from "./spinner-three-bounce/SpinnerThreeBounce.js";
|
|
32
|
+
export * from "./statistics/Statistics.js";
|
|
33
|
+
export * from "./subtitles/Subtitles.js";
|
|
34
|
+
export * from "./thumbnails/Thumbnails.js";
|
|
35
|
+
export { setTracer } from "@gcorevideo/utils";
|
|
36
|
+
export * from "./source-controller/SourceController.js";
|
|
37
|
+
export * from "./volume-fade/VolumeFade.js";
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,2BAA2B,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AAErC,cAAc,uCAAuC,CAAC;AACtD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC7C,cAAc,yCAAyC,CAAC;AAGxD,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @beta
|
|
4
|
+
* A collection of plugins for the Gcore video player
|
|
5
|
+
*/
|
|
6
|
+
import '../assets/style/main.scss';
|
|
7
|
+
export * from "./audio-selector/AudioSelector.js";
|
|
8
|
+
export * from "./big-mute-button/BigMuteButton.js";
|
|
9
|
+
export * from "./bottom-gear/BottomGear.js";
|
|
10
|
+
export * from "./clappr-nerd-stats/ClapprNerdStats.js";
|
|
11
|
+
export * from "./clappr-stats/ClapprStats.js";
|
|
12
|
+
export * from "./click-to-pause/ClickToPause.js";
|
|
13
|
+
export * from "./clips/Clips.js";
|
|
14
|
+
export * from "./context-menu/ContextMenu.js";
|
|
15
|
+
export * from "./disable-controls/DisableControls.js";
|
|
16
|
+
export * from "./dvr-controls/DvrControls.js";
|
|
17
|
+
export * from "./error-screen/ErrorScreen.js";
|
|
18
|
+
export * from "./favicon/Favicon.js";
|
|
19
|
+
// _ ga-events
|
|
20
|
+
export * from "./google-analytics/GoogleAnalytics.js";
|
|
21
|
+
export * from "./kibo/index.js";
|
|
22
|
+
export * from "./level-selector/LevelSelector.js";
|
|
23
|
+
export * from "./logo/Logo.js";
|
|
24
|
+
export * from "./media-control/MediaControl.js";
|
|
25
|
+
export * from "./multi-camera/MultiCamera.js";
|
|
26
|
+
export * from "./picture-in-picture/PictureInPicture.js";
|
|
27
|
+
export * from "./playback-rate/PlaybackRate.js";
|
|
28
|
+
export * from "./poster/Poster.js";
|
|
29
|
+
export * from "./seek-time/SeekTime.js";
|
|
30
|
+
export * from "./share/Share.js";
|
|
31
|
+
export * from "./skip-time/SkipTime.js";
|
|
32
|
+
export * from "./spinner-three-bounce/SpinnerThreeBounce.js";
|
|
33
|
+
export * from "./statistics/Statistics.js";
|
|
34
|
+
export * from "./subtitles/Subtitles.js";
|
|
35
|
+
export * from "./thumbnails/Thumbnails.js";
|
|
36
|
+
export { setTracer } from "@gcorevideo/utils";
|
|
37
|
+
export * from "./source-controller/SourceController.js";
|
|
38
|
+
// _ vast-ads
|
|
39
|
+
// _ video360
|
|
40
|
+
export * from "./volume-fade/VolumeFade.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type KeyboardEventHandler = (e: KeyboardEvent) => boolean | undefined;
|
|
2
|
+
type UpDown = 'up' | 'down';
|
|
3
|
+
export declare class Kibo {
|
|
4
|
+
private element;
|
|
5
|
+
private lastKeyCode;
|
|
6
|
+
private lastModifiers;
|
|
7
|
+
private keysDown;
|
|
8
|
+
private keysUp;
|
|
9
|
+
private downHandler;
|
|
10
|
+
private upHandler;
|
|
11
|
+
constructor(element?: Document | Element);
|
|
12
|
+
private handler;
|
|
13
|
+
private registerKeys;
|
|
14
|
+
private unregisterKeys;
|
|
15
|
+
off(keys: string | string[]): Kibo;
|
|
16
|
+
delegate(upOrDown: UpDown, keys: string | string[], func?: KeyboardEventHandler | null): Kibo;
|
|
17
|
+
down(keys: string | string[], func?: KeyboardEventHandler | null): Kibo;
|
|
18
|
+
up(keys: string | string[], func?: KeyboardEventHandler | null): Kibo;
|
|
19
|
+
lastKey(modifier?: string): string | boolean;
|
|
20
|
+
lastModifiersAndKey(): string;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/kibo/index.ts"],"names":[],"mappings":"AAIA,KAAK,oBAAoB,GAAG,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,GAAG,SAAS,CAAC;AAOtE,KAAK,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;AAE5B,qBAAa,IAAI;IAYH,OAAO,CAAC,OAAO;IAX3B,OAAO,CAAC,WAAW,CAAM;IAEzB,OAAO,CAAC,aAAa,CAA+B;IAEpD,OAAO,CAAC,QAAQ,CAAsC;IACtD,OAAO,CAAC,MAAM,CAAsC;IAEpD,OAAO,CAAC,WAAW,CAA6B;IAEhD,OAAO,CAAC,SAAS,CAA6B;gBAE1B,OAAO,GAAE,QAAQ,GAAG,OAAyB;IAoBjE,OAAO,CAAC,OAAO;IA8Cf,OAAO,CAAC,YAAY;IA4BpB,OAAO,CAAC,cAAc;IAqBtB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAIlC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI;IAM7F,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI;IAIvE,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI;IAIrE,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO;IAQ5C,mBAAmB;CAQpB"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Kibo is released under the MIT License. Copyright (c) 2013 marquete.
|
|
3
|
+
// see https://github.com/marquete/kibo
|
|
4
|
+
export class Kibo {
|
|
5
|
+
element;
|
|
6
|
+
lastKeyCode = -1;
|
|
7
|
+
lastModifiers = {};
|
|
8
|
+
keysDown = { any: [] }; // TODO
|
|
9
|
+
keysUp = { any: [] };
|
|
10
|
+
downHandler;
|
|
11
|
+
upHandler;
|
|
12
|
+
constructor(element = window.document) {
|
|
13
|
+
this.element = element;
|
|
14
|
+
for (const mod of MODIFIERS) {
|
|
15
|
+
this.lastModifiers[mod] = false;
|
|
16
|
+
}
|
|
17
|
+
this.keysDown = { any: [] };
|
|
18
|
+
this.keysUp = { any: [] };
|
|
19
|
+
this.downHandler = this.handler('down');
|
|
20
|
+
this.upHandler = this.handler('up');
|
|
21
|
+
registerEvent(this.element, 'keydown', this.downHandler);
|
|
22
|
+
registerEvent(this.element, 'keyup', this.upHandler);
|
|
23
|
+
const unloader = () => {
|
|
24
|
+
unregisterEvent(this.element, 'keydown', this.downHandler);
|
|
25
|
+
unregisterEvent(this.element, 'keyup', this.upHandler);
|
|
26
|
+
unregisterEvent(window, 'unload', unloader);
|
|
27
|
+
};
|
|
28
|
+
registerEvent(window, 'unload', unloader);
|
|
29
|
+
}
|
|
30
|
+
handler(upOrDown = 'up') {
|
|
31
|
+
return (e) => {
|
|
32
|
+
this.lastKeyCode = e.keyCode; // TODO
|
|
33
|
+
for (const mod of MODIFIERS) {
|
|
34
|
+
this.lastModifiers[mod] = e[(mod + 'Key')];
|
|
35
|
+
}
|
|
36
|
+
// for (i = 0; i < Kibo.MODIFIERS.length; i++) {
|
|
37
|
+
// that.lastModifiers[Kibo.MODIFIERS[i]] = e[Kibo.MODIFIERS[i] + 'Key'];
|
|
38
|
+
// }
|
|
39
|
+
// if (Kibo.arrayIncludes(Kibo.MODIFIERS, Kibo.keyName(that.lastKeyCode))) {
|
|
40
|
+
// that.lastModifiers[Kibo.keyName(that.lastKeyCode)] = true;
|
|
41
|
+
// }
|
|
42
|
+
const key = keyName(this.lastKeyCode);
|
|
43
|
+
if (key && MODIFIERS.includes(key)) {
|
|
44
|
+
this.lastModifiers[key] = true;
|
|
45
|
+
}
|
|
46
|
+
const regKeys = upOrDown === 'up' ? this.keysUp : this.keysDown;
|
|
47
|
+
// this['keys' + capitalize(upOrDown)]; // TODO
|
|
48
|
+
// for (i = 0; i < registeredKeys.any.length; i++) {
|
|
49
|
+
// if ((registeredKeys.any[i](e) === false) && e.preventDefault) {
|
|
50
|
+
// e.preventDefault();
|
|
51
|
+
// }
|
|
52
|
+
// }
|
|
53
|
+
for (const h of regKeys.any) {
|
|
54
|
+
if (h(e) === false && e.preventDefault) {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const lastModifiersAndKey = this.lastModifiersAndKey();
|
|
59
|
+
if (regKeys[lastModifiersAndKey]) {
|
|
60
|
+
for (const h of regKeys[lastModifiersAndKey]) {
|
|
61
|
+
if ((h(e) === false) && e.preventDefault) {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
}
|
|
64
|
+
// for (i = 0; i < registeredKeys[lastModifiersAndKey].length; i++) {
|
|
65
|
+
// if ((registeredKeys[lastModifiersAndKey][i](e) === false) && e.preventDefault) {
|
|
66
|
+
// e.preventDefault();
|
|
67
|
+
// }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
registerKeys(upOrDown, newKeys, func) {
|
|
73
|
+
const registeredKeys = upOrDown === 'up' ? this.keysUp : this.keysDown;
|
|
74
|
+
const normKeys = typeof newKeys === "string" ? [newKeys] : newKeys;
|
|
75
|
+
// for (i = 0; i < newKeys.length; i++) {
|
|
76
|
+
// // keys = newKeys[i];
|
|
77
|
+
// keys = modifiersAndKey(keys + '');
|
|
78
|
+
// if (registeredKeys[keys]) {
|
|
79
|
+
// registeredKeys[keys].push(func);
|
|
80
|
+
// } else {
|
|
81
|
+
// registeredKeys[keys] = [func];
|
|
82
|
+
// }
|
|
83
|
+
// }
|
|
84
|
+
for (const k of normKeys) {
|
|
85
|
+
const keys = modifiersAndKey(k);
|
|
86
|
+
if (registeredKeys[keys]) {
|
|
87
|
+
registeredKeys[keys].push(func);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
registeredKeys[keys] = [func];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
unregisterKeys(upOrDown, newKeys, func = null) {
|
|
96
|
+
const registeredKeys = upOrDown === 'up' ? this.keysUp : this.keysDown;
|
|
97
|
+
const normKeys = typeof newKeys === "string" ? [newKeys] : newKeys;
|
|
98
|
+
for (const k of normKeys) {
|
|
99
|
+
const keys = modifiersAndKey(k);
|
|
100
|
+
if (func === null) {
|
|
101
|
+
delete registeredKeys[keys];
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
if (registeredKeys[keys]) {
|
|
105
|
+
const p = registeredKeys[keys].indexOf(func);
|
|
106
|
+
if (p >= 0) {
|
|
107
|
+
registeredKeys[keys].splice(p, 1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
off(keys) {
|
|
115
|
+
return this.unregisterKeys('down', keys, null);
|
|
116
|
+
}
|
|
117
|
+
delegate(upOrDown, keys, func) {
|
|
118
|
+
return (func !== null && func !== undefined)
|
|
119
|
+
? this.registerKeys(upOrDown, keys, func)
|
|
120
|
+
: this.unregisterKeys(upOrDown, keys, func);
|
|
121
|
+
}
|
|
122
|
+
down(keys, func) {
|
|
123
|
+
return this.delegate('down', keys, func);
|
|
124
|
+
}
|
|
125
|
+
up(keys, func) {
|
|
126
|
+
return this.delegate('up', keys, func);
|
|
127
|
+
}
|
|
128
|
+
lastKey(modifier) {
|
|
129
|
+
if (!modifier) {
|
|
130
|
+
return keyName(this.lastKeyCode);
|
|
131
|
+
}
|
|
132
|
+
return this.lastModifiers[modifier];
|
|
133
|
+
}
|
|
134
|
+
lastModifiersAndKey() {
|
|
135
|
+
const result = MODIFIERS.filter(m => this.lastKey(m));
|
|
136
|
+
const lastKey = keyName(this.lastKeyCode);
|
|
137
|
+
if (lastKey && !result.includes(lastKey)) {
|
|
138
|
+
result.push(lastKey);
|
|
139
|
+
}
|
|
140
|
+
return result.join(' ');
|
|
141
|
+
}
|
|
142
|
+
;
|
|
143
|
+
}
|
|
144
|
+
function registerEvent(element, eventName, func) {
|
|
145
|
+
element.addEventListener(eventName, func, false);
|
|
146
|
+
}
|
|
147
|
+
function unregisterEvent(element, eventName, func) {
|
|
148
|
+
element.removeEventListener(eventName, func, false);
|
|
149
|
+
}
|
|
150
|
+
const KEY_NAMES_BY_CODE = {
|
|
151
|
+
8: 'backspace', 9: 'tab', 13: 'enter',
|
|
152
|
+
16: 'shift', 17: 'ctrl', 18: 'alt',
|
|
153
|
+
20: 'caps_lock',
|
|
154
|
+
27: 'esc',
|
|
155
|
+
32: 'space',
|
|
156
|
+
37: 'left', 38: 'up', 39: 'right', 40: 'down',
|
|
157
|
+
48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9',
|
|
158
|
+
65: 'a', 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', 73: 'i', 74: 'j',
|
|
159
|
+
75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't',
|
|
160
|
+
85: 'u', 86: 'v', 87: 'w', 88: 'x', 89: 'y', 90: 'z', 112: 'f1', 113: 'f2', 114: 'f3',
|
|
161
|
+
115: 'f4', 116: 'f5', 117: 'f6', 118: 'f7', 119: 'f8', 120: 'f9', 121: 'f10', 122: 'f11', 123: 'f12'
|
|
162
|
+
};
|
|
163
|
+
const KEY_CODES_BY_NAME = {};
|
|
164
|
+
(function () {
|
|
165
|
+
Object.entries(KEY_NAMES_BY_CODE).forEach(([key, name]) => {
|
|
166
|
+
KEY_CODES_BY_NAME[name] = +key;
|
|
167
|
+
});
|
|
168
|
+
})();
|
|
169
|
+
const MODIFIERS = ['shift', 'ctrl', 'alt'];
|
|
170
|
+
function stringContains(string, substring) {
|
|
171
|
+
return string.indexOf(substring) !== -1;
|
|
172
|
+
}
|
|
173
|
+
function neatString(string) {
|
|
174
|
+
return string.replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ');
|
|
175
|
+
}
|
|
176
|
+
;
|
|
177
|
+
function extractModifiers(keyCombination) {
|
|
178
|
+
return MODIFIERS.filter(m => keyCombination.includes(m));
|
|
179
|
+
}
|
|
180
|
+
function extractKey(keyCombination) {
|
|
181
|
+
return neatString(keyCombination).split(' ').find(key => !MODIFIERS.includes(key));
|
|
182
|
+
}
|
|
183
|
+
;
|
|
184
|
+
function modifiersAndKey(keyCombination) {
|
|
185
|
+
var result, key;
|
|
186
|
+
if (stringContains(keyCombination, 'any')) {
|
|
187
|
+
return neatString(keyCombination).split(' ').slice(0, 2).join(' ');
|
|
188
|
+
}
|
|
189
|
+
result = extractModifiers(keyCombination);
|
|
190
|
+
key = extractKey(keyCombination);
|
|
191
|
+
if (key) {
|
|
192
|
+
result.push(key);
|
|
193
|
+
}
|
|
194
|
+
return result.join(' ');
|
|
195
|
+
}
|
|
196
|
+
function keyName(keyCode) {
|
|
197
|
+
return KEY_NAMES_BY_CODE[keyCode] || '';
|
|
198
|
+
}
|
|
199
|
+
;
|
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
import { UICorePlugin } from '@clappr/core';
|
|
2
|
-
import '../../../assets/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import '../../../assets/level-selector/style.scss';
|
|
3
|
+
/**
|
|
4
|
+
* Allows to control the quality level of the playback.
|
|
5
|
+
* @beta
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The plugin is rendered as a button in the gear menu.
|
|
9
|
+
* When clicked, it shows a list of quality levels to choose from.
|
|
10
|
+
*
|
|
11
|
+
* Configuration options:
|
|
12
|
+
*
|
|
13
|
+
* - `labels`: The labels to show in the level selector. [vertical resolution]: string
|
|
14
|
+
* - `restrictResolution`: The maximum resolution to allow in the level selector.
|
|
15
|
+
* - `title`: The title to show in the level selector.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* {
|
|
20
|
+
* levelSelector: {
|
|
21
|
+
* restrictResolution: 360,
|
|
22
|
+
* labels: { 360: '360p', 720: '720p' },
|
|
23
|
+
* },
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class LevelSelector extends UICorePlugin {
|
|
6
28
|
private levels;
|
|
7
29
|
private levelLabels;
|
|
8
30
|
private removeAuto;
|
|
31
|
+
private isHd;
|
|
32
|
+
private isOpen;
|
|
33
|
+
private buttonTemplate;
|
|
34
|
+
private listTemplate;
|
|
9
35
|
get name(): string;
|
|
10
36
|
get supportedVersion(): {
|
|
11
37
|
min: string;
|
|
12
38
|
};
|
|
39
|
+
static get version(): string;
|
|
13
40
|
get attributes(): {
|
|
14
41
|
class: string;
|
|
15
42
|
'data-level-selector': string;
|
|
@@ -22,27 +49,31 @@ export default class LevelSelector extends UICorePlugin {
|
|
|
22
49
|
'click .go-back': string;
|
|
23
50
|
};
|
|
24
51
|
bindEvents(): void;
|
|
25
|
-
unBindEvents
|
|
52
|
+
private unBindEvents;
|
|
26
53
|
private bindPlaybackEvents;
|
|
27
|
-
onStop
|
|
28
|
-
reload
|
|
29
|
-
shouldRender
|
|
54
|
+
private onStop;
|
|
55
|
+
private reload;
|
|
56
|
+
private shouldRender;
|
|
30
57
|
render(): this;
|
|
58
|
+
private renderButton;
|
|
59
|
+
private renderDropdown;
|
|
60
|
+
private get maxLevel();
|
|
31
61
|
private fillLevels;
|
|
32
|
-
|
|
62
|
+
private makeLevelsLabels;
|
|
33
63
|
private findLevelBy;
|
|
34
64
|
private onLevelSelect;
|
|
35
|
-
goBack
|
|
36
|
-
|
|
37
|
-
onShowLevelSelectMenu
|
|
38
|
-
allLevelElements
|
|
39
|
-
levelElement
|
|
40
|
-
getTitle
|
|
41
|
-
|
|
42
|
-
|
|
65
|
+
private goBack;
|
|
66
|
+
private setLevel;
|
|
67
|
+
private onShowLevelSelectMenu;
|
|
68
|
+
private allLevelElements;
|
|
69
|
+
private levelElement;
|
|
70
|
+
private getTitle;
|
|
71
|
+
private onLevelSwitchStart;
|
|
72
|
+
private onLevelSwitchEnd;
|
|
43
73
|
private updateText;
|
|
44
74
|
private getLevelLabel;
|
|
45
75
|
private updateCurrentLevel;
|
|
46
76
|
private highlightCurrentLevel;
|
|
77
|
+
private deferRender;
|
|
47
78
|
}
|
|
48
79
|
//# sourceMappingURL=LevelSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LevelSelector.d.ts","sourceRoot":"","sources":["../../../src/plugins/level-selector/LevelSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,
|
|
1
|
+
{"version":3,"file":"LevelSelector.d.ts","sourceRoot":"","sources":["../../../src/plugins/level-selector/LevelSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,cAAc,CAAA;AAY7D,OAAO,2CAA2C,CAAA;AAQlD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,WAAW,CAAe;IAElC,OAAO,CAAC,UAAU,CAAQ;IAE1B,OAAO,CAAC,IAAI,CAAQ;IAEpB,OAAO,CAAC,MAAM,CAAQ;IAEtB,OAAO,CAAC,cAAc,CAAgC;IAEtD,OAAO,CAAC,YAAY,CAAgC;IAEpD,IAAI,IAAI,WAEP;IAED,IAAI,gBAAgB;;MAEnB;IAED,MAAM,KAAK,OAAO,WAEjB;IAED,IAAa,UAAU;;;MAKtB;IAED,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,eAAe,CAAK;IAE5B,IAAa,MAAM;;;;MAMlB;IAEQ,UAAU;IAUnB,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,kBAAkB;IAsC1B,OAAO,CAAC,MAAM;IAcd,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,YAAY;IAmBX,MAAM;IAUf,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,cAAc;IAgBtB,OAAO,KAAK,QAAQ,GAQnB;IAED,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,QAAQ;IAmBhB,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,WAAW,CAAmC;CACvD"}
|