@gcorevideo/player 2.22.15 → 2.22.16
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/clips/clips.ejs +1 -0
- package/assets/clips/clips.scss +23 -3
- package/assets/level-selector/list.ejs +9 -3
- package/assets/media-control/media-control.ejs +1 -9
- package/assets/media-control/media-control.scss +0 -25
- package/assets/media-control/width370.scss +4 -4
- package/dist/core.js +1 -1
- package/dist/index.css +602 -602
- package/dist/index.js +252 -229
- package/dist/player.d.ts +211 -144
- package/dist/plugins/index.css +1198 -1198
- package/dist/plugins/index.js +185 -167
- package/docs/api/{player.audioselector.md → player.audiotracks.md} +3 -3
- package/docs/api/player.contextmenu.md +2 -0
- package/docs/api/player.contextmenupluginsettings.md +2 -40
- package/docs/api/{player.contextmenupluginsettings.label.md → player.contextmenupluginsettings.options.md} +3 -3
- package/docs/api/player.md +78 -23
- package/docs/api/player.mediacontrol.md +8 -14
- package/docs/api/player.mediacontrolelement.md +4 -2
- package/docs/api/{player.contextmenupluginsettings.preventshowcontextmenu.md → player.mediacontrollayerelement.md} +5 -3
- package/docs/api/player.mediacontrolleftelement.md +16 -0
- package/docs/api/player.mediacontrolrightelement.md +16 -0
- package/docs/api/player.mediacontrolsettings.md +23 -0
- package/docs/api/{player.contextmenupluginsettings.url.md → player.menuoption.md} +10 -3
- package/docs/api/player.playbackrate.md +1 -1
- package/docs/api/player.playerconfig.md +1 -1
- package/docs/api/player.playerconfig.playbacktype.md +1 -1
- package/docs/api/{player.levelselector.events.md → player.qualitylevels.events.md} +2 -2
- package/docs/api/{player.levelselector.md → player.qualitylevels.md} +6 -6
- package/docs/api/{player.levelselectorpluginsettings.labels.md → player.qualitylevelspluginsettings.labels.md} +2 -2
- package/docs/api/{player.levelselectorpluginsettings.md → player.qualitylevelspluginsettings.md} +6 -6
- package/docs/api/{player.levelselectorpluginsettings.restrictresolution.md → player.qualitylevelspluginsettings.restrictresolution.md} +2 -2
- package/lib/plugins/clips/Clips.d.ts +21 -16
- package/lib/plugins/clips/Clips.d.ts.map +1 -1
- package/lib/plugins/clips/Clips.js +96 -98
- package/lib/plugins/clips/types.d.ts +19 -0
- package/lib/plugins/clips/types.d.ts.map +1 -0
- package/lib/plugins/clips/types.js +1 -0
- package/lib/plugins/clips/utils.d.ts +4 -0
- package/lib/plugins/clips/utils.d.ts.map +1 -0
- package/lib/plugins/clips/utils.js +36 -0
- package/lib/plugins/media-control/MediaControl.d.ts +4 -7
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +19 -31
- package/lib/plugins/utils.d.ts +9 -1
- package/lib/plugins/utils.d.ts.map +1 -1
- package/lib/plugins/utils.js +9 -10
- package/lib/plugins/vast-ads/loaderxml.js +2 -2
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +2 -5
- package/package.json +1 -1
- package/src/plugins/clips/Clips.ts +116 -135
- package/src/plugins/clips/__tests__/Clips.test.ts +72 -0
- package/src/plugins/clips/__tests__/__snapshots__/Clips.test.ts.snap +14 -0
- package/src/plugins/clips/types.ts +22 -0
- package/src/plugins/clips/utils.ts +54 -0
- package/src/plugins/level-selector/__tests__/__snapshots__/QualityLevels.test.ts.snap +18 -18
- package/src/plugins/media-control/MediaControl.ts +31 -58
- package/src/plugins/media-control/__tests__/__snapshots__/MediaControl.test.ts.snap +7 -35
- package/src/plugins/utils.ts +9 -7
- package/src/plugins/vast-ads/loaderxml.ts +2 -2
- package/src/testUtils.ts +2 -5
- package/temp/player.api.json +332 -262
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.mediacontrol.handlecustomarea.md +0 -52
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,
|
|
1
|
+
{"version":3,"file":"Clips.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/Clips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAe,MAAM,cAAc,CAAA;AAM3E,OAAO,kCAAkC,CAAA;AAOzC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAKD;;;;;;;;;;;GAWG;AACH,qBAAa,KAAM,SAAQ,YAAY;IACrC,OAAO,CAAC,QAAQ,CAAgC;IAEhD,OAAO,CAAC,KAAK,CAAiB;IAE9B,OAAO,CAAC,YAAY,CAAuB;IAE3C,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAEtD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAa,UAAU;;MAItB;IAED,IAAI,OAAO,WAEV;IAED,IAAI,gBAAgB;;MAEnB;IAED;;OAEG;IACM,UAAU;IAUV,MAAM;IAUN,OAAO;IAQP,OAAO;IAQP,MAAM;IAKf,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,kBAAkB;IAsB1B,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,WAAW;CAOpB"}
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
import { Events, UICorePlugin,
|
|
2
|
-
import {
|
|
3
|
-
import '../../../assets/clips/clips.scss';
|
|
1
|
+
import { Events, UICorePlugin, $, template } from '@clappr/core';
|
|
2
|
+
import { trace } from '@gcorevideo/utils';
|
|
4
3
|
import assert from 'assert';
|
|
4
|
+
import '../../../assets/clips/clips.scss';
|
|
5
|
+
import { buildSvg, parseClips } from './utils.js';
|
|
6
|
+
import clipsHTML from '../../../assets/clips/clips.ejs';
|
|
7
|
+
const T = 'plugins.clips';
|
|
8
|
+
const VERSION = '2.22.16';
|
|
9
|
+
const CLAPPR_VERSION = '0.11.4';
|
|
5
10
|
/**
|
|
6
|
-
* `PLUGIN` that
|
|
11
|
+
* `PLUGIN` that allows marking up the timeline of the video
|
|
7
12
|
* @beta
|
|
8
13
|
* @remarks
|
|
14
|
+
* The plugin decorates the seekbar with notches to indicate the clips of the video and displays current clip text in the left panel
|
|
15
|
+
*
|
|
9
16
|
* Depends on:
|
|
10
17
|
*
|
|
11
18
|
* - {@link MediaControl}
|
|
12
19
|
*
|
|
13
20
|
* Configuration options - {@link ClipsPluginSettings}
|
|
14
21
|
*/
|
|
15
|
-
export class
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_oldContainer;
|
|
22
|
+
export class Clips extends UICorePlugin {
|
|
23
|
+
barStyle = null;
|
|
24
|
+
clips = [];
|
|
25
|
+
oldContainer;
|
|
20
26
|
svgMask = null;
|
|
27
|
+
static template = template(clipsHTML);
|
|
21
28
|
/**
|
|
22
29
|
* @internal
|
|
23
30
|
*/
|
|
@@ -29,130 +36,121 @@ export class ClipsPlugin extends UICorePlugin {
|
|
|
29
36
|
*/
|
|
30
37
|
get attributes() {
|
|
31
38
|
return {
|
|
32
|
-
class:
|
|
39
|
+
class: 'media-control-clips',
|
|
33
40
|
};
|
|
34
41
|
}
|
|
42
|
+
get version() {
|
|
43
|
+
return VERSION;
|
|
44
|
+
}
|
|
45
|
+
get supportedVersion() {
|
|
46
|
+
return { min: CLAPPR_VERSION };
|
|
47
|
+
}
|
|
35
48
|
/**
|
|
36
49
|
* @internal
|
|
37
50
|
*/
|
|
38
51
|
bindEvents() {
|
|
39
|
-
|
|
40
|
-
assert(mediaControl, 'media_control plugin is required');
|
|
41
|
-
this.listenToOnce(this.core, Events.CORE_READY, this._onCoreReady);
|
|
42
|
-
// TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
|
|
43
|
-
this.listenTo(mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
|
|
52
|
+
this.listenToOnce(this.core, Events.CORE_READY, this.onCoreReady);
|
|
44
53
|
this.listenTo(this.core, Events.CORE_RESIZE, this.playerResize);
|
|
54
|
+
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.onContainerChanged);
|
|
45
55
|
}
|
|
46
|
-
|
|
56
|
+
render() {
|
|
57
|
+
trace(`${T} render`);
|
|
47
58
|
if (!this.options.clips) {
|
|
48
|
-
this
|
|
49
|
-
return;
|
|
59
|
+
return this;
|
|
50
60
|
}
|
|
51
|
-
this.
|
|
61
|
+
this.$el.html(Clips.template());
|
|
62
|
+
this.$el.hide();
|
|
63
|
+
return this;
|
|
52
64
|
}
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.durationGetting = false;
|
|
58
|
-
if (this.durationGetting) {
|
|
59
|
-
this.makeSvg(this.duration);
|
|
65
|
+
destroy() {
|
|
66
|
+
if (this.barStyle) {
|
|
67
|
+
this.barStyle.remove();
|
|
68
|
+
this.barStyle = null;
|
|
60
69
|
}
|
|
70
|
+
return super.destroy();
|
|
61
71
|
}
|
|
62
|
-
|
|
63
|
-
if (this.
|
|
64
|
-
this.
|
|
72
|
+
disable() {
|
|
73
|
+
if (this.barStyle) {
|
|
74
|
+
this.barStyle.remove();
|
|
75
|
+
this.barStyle = null;
|
|
65
76
|
}
|
|
77
|
+
return super.disable();
|
|
78
|
+
}
|
|
79
|
+
enable() {
|
|
80
|
+
this.render();
|
|
81
|
+
return super.enable();
|
|
82
|
+
}
|
|
83
|
+
onCoreReady() {
|
|
84
|
+
trace(`${T} onCoreReady`);
|
|
85
|
+
const mediaControl = this.core.getPlugin('media_control');
|
|
86
|
+
assert(mediaControl, 'media_control plugin is required');
|
|
87
|
+
this.parseClips(this.options.clips.text);
|
|
88
|
+
this.listenTo(mediaControl, Events.MEDIACONTROL_RENDERED, this.onMcRender);
|
|
89
|
+
}
|
|
90
|
+
onMcRender() {
|
|
91
|
+
trace(`${T} onMcRender`);
|
|
66
92
|
const mediaControl = this.core.getPlugin('media_control');
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
93
|
+
mediaControl.mount('clips', this.$el);
|
|
94
|
+
}
|
|
95
|
+
onContainerChanged() {
|
|
96
|
+
trace(`${T} onContainerChanged`);
|
|
97
|
+
// TODO figure out the conditions of changing the container (without destroying the previous one)
|
|
98
|
+
if (this.oldContainer) {
|
|
99
|
+
this.stopListening(this.oldContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
100
|
+
}
|
|
101
|
+
this.oldContainer = this.core.activeContainer;
|
|
102
|
+
if (this.svgMask) {
|
|
103
|
+
this.svgMask.remove();
|
|
104
|
+
this.svgMask = null;
|
|
105
|
+
}
|
|
106
|
+
this.listenTo(this.core.activeContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
|
|
107
|
+
}
|
|
108
|
+
playerResize() {
|
|
109
|
+
const duration = this.core.activeContainer.getDuration();
|
|
110
|
+
if (duration) {
|
|
111
|
+
this.makeSvg(duration);
|
|
112
|
+
}
|
|
70
113
|
}
|
|
71
114
|
onTimeUpdate(event) {
|
|
72
|
-
if (!this.
|
|
73
|
-
this.duration = event.total;
|
|
115
|
+
if (!this.svgMask) {
|
|
74
116
|
this.makeSvg(event.total);
|
|
75
|
-
this.durationGetting = true;
|
|
76
117
|
}
|
|
77
|
-
for (const value of this.clips
|
|
78
|
-
if (event.current >= value.start &&
|
|
118
|
+
for (const value of this.clips) {
|
|
119
|
+
if ((event.current >= value.start && !value.end) ||
|
|
120
|
+
event.current < value.end) {
|
|
79
121
|
this.setClipText(value.text);
|
|
80
122
|
break;
|
|
81
123
|
}
|
|
82
124
|
}
|
|
83
125
|
}
|
|
84
|
-
parseClips() {
|
|
85
|
-
|
|
86
|
-
const clipsArr = textArr
|
|
87
|
-
.map((val) => {
|
|
88
|
-
const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
|
|
89
|
-
return matchRes
|
|
90
|
-
? {
|
|
91
|
-
start: strtimeToMiliseconds(matchRes[1]),
|
|
92
|
-
text: matchRes[2],
|
|
93
|
-
}
|
|
94
|
-
: null;
|
|
95
|
-
})
|
|
96
|
-
.filter((clip) => clip !== null);
|
|
97
|
-
clipsArr.sort((a, b) => a.start - b.start);
|
|
98
|
-
clipsArr.forEach((clip, index) => {
|
|
99
|
-
this.clips.set(clip.start, {
|
|
100
|
-
index,
|
|
101
|
-
start: clip.start,
|
|
102
|
-
text: clip.text,
|
|
103
|
-
end: clipsArr[index + 1] ? clipsArr[index + 1].start : null,
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Returns the text of the current clip.
|
|
109
|
-
* @param time - The current time of the player.
|
|
110
|
-
* @returns The text of the current clip.
|
|
111
|
-
*/
|
|
112
|
-
getText(time) {
|
|
113
|
-
for (const [key, value] of this.clips.entries()) {
|
|
114
|
-
if (time >= value.start && time < value.end) {
|
|
115
|
-
return value.text;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return '';
|
|
126
|
+
parseClips(text) {
|
|
127
|
+
this.clips = parseClips(text);
|
|
119
128
|
}
|
|
120
129
|
makeSvg(duration) {
|
|
121
|
-
|
|
122
|
-
const widthOfSeek = this.core.activeContainer.$el.width();
|
|
123
|
-
let finishValue = 0;
|
|
124
|
-
this.clips.forEach((val) => {
|
|
125
|
-
let end = val.end;
|
|
126
|
-
if (!end) {
|
|
127
|
-
end = val.end = duration;
|
|
128
|
-
}
|
|
129
|
-
const widthChunk = ((end - val.start) * widthOfSeek) / duration;
|
|
130
|
-
svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
|
|
131
|
-
finishValue += widthChunk;
|
|
132
|
-
});
|
|
133
|
-
svg += `<rect x="${finishValue}" y="0" width="${widthOfSeek - finishValue}" height="30"/>\n`;
|
|
134
|
-
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
130
|
+
const svg = buildSvg(this.clips, duration, this.core.activeContainer.$el.width());
|
|
135
131
|
this.setSVGMask(svg);
|
|
136
132
|
}
|
|
137
133
|
setSVGMask(svg) {
|
|
138
|
-
// this.core.mediaControl.setSVGMask(svg);
|
|
139
134
|
if (this.svgMask) {
|
|
140
135
|
this.svgMask.remove();
|
|
141
136
|
}
|
|
142
|
-
const mediaControl = this.core.getPlugin('media_control');
|
|
143
|
-
const $seekBarContainer = mediaControl.getElement('seekBarContainer');
|
|
144
|
-
if ($seekBarContainer?.get(0)) {
|
|
145
|
-
$seekBarContainer.addClass('clips');
|
|
146
|
-
}
|
|
147
137
|
this.svgMask = $(svg);
|
|
148
|
-
|
|
138
|
+
this.$el.append(this.svgMask);
|
|
139
|
+
if (!this.barStyle) {
|
|
140
|
+
this.barStyle = document.createElement('style');
|
|
141
|
+
this.barStyle.textContent = `
|
|
142
|
+
.bar-container[data-seekbar] {
|
|
143
|
+
clip-path: url("#myClip");
|
|
144
|
+
}`;
|
|
145
|
+
this.$el.append(this.barStyle);
|
|
146
|
+
}
|
|
149
147
|
}
|
|
150
148
|
setClipText(text) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
if (text) {
|
|
150
|
+
this.$el.show().find('#clips-text').text(text);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.$el.hide();
|
|
156
154
|
}
|
|
157
155
|
}
|
|
158
156
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clip description.
|
|
3
|
+
* @beta
|
|
4
|
+
*/
|
|
5
|
+
export type ClipDesc = {
|
|
6
|
+
/**
|
|
7
|
+
* Start time of the clip in the video timeline, s.
|
|
8
|
+
*/
|
|
9
|
+
start: number;
|
|
10
|
+
/**
|
|
11
|
+
* Text to display over the seekbar.
|
|
12
|
+
*/
|
|
13
|
+
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* End time of the clip (start time of the next clip).
|
|
16
|
+
*/
|
|
17
|
+
end: number;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CAKZ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/clips/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAQrC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAmBnD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAwBtF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { parseClipTime } from '../utils.js';
|
|
2
|
+
export function parseClips(text) {
|
|
3
|
+
const clipsArr = text
|
|
4
|
+
.split('\n')
|
|
5
|
+
.map((val) => {
|
|
6
|
+
const matchRes = val.match(/(((\d+:)?\d+:)?\d+) (.+)/i);
|
|
7
|
+
return matchRes
|
|
8
|
+
? {
|
|
9
|
+
start: parseClipTime(matchRes[1]),
|
|
10
|
+
text: matchRes[4],
|
|
11
|
+
}
|
|
12
|
+
: null;
|
|
13
|
+
})
|
|
14
|
+
.filter((clip) => clip !== null)
|
|
15
|
+
.sort((a, b) => a.start - b.start);
|
|
16
|
+
return clipsArr.map((clip, index) => ({
|
|
17
|
+
start: clip.start,
|
|
18
|
+
text: clip.text,
|
|
19
|
+
end: index < clipsArr.length - 1 ? clipsArr[index + 1].start : 0,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
export function buildSvg(clips, duration, barWidth) {
|
|
23
|
+
let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
|
|
24
|
+
let rightEdge = 0;
|
|
25
|
+
clips.forEach((val) => {
|
|
26
|
+
const end = val.end || duration;
|
|
27
|
+
const chunkWidth = Math.round(((end - val.start) * barWidth) / duration);
|
|
28
|
+
svg += `<rect x="${rightEdge}" y="0" width="${chunkWidth - 2}" height="30"/>\n`;
|
|
29
|
+
rightEdge += chunkWidth;
|
|
30
|
+
});
|
|
31
|
+
if (rightEdge < barWidth) {
|
|
32
|
+
svg += `<rect x="${rightEdge}" y="0" width="${barWidth - rightEdge}" height="30"/>\n`;
|
|
33
|
+
}
|
|
34
|
+
svg += '</clipPath>' + '</defs>' + '</svg>';
|
|
35
|
+
return svg;
|
|
36
|
+
}
|
|
@@ -5,7 +5,7 @@ import '../../../assets/media-control/media-control.scss';
|
|
|
5
5
|
* Media control elements that appear in the left area.
|
|
6
6
|
* @beta
|
|
7
7
|
*/
|
|
8
|
-
export type MediaControlLeftElement = 'clipText' | 'duration' | 'dvr' | 'playpause' | 'playstop' | 'position' | 'volume';
|
|
8
|
+
export type MediaControlLeftElement = 'clipText' | 'duration' | 'dvr' | 'playpause' | 'playstop' | 'position' | 'volume' | 'clips';
|
|
9
9
|
/**
|
|
10
10
|
* Media control elements that appear in main layer, spanning the entire width of the player.
|
|
11
11
|
* @beta
|
|
@@ -74,8 +74,6 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
74
74
|
private userDisabled;
|
|
75
75
|
private userKeepVisible;
|
|
76
76
|
private verticalVolume;
|
|
77
|
-
private $clipText;
|
|
78
|
-
private $clipTextContainer;
|
|
79
77
|
private $duration;
|
|
80
78
|
private $fullscreenToggle;
|
|
81
79
|
private $multiCameraSelector;
|
|
@@ -241,15 +239,14 @@ export declare class MediaControl extends UICorePlugin {
|
|
|
241
239
|
* ```ts
|
|
242
240
|
* class MyPlugin extends UICorePlugin {
|
|
243
241
|
* override render() {
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* clipText?.el.text('Here we go')
|
|
242
|
+
* this.$el.html('<div data-clips>Here we go</div>')
|
|
243
|
+
* this.core.getPlugin('media_control').mount('clips', this.$el)
|
|
247
244
|
* return this
|
|
248
245
|
* }
|
|
249
246
|
* }
|
|
250
247
|
* ```
|
|
251
248
|
*/
|
|
252
|
-
|
|
249
|
+
mount(name: MediaControlElement, element: ZeptoResult): void;
|
|
253
250
|
putElement(name: MediaControlElement, element: ZeptoResult): void;
|
|
254
251
|
/**
|
|
255
252
|
* Toggle the visibility of a media control element
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaControl.d.ts","sourceRoot":"","sources":["../../../src/plugins/media-control/MediaControl.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,YAAY,EAMZ,IAAI,EACL,MAAM,cAAc,CAAA;AASrB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAI5C,OAAO,kDAAkD,CAAA;AAWzD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,UAAU,GACV,KAAK,GACL,WAAW,GACX,UAAU,GACV,UAAU,GACV,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"MediaControl.d.ts","sourceRoot":"","sources":["../../../src/plugins/media-control/MediaControl.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,YAAY,EAMZ,IAAI,EACL,MAAM,cAAc,CAAA;AASrB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAI5C,OAAO,kDAAkD,CAAA;AAWzD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,UAAU,GACV,KAAK,GACL,WAAW,GACX,UAAU,GACV,UAA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A8DtB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,oBAAoB;IAgC5B;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,WAAW;IAmBrD,UAAU,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,WAAW;IAI1D;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO;IAItD,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,WAAW;IAiCnB,OAAO,CAAC,gBAAgB;IAMxB;;OAEG;IACM,OAAO;IAUhB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,SAAS;IAIjB;;OAEG;IACM,MAAM;IA4Ef,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB,OAAO,CAAC,MAAM,CAAC,QAAQ;IAcvB;;OAEG;IACH,mBAAmB;IAMnB;;OAEG;IACH,qBAAqB;IAOrB,OAAO,CAAC,6BAA6B;IAQrC,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,iBAAiB;CAO1B"}
|
|
@@ -22,9 +22,7 @@ import fullscreenOffIcon from '../../../assets/icons/new/fullscreen-off.svg';
|
|
|
22
22
|
import fullscreenOnIcon from '../../../assets/icons/new/fullscreen-on.svg';
|
|
23
23
|
const DEFAULT_SETTINGS = {
|
|
24
24
|
default: [],
|
|
25
|
-
left: [
|
|
26
|
-
'dvr'
|
|
27
|
-
],
|
|
25
|
+
left: ['dvr'],
|
|
28
26
|
right: [
|
|
29
27
|
'audiotracks',
|
|
30
28
|
'cc',
|
|
@@ -103,8 +101,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
103
101
|
userDisabled = false;
|
|
104
102
|
userKeepVisible = false;
|
|
105
103
|
verticalVolume = false;
|
|
106
|
-
$clipText = null;
|
|
107
|
-
$clipTextContainer = null;
|
|
108
104
|
$duration = null;
|
|
109
105
|
$fullscreenToggle = null;
|
|
110
106
|
$multiCameraSelector = null;
|
|
@@ -296,7 +292,7 @@ export class MediaControl extends UICorePlugin {
|
|
|
296
292
|
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
297
293
|
this.hide();
|
|
298
294
|
this.unbindKeyEvents();
|
|
299
|
-
this.$el.hide();
|
|
295
|
+
this.$el.hide(); // TODO why?
|
|
300
296
|
}
|
|
301
297
|
/**
|
|
302
298
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
@@ -755,16 +751,16 @@ export class MediaControl extends UICorePlugin {
|
|
|
755
751
|
right: [],
|
|
756
752
|
}, this.core.activeContainer.settings);
|
|
757
753
|
trace(`${T} updateSettings`, { newSettings });
|
|
754
|
+
newSettings.left.push('clips'); // TODO
|
|
758
755
|
// TODO make order controlled via CSS
|
|
759
|
-
newSettings.left = orderByOrderPattern([...newSettings.left, '
|
|
756
|
+
newSettings.left = orderByOrderPattern([...newSettings.left, 'volume', 'clips'], LEFT_ORDER);
|
|
760
757
|
if (this.core.activePlayback.getPlaybackType() === Playback.LIVE &&
|
|
761
758
|
this.core.activePlayback.dvrEnabled) {
|
|
762
759
|
newSettings.left.push('dvr');
|
|
763
760
|
}
|
|
764
761
|
// actual order of the items appear rendered is controlled by CSS
|
|
765
762
|
newSettings.right = DEFAULT_SETTINGS.right; // TODO get from the options
|
|
766
|
-
if ((!this.fullScreenOnVideoTagSupported &&
|
|
767
|
-
!fullscreenEnabled()) ||
|
|
763
|
+
if ((!this.fullScreenOnVideoTagSupported && !fullscreenEnabled()) ||
|
|
768
764
|
this.options.fullscreenDisable) {
|
|
769
765
|
trace(`${T} updateSettings removing fullscreen`, {
|
|
770
766
|
supported: this.fullScreenOnVideoTagSupported,
|
|
@@ -811,8 +807,6 @@ export class MediaControl extends UICorePlugin {
|
|
|
811
807
|
this.$volumeBarFill = this.$el.find('.bar-fill-1[data-volume]');
|
|
812
808
|
this.$volumeBarScrubber = this.$el.find('.bar-scrubber[data-volume]');
|
|
813
809
|
this.$multiCameraSelector = this.$el.find('.media-control-multicamera[data-multicamera]');
|
|
814
|
-
this.$clipText = this.$el.find('.media-clip-text[data-clipstext]'); // TODO
|
|
815
|
-
this.$clipTextContainer = this.$el.find('.media-clip-container[data-clipstext]');
|
|
816
810
|
this.resetIndicators();
|
|
817
811
|
this.initializeIcons();
|
|
818
812
|
}
|
|
@@ -827,25 +821,14 @@ export class MediaControl extends UICorePlugin {
|
|
|
827
821
|
* ```ts
|
|
828
822
|
* class MyPlugin extends UICorePlugin {
|
|
829
823
|
* override render() {
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
* clipText?.el.text('Here we go')
|
|
824
|
+
* this.$el.html('<div data-clips>Here we go</div>')
|
|
825
|
+
* this.core.getPlugin('media_control').mount('clips', this.$el)
|
|
833
826
|
* return this
|
|
834
827
|
* }
|
|
835
828
|
* }
|
|
836
829
|
* ```
|
|
837
830
|
*/
|
|
838
|
-
|
|
839
|
-
switch (name) {
|
|
840
|
-
case 'audiotracks':
|
|
841
|
-
return null;
|
|
842
|
-
case 'clipText':
|
|
843
|
-
return this.$clipText;
|
|
844
|
-
case 'seekBarContainer':
|
|
845
|
-
return this.$seekBarContainer;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
putElement(name, element) {
|
|
831
|
+
mount(name, element) {
|
|
849
832
|
const panel = this.getElementLocation(name);
|
|
850
833
|
trace(`${T} putElement`, { name, panel: !!panel });
|
|
851
834
|
if (panel) {
|
|
@@ -864,6 +847,9 @@ export class MediaControl extends UICorePlugin {
|
|
|
864
847
|
return;
|
|
865
848
|
}
|
|
866
849
|
}
|
|
850
|
+
putElement(name, element) {
|
|
851
|
+
this.mount(name, element);
|
|
852
|
+
}
|
|
867
853
|
/**
|
|
868
854
|
* Toggle the visibility of a media control element
|
|
869
855
|
* @param name - The name of the media control element
|
|
@@ -913,11 +899,11 @@ export class MediaControl extends UICorePlugin {
|
|
|
913
899
|
if (!this.settings.seekEnabled) {
|
|
914
900
|
return;
|
|
915
901
|
}
|
|
916
|
-
const currentTime = this.
|
|
917
|
-
const duration = this.
|
|
902
|
+
const currentTime = this.core.activeContainer.getCurrentTime();
|
|
903
|
+
const duration = this.core.activeContainer.getDuration();
|
|
918
904
|
let position = Math.min(Math.max(currentTime + delta, 0), duration);
|
|
919
905
|
position = Math.min((position * 100) / duration, 100);
|
|
920
|
-
this.
|
|
906
|
+
this.core.activeContainer.seekPercentage(position);
|
|
921
907
|
}
|
|
922
908
|
bindKeyAndShow(key, callback) {
|
|
923
909
|
// TODO or boolean return type
|
|
@@ -1035,7 +1021,10 @@ export class MediaControl extends UICorePlugin {
|
|
|
1035
1021
|
* @internal
|
|
1036
1022
|
*/
|
|
1037
1023
|
render() {
|
|
1038
|
-
trace(`${T} render`, {
|
|
1024
|
+
trace(`${T} render`, {
|
|
1025
|
+
needsUpdate: this.hasUpdate,
|
|
1026
|
+
metadataLoaded: this.metadataLoaded,
|
|
1027
|
+
});
|
|
1039
1028
|
if (!this.hasUpdate || !this.metadataLoaded) {
|
|
1040
1029
|
return this;
|
|
1041
1030
|
}
|
|
@@ -1191,8 +1180,7 @@ MediaControl.extend = function (properties) {
|
|
|
1191
1180
|
return extend(MediaControl, properties);
|
|
1192
1181
|
};
|
|
1193
1182
|
function serializeSettings(s) {
|
|
1194
|
-
return s.left
|
|
1195
|
-
.slice()
|
|
1183
|
+
return s.left.slice()
|
|
1196
1184
|
.sort()
|
|
1197
1185
|
.concat(s.right.slice().sort())
|
|
1198
1186
|
.concat(s.default.slice().sort())
|
package/lib/plugins/utils.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export declare function getLocation(href: string): HTMLAnchorElement;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Parse a time string in the format "hh:mm:ss" or "mm:ss" or "ss" to seconds.
|
|
4
|
+
* @param str - The time string to parse.
|
|
5
|
+
* @returns The time in seconds.
|
|
6
|
+
* @example "01:01:00" -> 3660
|
|
7
|
+
* @example "01:00" -> 60
|
|
8
|
+
* @example "33" -> 33
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseClipTime(str: string): number;
|
|
3
11
|
export declare function getPageX(event: MouseEvent | TouchEvent): number;
|
|
4
12
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/plugins/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,qBAMvC;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/plugins/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,qBAMvC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAU/D"}
|
package/lib/plugins/utils.js
CHANGED
|
@@ -3,7 +3,15 @@ export function getLocation(href) {
|
|
|
3
3
|
l.href = href;
|
|
4
4
|
return l;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Parse a time string in the format "hh:mm:ss" or "mm:ss" or "ss" to seconds.
|
|
8
|
+
* @param str - The time string to parse.
|
|
9
|
+
* @returns The time in seconds.
|
|
10
|
+
* @example "01:01:00" -> 3660
|
|
11
|
+
* @example "01:00" -> 60
|
|
12
|
+
* @example "33" -> 33
|
|
13
|
+
*/
|
|
14
|
+
export function parseClipTime(str) {
|
|
7
15
|
if (!str) {
|
|
8
16
|
return 0;
|
|
9
17
|
}
|
|
@@ -12,21 +20,12 @@ export function strtimeToMiliseconds(str) {
|
|
|
12
20
|
if (arr.length >= 3) {
|
|
13
21
|
h = parseInt(arr[arr.length - 3]) * 60 * 60;
|
|
14
22
|
}
|
|
15
|
-
else {
|
|
16
|
-
h = 0;
|
|
17
|
-
}
|
|
18
23
|
if (arr.length >= 2) {
|
|
19
24
|
m = parseInt(arr[arr.length - 2]) * 60;
|
|
20
25
|
}
|
|
21
|
-
else {
|
|
22
|
-
m = 0;
|
|
23
|
-
}
|
|
24
26
|
if (arr.length >= 1) {
|
|
25
27
|
s = parseInt(arr[arr.length - 1]);
|
|
26
28
|
}
|
|
27
|
-
else {
|
|
28
|
-
s = 0;
|
|
29
|
-
}
|
|
30
29
|
return (h + m + s);
|
|
31
30
|
}
|
|
32
31
|
export function getPageX(event) {
|
|
@@ -2,7 +2,7 @@ import { reportError } from '@gcorevideo/utils';
|
|
|
2
2
|
import assert from 'assert';
|
|
3
3
|
import URLHandler from './urlhandler.js';
|
|
4
4
|
import MergeVast from './xmlmerge.js';
|
|
5
|
-
import {
|
|
5
|
+
import { parseClipTime } from '../utils.js';
|
|
6
6
|
export default class LoaderXML {
|
|
7
7
|
url;
|
|
8
8
|
config = '';
|
|
@@ -91,7 +91,7 @@ export default class LoaderXML {
|
|
|
91
91
|
this.removeTag('Tracking', 'event="progress"');
|
|
92
92
|
}
|
|
93
93
|
if (linearSkipOffset && linearSkipOffset.length > 1) {
|
|
94
|
-
timeOffset =
|
|
94
|
+
timeOffset = parseClipTime(linearSkipOffset[1]);
|
|
95
95
|
this.config = this.config.replace(/<Linear skipoffset="(\d+:\d+:\d+)".*?>/g, '<Linear>');
|
|
96
96
|
}
|
|
97
97
|
return { skipEvents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,OAY7C"}
|
package/lib/testUtils.js
CHANGED
|
@@ -152,14 +152,11 @@ export function createMockMediaControl(core) {
|
|
|
152
152
|
mediaControl.$el.html(`<div class="media-control-left-panel" data-media-control></div>
|
|
153
153
|
<div class="media-control-right-panel" data-media-control></div>
|
|
154
154
|
<div class="media-control-center-panel" data-media-control></div>`);
|
|
155
|
-
const elements = {
|
|
156
|
-
gear: $(document.createElement('div')),
|
|
157
|
-
};
|
|
158
|
-
// @ts-ignore
|
|
159
|
-
mediaControl.getElement = vi.fn().mockImplementation((name) => elements[name]);
|
|
160
155
|
// @ts-ignore
|
|
161
156
|
mediaControl.putElement = vi.fn();
|
|
162
157
|
// @ts-ignore
|
|
158
|
+
mediaControl.mount = vi.fn();
|
|
159
|
+
// @ts-ignore
|
|
163
160
|
mediaControl.toggleElement = vi.fn();
|
|
164
161
|
return mediaControl;
|
|
165
162
|
}
|