@gcorevideo/player 2.23.2 → 2.24.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/dist/core.js +1 -1
- package/dist/index.css +747 -747
- package/dist/index.js +149 -18
- package/dist/player.d.ts +6 -3
- package/lib/index.plugins.d.ts +1 -0
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +1 -0
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
- package/lib/plugins/big-mute-button/BigMuteButton.js +3 -2
- package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -1
- package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
- package/lib/plugins/bottom-gear/BottomGear.js +15 -8
- package/lib/plugins/cmcd-config/CmcdConfig.d.ts +45 -0
- package/lib/plugins/cmcd-config/CmcdConfig.d.ts.map +1 -0
- package/lib/plugins/cmcd-config/CmcdConfig.js +114 -0
- package/lib/plugins/cmcd-config/utils.d.ts +3 -0
- package/lib/plugins/cmcd-config/utils.d.ts.map +1 -0
- package/lib/plugins/cmcd-config/utils.js +12 -0
- package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -1
- package/lib/plugins/thumbnails/Thumbnails.js +3 -6
- package/lib/testUtils.d.ts +5 -1
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +6 -2
- package/package.json +1 -1
- package/src/index.plugins.ts +1 -0
- package/src/plugins/big-mute-button/BigMuteButton.ts +3 -2
- package/src/plugins/bottom-gear/BottomGear.ts +17 -14
- package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +51 -14
- package/src/plugins/cmcd-config/CmcdConfig.ts +148 -0
- package/src/plugins/cmcd-config/__tests__/CmcdConfig.test.ts +162 -0
- package/src/plugins/cmcd-config/utils.ts +13 -0
- package/src/plugins/media-control/__tests__/MediaControl.test.ts +4 -3
- package/src/plugins/thumbnails/Thumbnails.ts +3 -6
- package/src/plugins/thumbnails/__tests__/Thumbnails.test.ts +20 -3
- package/src/plugins/thumbnails/__tests__/__snapshots__/Thumbnails.test.ts.snap +1 -1
- package/src/testUtils.ts +6 -2
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -43303,7 +43303,7 @@ class Player {
|
|
|
43303
43303
|
}
|
|
43304
43304
|
}
|
|
43305
43305
|
|
|
43306
|
-
var version$1 = "2.
|
|
43306
|
+
var version$1 = "2.24.0";
|
|
43307
43307
|
|
|
43308
43308
|
var packages = {
|
|
43309
43309
|
"node_modules/@clappr/core": {
|
|
@@ -44966,7 +44966,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
44966
44966
|
*/
|
|
44967
44967
|
get events() {
|
|
44968
44968
|
return {
|
|
44969
|
-
'click .big-mute-icon': '
|
|
44969
|
+
'click .big-mute-icon': 'clicked',
|
|
44970
44970
|
'click .big-mute-icon-wrapper': 'destroyBigMuteBtn',
|
|
44971
44971
|
};
|
|
44972
44972
|
}
|
|
@@ -44980,6 +44980,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
44980
44980
|
trace(`${T$h} bindEvents`, {
|
|
44981
44981
|
mediacontrol: !!this.core.mediaControl,
|
|
44982
44982
|
});
|
|
44983
|
+
// TOOD use core.getPlugin('media_control')
|
|
44983
44984
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
44984
44985
|
}
|
|
44985
44986
|
onCoreReady() {
|
|
@@ -45073,7 +45074,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
45073
45074
|
}
|
|
45074
45075
|
this.destroy();
|
|
45075
45076
|
}
|
|
45076
|
-
|
|
45077
|
+
clicked(e) {
|
|
45077
45078
|
const localVolume = Utils.Config.restore('volume');
|
|
45078
45079
|
const volume = !isNaN(localVolume) ? localVolume : 100;
|
|
45079
45080
|
// TODO use container.setVolume() instead
|
|
@@ -45214,7 +45215,6 @@ class BottomGear extends UICorePlugin {
|
|
|
45214
45215
|
*/
|
|
45215
45216
|
bindEvents() {
|
|
45216
45217
|
this.listenToOnce(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
45217
|
-
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
45218
45218
|
}
|
|
45219
45219
|
/**
|
|
45220
45220
|
* Adds a custom option to the gear menu
|
|
@@ -45266,13 +45266,12 @@ class BottomGear extends UICorePlugin {
|
|
|
45266
45266
|
}
|
|
45267
45267
|
return $item;
|
|
45268
45268
|
}
|
|
45269
|
-
|
|
45270
|
-
trace(`${T$g} onActiveContainerChanged`);
|
|
45271
|
-
this.bindContainerEvents();
|
|
45272
|
-
}
|
|
45273
|
-
bindContainerEvents() {
|
|
45269
|
+
bindContainerEvents(container) {
|
|
45274
45270
|
trace(`${T$g} bindContainerEvents`);
|
|
45275
|
-
this.listenTo(
|
|
45271
|
+
this.listenTo(container, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
45272
|
+
this.listenTo(container, Events$1.CONTAINER_CLICK, () => {
|
|
45273
|
+
this.collapse();
|
|
45274
|
+
});
|
|
45276
45275
|
}
|
|
45277
45276
|
highDefinitionUpdate(isHd) {
|
|
45278
45277
|
trace(`${T$g} highDefinitionUpdate`, { isHd });
|
|
@@ -45307,6 +45306,9 @@ class BottomGear extends UICorePlugin {
|
|
|
45307
45306
|
* Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
|
|
45308
45307
|
*/
|
|
45309
45308
|
refresh() {
|
|
45309
|
+
this.collapseSubmenus();
|
|
45310
|
+
}
|
|
45311
|
+
collapseSubmenus() {
|
|
45310
45312
|
this.$el.find('.gear-sub-menu-wrapper').hide();
|
|
45311
45313
|
this.$el.find('#gear-options').show();
|
|
45312
45314
|
}
|
|
@@ -45325,10 +45327,12 @@ class BottomGear extends UICorePlugin {
|
|
|
45325
45327
|
trace(`${T$g} toggleMenu`, { hidden: this.collapsed });
|
|
45326
45328
|
}
|
|
45327
45329
|
collapse() {
|
|
45328
|
-
trace(`${T$g}
|
|
45330
|
+
trace(`${T$g} collapse`);
|
|
45329
45331
|
this.collapsed = true;
|
|
45330
45332
|
this.$el.find('#gear-options-wrapper').hide();
|
|
45331
45333
|
this.$el.find('#gear-button').attr('aria-expanded', 'false');
|
|
45334
|
+
// TODO hide submenus
|
|
45335
|
+
this.collapseSubmenus();
|
|
45332
45336
|
}
|
|
45333
45337
|
onCoreReady() {
|
|
45334
45338
|
trace(`${T$g} onCoreReady`);
|
|
@@ -45336,11 +45340,15 @@ class BottomGear extends UICorePlugin {
|
|
|
45336
45340
|
assert(mediaControl, 'media_control plugin is required');
|
|
45337
45341
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
|
|
45338
45342
|
this.listenTo(mediaControl, Events$1.MEDIACONTROL_HIDE, this.collapse);
|
|
45343
|
+
this.listenTo(mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, () => {
|
|
45344
|
+
this.bindContainerEvents(mediaControl.container);
|
|
45345
|
+
});
|
|
45339
45346
|
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_MENU_COLLAPSE, (from) => {
|
|
45340
45347
|
if (from !== this.name) {
|
|
45341
45348
|
this.collapse();
|
|
45342
45349
|
}
|
|
45343
45350
|
});
|
|
45351
|
+
this.bindContainerEvents(mediaControl.container);
|
|
45344
45352
|
}
|
|
45345
45353
|
onMediaControlRendered() {
|
|
45346
45354
|
trace(`${T$g} onMediaControlRendered`);
|
|
@@ -45692,6 +45700,132 @@ class ClapprStats extends ContainerPlugin {
|
|
|
45692
45700
|
}
|
|
45693
45701
|
}
|
|
45694
45702
|
|
|
45703
|
+
function generateSessionId() {
|
|
45704
|
+
return window.crypto.randomUUID();
|
|
45705
|
+
}
|
|
45706
|
+
function generateContentId(sourceUrl) {
|
|
45707
|
+
return window.crypto.subtle.digest('SHA-1', new TextEncoder().encode(sourceUrl))
|
|
45708
|
+
.then(buffer => {
|
|
45709
|
+
const hex = Array.from(new Uint8Array(buffer))
|
|
45710
|
+
.map(b => b.toString(16).padStart(2, '0'))
|
|
45711
|
+
.join('');
|
|
45712
|
+
return hex;
|
|
45713
|
+
});
|
|
45714
|
+
}
|
|
45715
|
+
|
|
45716
|
+
const CMCD_KEYS = [
|
|
45717
|
+
'br',
|
|
45718
|
+
'd',
|
|
45719
|
+
'ot',
|
|
45720
|
+
'tb',
|
|
45721
|
+
'bl',
|
|
45722
|
+
'dl',
|
|
45723
|
+
'mtp',
|
|
45724
|
+
'nor',
|
|
45725
|
+
'nrr',
|
|
45726
|
+
'su',
|
|
45727
|
+
'bs',
|
|
45728
|
+
'rtp',
|
|
45729
|
+
'cid',
|
|
45730
|
+
'pr',
|
|
45731
|
+
'sf',
|
|
45732
|
+
'sid',
|
|
45733
|
+
'st',
|
|
45734
|
+
'v',
|
|
45735
|
+
];
|
|
45736
|
+
/**
|
|
45737
|
+
* A `PLUGIN` that configures CMCD for playback
|
|
45738
|
+
* @beta
|
|
45739
|
+
* @remarks
|
|
45740
|
+
* Configuration options
|
|
45741
|
+
* `cmcd`: {@link CmcdConfigPluginSettings}
|
|
45742
|
+
*/
|
|
45743
|
+
class CmcdConfig extends CorePlugin {
|
|
45744
|
+
sid;
|
|
45745
|
+
cid = '';
|
|
45746
|
+
/**
|
|
45747
|
+
* @inheritdocs
|
|
45748
|
+
*/
|
|
45749
|
+
get name() {
|
|
45750
|
+
return 'cmcd';
|
|
45751
|
+
}
|
|
45752
|
+
constructor(core) {
|
|
45753
|
+
super(core);
|
|
45754
|
+
this.sid = this.options.cmcd?.sessionId ?? generateSessionId();
|
|
45755
|
+
}
|
|
45756
|
+
/**
|
|
45757
|
+
* @inheritdocs
|
|
45758
|
+
*/
|
|
45759
|
+
bindEvents() {
|
|
45760
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.updateSettings());
|
|
45761
|
+
}
|
|
45762
|
+
async getIds() {
|
|
45763
|
+
return {
|
|
45764
|
+
sid: this.sid,
|
|
45765
|
+
cid: await this.ensureContentId(),
|
|
45766
|
+
};
|
|
45767
|
+
}
|
|
45768
|
+
updateSettings() {
|
|
45769
|
+
switch (this.core.activeContainer.playback.name) {
|
|
45770
|
+
case 'dash':
|
|
45771
|
+
this.updateDashjsSettings();
|
|
45772
|
+
break;
|
|
45773
|
+
case 'hls':
|
|
45774
|
+
this.updateHlsjsSettings();
|
|
45775
|
+
break;
|
|
45776
|
+
}
|
|
45777
|
+
}
|
|
45778
|
+
async updateDashjsSettings() {
|
|
45779
|
+
const { cid, sid } = await this.getIds();
|
|
45780
|
+
const options = this.core.activePlayback.options;
|
|
45781
|
+
this.core.activePlayback.options = {
|
|
45782
|
+
...options,
|
|
45783
|
+
dash: {
|
|
45784
|
+
...(options.dash ?? {}),
|
|
45785
|
+
cmcd: {
|
|
45786
|
+
enabled: true,
|
|
45787
|
+
enabledKeys: CMCD_KEYS,
|
|
45788
|
+
sid,
|
|
45789
|
+
cid,
|
|
45790
|
+
},
|
|
45791
|
+
},
|
|
45792
|
+
};
|
|
45793
|
+
}
|
|
45794
|
+
async updateHlsjsSettings() {
|
|
45795
|
+
const { cid, sid } = await this.getIds();
|
|
45796
|
+
const options = this.core.activePlayback.options;
|
|
45797
|
+
this.core.activePlayback.options = {
|
|
45798
|
+
...options,
|
|
45799
|
+
playback: {
|
|
45800
|
+
hlsjsConfig: {
|
|
45801
|
+
...(options.playback?.hlsjsConfig ?? {}),
|
|
45802
|
+
cmcd: {
|
|
45803
|
+
includeKeys: CMCD_KEYS,
|
|
45804
|
+
sessionId: sid,
|
|
45805
|
+
contentId: cid,
|
|
45806
|
+
},
|
|
45807
|
+
},
|
|
45808
|
+
},
|
|
45809
|
+
};
|
|
45810
|
+
}
|
|
45811
|
+
async ensureContentId() {
|
|
45812
|
+
if (!this.cid) {
|
|
45813
|
+
this.cid = await this.evalContentId();
|
|
45814
|
+
}
|
|
45815
|
+
return this.cid;
|
|
45816
|
+
}
|
|
45817
|
+
async evalContentId() {
|
|
45818
|
+
if (!this.core.activeContainer.options.cmcd?.contentId) {
|
|
45819
|
+
return generateContentId(this.core.activePlayback.options.src);
|
|
45820
|
+
}
|
|
45821
|
+
const contentId = this.core.activeContainer.options.cmcd.contentId;
|
|
45822
|
+
if (typeof contentId === 'string') {
|
|
45823
|
+
return contentId;
|
|
45824
|
+
}
|
|
45825
|
+
return Promise.resolve(contentId(this.core.activePlayback.options.src));
|
|
45826
|
+
}
|
|
45827
|
+
}
|
|
45828
|
+
|
|
45695
45829
|
var mousetrap = {exports: {}};
|
|
45696
45830
|
|
|
45697
45831
|
/*global define:false */
|
|
@@ -52173,11 +52307,9 @@ class Thumbnails extends UICorePlugin {
|
|
|
52173
52307
|
mediaControl.$el.first().after(this.$el);
|
|
52174
52308
|
}
|
|
52175
52309
|
onMouseMoveSeekbar(_, pos) {
|
|
52176
|
-
|
|
52177
|
-
|
|
52178
|
-
|
|
52179
|
-
this.update();
|
|
52180
|
-
}
|
|
52310
|
+
this.hoverPosition = pos;
|
|
52311
|
+
this.showing = true;
|
|
52312
|
+
this.update();
|
|
52181
52313
|
}
|
|
52182
52314
|
onMouseLeave() {
|
|
52183
52315
|
this.showing = false;
|
|
@@ -52289,7 +52421,6 @@ class Thumbnails extends UICorePlugin {
|
|
|
52289
52421
|
// determine which thumbnail applies to the current time
|
|
52290
52422
|
const thumbIndex = this.getThumbIndexForTime(hoverTime);
|
|
52291
52423
|
const thumb = this.thumbs[thumbIndex];
|
|
52292
|
-
// update thumbnail
|
|
52293
52424
|
const $spotlight = this.$el.find('#thumbnails-spotlight');
|
|
52294
52425
|
this.buildThumbImage(thumb, this.spotlightHeight, $spotlight.find('.thumbnail-container')).appendTo($spotlight);
|
|
52295
52426
|
const elWidth = this.$el.width();
|
|
@@ -52468,4 +52599,4 @@ class VolumeFade extends UICorePlugin {
|
|
|
52468
52599
|
}
|
|
52469
52600
|
}
|
|
52470
52601
|
|
|
52471
|
-
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, ContextMenu, DvrControls, ErrorScreen, ExtendedEvents, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|
|
52602
|
+
export { AudioTracks as AudioSelector, AudioTracks, BigMuteButton, BottomGear, NerdStats as ClapprNerdStats, ClapprStats, ClapprStatsChronograph, ClapprStatsCounter, ClapprStatsEvents, ClickToPause, Clips, ClosedCaptions, CmcdConfig, ContextMenu, DvrControls, ErrorScreen, ExtendedEvents, Favicon, GearEvents, GoogleAnalytics, QualityLevels as LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, NerdStats, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, QualityLevels, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerThreeBounce as Spinner, SpinnerEvents, SpinnerThreeBounce, ClosedCaptions as Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
|
package/dist/player.d.ts
CHANGED
|
@@ -228,6 +228,8 @@ export declare class BigMuteButton extends UICorePlugin {
|
|
|
228
228
|
*/
|
|
229
229
|
export declare class BottomGear extends UICorePlugin {
|
|
230
230
|
private hd;
|
|
231
|
+
private numItems;
|
|
232
|
+
private collapsed;
|
|
231
233
|
/**
|
|
232
234
|
* @internal
|
|
233
235
|
*/
|
|
@@ -282,7 +284,6 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
282
284
|
* ```
|
|
283
285
|
*/
|
|
284
286
|
addItem(name: string, $subMenu?: ZeptoResult): ZeptoResult;
|
|
285
|
-
private onActiveContainerChanged;
|
|
286
287
|
private bindContainerEvents;
|
|
287
288
|
private highDefinitionUpdate;
|
|
288
289
|
/**
|
|
@@ -295,10 +296,12 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
295
296
|
* Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
|
|
296
297
|
*/
|
|
297
298
|
refresh(): void;
|
|
298
|
-
private
|
|
299
|
-
private
|
|
299
|
+
private collapseSubmenus;
|
|
300
|
+
private toggleMenu;
|
|
301
|
+
private collapse;
|
|
300
302
|
private onCoreReady;
|
|
301
303
|
private onMediaControlRendered;
|
|
304
|
+
private mount;
|
|
302
305
|
}
|
|
303
306
|
|
|
304
307
|
/**
|
package/lib/index.plugins.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { AudioTracks as AudioSelector } from "./plugins/audio-selector/AudioTrac
|
|
|
4
4
|
export * from "./plugins/big-mute-button/BigMuteButton.js";
|
|
5
5
|
export * from "./plugins/bottom-gear/BottomGear.js";
|
|
6
6
|
export * from "./plugins/clappr-stats/ClapprStats.js";
|
|
7
|
+
export * from "./plugins/cmcd-config/CmcdConfig.js";
|
|
7
8
|
export * from "./plugins/clappr-nerd-stats/NerdStats.js";
|
|
8
9
|
export { NerdStats as ClapprNerdStats } from "./plugins/clappr-nerd-stats/NerdStats.js";
|
|
9
10
|
export * from "./plugins/click-to-pause/ClickToPause.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.plugins.d.ts","sourceRoot":"","sources":["../src/index.plugins.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAEnC,cAAc,yCAAyC,CAAC;AACxD,OAAO,EAAE,WAAW,IAAI,aAAa,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C3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,0CAA0C,CAAC;AACxF,cAAc,0CAA0C,CAAC;AACzD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wBAAwB,CAAC;AACvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC3F,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sDAAsD,CAAC;AACrE,OAAO,EAAE,kBAAkB,IAAI,OAAO,EAAE,MAAM,sDAAsD,CAAC;AACrG,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACpF,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AAGnD,cAAc,qCAAqC,CAAC"}
|
package/lib/index.plugins.js
CHANGED
|
@@ -4,6 +4,7 @@ export { AudioTracks as AudioSelector } from "./plugins/audio-selector/AudioTrac
|
|
|
4
4
|
export * from "./plugins/big-mute-button/BigMuteButton.js";
|
|
5
5
|
export * from "./plugins/bottom-gear/BottomGear.js";
|
|
6
6
|
export * from "./plugins/clappr-stats/ClapprStats.js";
|
|
7
|
+
export * from "./plugins/cmcd-config/CmcdConfig.js";
|
|
7
8
|
export * from "./plugins/clappr-nerd-stats/NerdStats.js";
|
|
8
9
|
export { NerdStats as ClapprNerdStats } from "./plugins/clappr-nerd-stats/NerdStats.js";
|
|
9
10
|
export * from "./plugins/click-to-pause/ClickToPause.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BigMuteButton.d.ts","sourceRoot":"","sources":["../../../src/plugins/big-mute-button/BigMuteButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAS,MAAM,cAAc,CAAA;AAQpE,OAAO,sDAAsD,CAAA;AAM7D;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,qBAAqB,CAAQ;IAErC,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,oBAAoB,CAA2B;IAEvD,OAAO,CAAC,cAAc,CAA2B;IAEjD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;
|
|
1
|
+
{"version":3,"file":"BigMuteButton.d.ts","sourceRoot":"","sources":["../../../src/plugins/big-mute-button/BigMuteButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAS,MAAM,cAAc,CAAA;AAQpE,OAAO,sDAAsD,CAAA;AAM7D;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,qBAAqB,CAAQ;IAErC,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,oBAAoB,CAA2B;IAEvD,OAAO,CAAC,cAAc,CAA2B;IAEjD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,MAAM;;;MAKlB;IAED;;OAEG;IACM,UAAU;IAenB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,YAAY;IAmBpB;;OAEG;IACM,MAAM;IAuBf,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,OAAO;CAShB"}
|
|
@@ -34,7 +34,7 @@ export class BigMuteButton extends UICorePlugin {
|
|
|
34
34
|
*/
|
|
35
35
|
get events() {
|
|
36
36
|
return {
|
|
37
|
-
'click .big-mute-icon': '
|
|
37
|
+
'click .big-mute-icon': 'clicked',
|
|
38
38
|
'click .big-mute-icon-wrapper': 'destroyBigMuteBtn',
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -48,6 +48,7 @@ export class BigMuteButton extends UICorePlugin {
|
|
|
48
48
|
trace(`${T} bindEvents`, {
|
|
49
49
|
mediacontrol: !!this.core.mediaControl,
|
|
50
50
|
});
|
|
51
|
+
// TOOD use core.getPlugin('media_control')
|
|
51
52
|
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
52
53
|
}
|
|
53
54
|
onCoreReady() {
|
|
@@ -141,7 +142,7 @@ export class BigMuteButton extends UICorePlugin {
|
|
|
141
142
|
}
|
|
142
143
|
this.destroy();
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
+
clicked(e) {
|
|
145
146
|
const localVolume = Utils.Config.restore('volume');
|
|
146
147
|
const volume = !isNaN(localVolume) ? localVolume : 100;
|
|
147
148
|
// TODO use container.setVolume() instead
|
|
@@ -138,7 +138,6 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
140
140
|
addItem(name: string, $subMenu?: ZeptoResult): ZeptoResult;
|
|
141
|
-
private onActiveContainerChanged;
|
|
142
141
|
private bindContainerEvents;
|
|
143
142
|
private highDefinitionUpdate;
|
|
144
143
|
/**
|
|
@@ -151,6 +150,7 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
151
150
|
* Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
|
|
152
151
|
*/
|
|
153
152
|
refresh(): void;
|
|
153
|
+
private collapseSubmenus;
|
|
154
154
|
private toggleMenu;
|
|
155
155
|
private collapse;
|
|
156
156
|
private onCoreReady;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomGear.d.ts","sourceRoot":"","sources":["../../../src/plugins/bottom-gear/BottomGear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"BottomGear.d.ts","sourceRoot":"","sources":["../../../src/plugins/bottom-gear/BottomGear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAkD,MAAM,cAAc,CAAA;AAO3F,OAAO,uCAAuC,CAAA;AAC9C,OAAO,gDAAgD,CAAA;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAO5C;;;GAGG;AACH,oBAAY,UAAU;IACpB;;OAEG;IACH,QAAQ,aAAa;CACtB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,EAAE,CAAQ;IAElB,OAAO,CAAC,QAAQ,CAAK;IAErB,OAAO,CAAC,SAAS,CAAQ;IAEzB;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACH,MAAM,KAAK,OAAO,WAEjB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAEvD;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED;;OAEG;IACM,UAAU;IAInB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW;IA6B1D,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,oBAAoB;IAM5B;;OAEG;IACM,MAAM;IAsBf;;;;OAIG;IACH,OAAO;IAIP,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAyBnB,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,KAAK;CAOd"}
|
|
@@ -134,7 +134,6 @@ export class BottomGear extends UICorePlugin {
|
|
|
134
134
|
*/
|
|
135
135
|
bindEvents() {
|
|
136
136
|
this.listenToOnce(this.core, ClapprEvents.CORE_READY, this.onCoreReady);
|
|
137
|
-
this.listenTo(this.core, ClapprEvents.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
138
137
|
}
|
|
139
138
|
/**
|
|
140
139
|
* Adds a custom option to the gear menu
|
|
@@ -186,13 +185,12 @@ export class BottomGear extends UICorePlugin {
|
|
|
186
185
|
}
|
|
187
186
|
return $item;
|
|
188
187
|
}
|
|
189
|
-
|
|
190
|
-
trace(`${T} onActiveContainerChanged`);
|
|
191
|
-
this.bindContainerEvents();
|
|
192
|
-
}
|
|
193
|
-
bindContainerEvents() {
|
|
188
|
+
bindContainerEvents(container) {
|
|
194
189
|
trace(`${T} bindContainerEvents`);
|
|
195
|
-
this.listenTo(
|
|
190
|
+
this.listenTo(container, ClapprEvents.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
191
|
+
this.listenTo(container, ClapprEvents.CONTAINER_CLICK, () => {
|
|
192
|
+
this.collapse();
|
|
193
|
+
});
|
|
196
194
|
}
|
|
197
195
|
highDefinitionUpdate(isHd) {
|
|
198
196
|
trace(`${T} highDefinitionUpdate`, { isHd });
|
|
@@ -227,6 +225,9 @@ export class BottomGear extends UICorePlugin {
|
|
|
227
225
|
* Should be called by the UI plugin that added a gear item with a submenu when the latter is closed (e.g., when a "back" button is clicked).
|
|
228
226
|
*/
|
|
229
227
|
refresh() {
|
|
228
|
+
this.collapseSubmenus();
|
|
229
|
+
}
|
|
230
|
+
collapseSubmenus() {
|
|
230
231
|
this.$el.find('.gear-sub-menu-wrapper').hide();
|
|
231
232
|
this.$el.find('#gear-options').show();
|
|
232
233
|
}
|
|
@@ -245,10 +246,12 @@ export class BottomGear extends UICorePlugin {
|
|
|
245
246
|
trace(`${T} toggleMenu`, { hidden: this.collapsed });
|
|
246
247
|
}
|
|
247
248
|
collapse() {
|
|
248
|
-
trace(`${T}
|
|
249
|
+
trace(`${T} collapse`);
|
|
249
250
|
this.collapsed = true;
|
|
250
251
|
this.$el.find('#gear-options-wrapper').hide();
|
|
251
252
|
this.$el.find('#gear-button').attr('aria-expanded', 'false');
|
|
253
|
+
// TODO hide submenus
|
|
254
|
+
this.collapseSubmenus();
|
|
252
255
|
}
|
|
253
256
|
onCoreReady() {
|
|
254
257
|
trace(`${T} onCoreReady`);
|
|
@@ -256,11 +259,15 @@ export class BottomGear extends UICorePlugin {
|
|
|
256
259
|
assert(mediaControl, 'media_control plugin is required');
|
|
257
260
|
this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_RENDERED, this.onMediaControlRendered);
|
|
258
261
|
this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_HIDE, this.collapse);
|
|
262
|
+
this.listenTo(mediaControl, ClapprEvents.MEDIACONTROL_CONTAINERCHANGED, () => {
|
|
263
|
+
this.bindContainerEvents(mediaControl.container);
|
|
264
|
+
});
|
|
259
265
|
this.listenTo(mediaControl, ExtendedEvents.MEDIACONTROL_MENU_COLLAPSE, (from) => {
|
|
260
266
|
if (from !== this.name) {
|
|
261
267
|
this.collapse();
|
|
262
268
|
}
|
|
263
269
|
});
|
|
270
|
+
this.bindContainerEvents(mediaControl.container);
|
|
264
271
|
}
|
|
265
272
|
onMediaControlRendered() {
|
|
266
273
|
trace(`${T} onMediaControlRendered`);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Core, CorePlugin } from '@clappr/core';
|
|
2
|
+
/**
|
|
3
|
+
* @beta
|
|
4
|
+
*/
|
|
5
|
+
export type CmcdConfigPluginSettings = {
|
|
6
|
+
/**
|
|
7
|
+
* Session ID. If ommitted, a random UUID will be generated
|
|
8
|
+
*/
|
|
9
|
+
sessionId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Content ID, either constant or derived from current source.
|
|
12
|
+
* If ommitted, a SHA-1 hash of current source URL will be used
|
|
13
|
+
*/
|
|
14
|
+
contentId?: string | ((sourceUrl: string, mimeType?: string) => (string | Promise<string>));
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A `PLUGIN` that configures CMCD for playback
|
|
18
|
+
* @beta
|
|
19
|
+
* @remarks
|
|
20
|
+
* Configuration options
|
|
21
|
+
* `cmcd`: {@link CmcdConfigPluginSettings}
|
|
22
|
+
*/
|
|
23
|
+
export declare class CmcdConfig extends CorePlugin {
|
|
24
|
+
private sid;
|
|
25
|
+
private cid;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritdocs
|
|
28
|
+
*/
|
|
29
|
+
get name(): string;
|
|
30
|
+
constructor(core: Core);
|
|
31
|
+
/**
|
|
32
|
+
* @inheritdocs
|
|
33
|
+
*/
|
|
34
|
+
bindEvents(): void;
|
|
35
|
+
getIds(): Promise<{
|
|
36
|
+
sid: string;
|
|
37
|
+
cid: string;
|
|
38
|
+
}>;
|
|
39
|
+
private updateSettings;
|
|
40
|
+
private updateDashjsSettings;
|
|
41
|
+
private updateHlsjsSettings;
|
|
42
|
+
private ensureContentId;
|
|
43
|
+
private evalContentId;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=CmcdConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CmcdConfig.d.ts","sourceRoot":"","sources":["../../../src/plugins/cmcd-config/CmcdConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EAEX,MAAM,cAAc,CAAA;AAyBrB;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;CAC5F,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,OAAO,CAAC,GAAG,CAAQ;IAEnB,OAAO,CAAC,GAAG,CAAK;IAEhB;;OAEG;IACH,IAAI,IAAI,WAEP;gBAEW,IAAI,EAAE,IAAI;IAKtB;;OAEG;IACM,UAAU;IAMb,MAAM,IAAI,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAOrD,OAAO,CAAC,cAAc;YAWR,oBAAoB;YAiBpB,mBAAmB;YAkBnB,eAAe;YAOf,aAAa;CAU5B"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { CorePlugin, Events, } from '@clappr/core';
|
|
2
|
+
import { generateContentId, generateSessionId } from './utils';
|
|
3
|
+
const CMCD_KEYS = [
|
|
4
|
+
'br',
|
|
5
|
+
'd',
|
|
6
|
+
'ot',
|
|
7
|
+
'tb',
|
|
8
|
+
'bl',
|
|
9
|
+
'dl',
|
|
10
|
+
'mtp',
|
|
11
|
+
'nor',
|
|
12
|
+
'nrr',
|
|
13
|
+
'su',
|
|
14
|
+
'bs',
|
|
15
|
+
'rtp',
|
|
16
|
+
'cid',
|
|
17
|
+
'pr',
|
|
18
|
+
'sf',
|
|
19
|
+
'sid',
|
|
20
|
+
'st',
|
|
21
|
+
'v',
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* A `PLUGIN` that configures CMCD for playback
|
|
25
|
+
* @beta
|
|
26
|
+
* @remarks
|
|
27
|
+
* Configuration options
|
|
28
|
+
* `cmcd`: {@link CmcdConfigPluginSettings}
|
|
29
|
+
*/
|
|
30
|
+
export class CmcdConfig extends CorePlugin {
|
|
31
|
+
sid;
|
|
32
|
+
cid = '';
|
|
33
|
+
/**
|
|
34
|
+
* @inheritdocs
|
|
35
|
+
*/
|
|
36
|
+
get name() {
|
|
37
|
+
return 'cmcd';
|
|
38
|
+
}
|
|
39
|
+
constructor(core) {
|
|
40
|
+
super(core);
|
|
41
|
+
this.sid = this.options.cmcd?.sessionId ?? generateSessionId();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @inheritdocs
|
|
45
|
+
*/
|
|
46
|
+
bindEvents() {
|
|
47
|
+
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, () => this.updateSettings());
|
|
48
|
+
}
|
|
49
|
+
async getIds() {
|
|
50
|
+
return {
|
|
51
|
+
sid: this.sid,
|
|
52
|
+
cid: await this.ensureContentId(),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
updateSettings() {
|
|
56
|
+
switch (this.core.activeContainer.playback.name) {
|
|
57
|
+
case 'dash':
|
|
58
|
+
this.updateDashjsSettings();
|
|
59
|
+
break;
|
|
60
|
+
case 'hls':
|
|
61
|
+
this.updateHlsjsSettings();
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async updateDashjsSettings() {
|
|
66
|
+
const { cid, sid } = await this.getIds();
|
|
67
|
+
const options = this.core.activePlayback.options;
|
|
68
|
+
this.core.activePlayback.options = {
|
|
69
|
+
...options,
|
|
70
|
+
dash: {
|
|
71
|
+
...(options.dash ?? {}),
|
|
72
|
+
cmcd: {
|
|
73
|
+
enabled: true,
|
|
74
|
+
enabledKeys: CMCD_KEYS,
|
|
75
|
+
sid,
|
|
76
|
+
cid,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
async updateHlsjsSettings() {
|
|
82
|
+
const { cid, sid } = await this.getIds();
|
|
83
|
+
const options = this.core.activePlayback.options;
|
|
84
|
+
this.core.activePlayback.options = {
|
|
85
|
+
...options,
|
|
86
|
+
playback: {
|
|
87
|
+
hlsjsConfig: {
|
|
88
|
+
...(options.playback?.hlsjsConfig ?? {}),
|
|
89
|
+
cmcd: {
|
|
90
|
+
includeKeys: CMCD_KEYS,
|
|
91
|
+
sessionId: sid,
|
|
92
|
+
contentId: cid,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
async ensureContentId() {
|
|
99
|
+
if (!this.cid) {
|
|
100
|
+
this.cid = await this.evalContentId();
|
|
101
|
+
}
|
|
102
|
+
return this.cid;
|
|
103
|
+
}
|
|
104
|
+
async evalContentId() {
|
|
105
|
+
if (!this.core.activeContainer.options.cmcd?.contentId) {
|
|
106
|
+
return generateContentId(this.core.activePlayback.options.src);
|
|
107
|
+
}
|
|
108
|
+
const contentId = this.core.activeContainer.options.cmcd.contentId;
|
|
109
|
+
if (typeof contentId === 'string') {
|
|
110
|
+
return contentId;
|
|
111
|
+
}
|
|
112
|
+
return Promise.resolve(contentId(this.core.activePlayback.options.src));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/cmcd-config/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQpE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function generateSessionId() {
|
|
2
|
+
return window.crypto.randomUUID();
|
|
3
|
+
}
|
|
4
|
+
export function generateContentId(sourceUrl) {
|
|
5
|
+
return window.crypto.subtle.digest('SHA-1', new TextEncoder().encode(sourceUrl))
|
|
6
|
+
.then(buffer => {
|
|
7
|
+
const hex = Array.from(new Uint8Array(buffer))
|
|
8
|
+
.map(b => b.toString(16).padStart(2, '0'))
|
|
9
|
+
.join('');
|
|
10
|
+
return hex;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thumbnails.d.ts","sourceRoot":"","sources":["../../../src/plugins/thumbnails/Thumbnails.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAKZ,IAAI,EACL,MAAM,cAAc,CAAA;AAUrB,OAAO,uCAAuC,CAAA;AAM9C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,qBAAqB,CAAoB;IAEjD,OAAO,CAAC,iBAAiB,CAAY;IAErC,OAAO,CAAC,gBAAgB,CAAY;IAEpC,OAAO,CAAC,aAAa,CAAI;IAEzB,OAAO,CAAC,OAAO,CAAQ;IAEvB,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,eAAe,CAAI;IAE3B,OAAO,CAAC,cAAc,CA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