@gcorevideo/player 2.22.14 → 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/context-menu/context_menu.ejs +14 -6
- package/assets/context-menu/context_menu.scss +18 -4
- 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 +5 -23
- package/dist/index.css +424 -412
- package/dist/index.js +294 -286
- package/dist/player.d.ts +211 -144
- package/dist/plugins/index.css +1513 -1501
- package/dist/plugins/index.js +224 -227
- 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/Player.d.ts.map +1 -1
- package/lib/Player.js +4 -1
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +0 -21
- package/lib/plugins/click-to-pause/ClickToPause.js +1 -1
- 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/context-menu/ContextMenu.d.ts +33 -12
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.js +40 -37
- 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/Player.ts +4 -3
- package/src/playback/hls-playback/HlsPlayback.ts +0 -22
- package/src/plugins/click-to-pause/ClickToPause.ts +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/context-menu/ContextMenu.ts +72 -56
- 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__/MediaControl.test.ts +66 -30
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div class="media-clip-text" id="clips-text"></div>
|
package/assets/clips/clips.scss
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.media-control-clips {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 6px;
|
|
4
|
+
.media-clip-text {
|
|
5
|
+
text-overflow: ellipsis;
|
|
6
|
+
white-space: nowrap;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
display: inline-block;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
color: white;
|
|
11
|
+
cursor: default;
|
|
12
|
+
line-height: var(--bottom-panel);
|
|
13
|
+
position: relative;
|
|
14
|
+
|
|
15
|
+
&::before {
|
|
16
|
+
content: '•';
|
|
17
|
+
padding-right: 6px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.media-clip-text {
|
|
21
|
+
max-width: 100px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
<ul class="context-menu-list">
|
|
2
|
-
<%
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<ul class="context-menu-list" role="menu" id="context-menu-options">
|
|
2
|
+
<% for (const item of options) { %>
|
|
3
|
+
<li class="context-menu-list-item <%= item.class %>">
|
|
4
|
+
<button role="menuitem" data-name="<%= item.name %>">
|
|
5
|
+
<% if (iconic) { %>
|
|
6
|
+
<span class="context-menu-list-item_icon"><%= item.icon || '' %></span>
|
|
7
|
+
<% } %>
|
|
8
|
+
<% if (item.labelKey) { %>
|
|
9
|
+
<%= i18n.t(item.labelKey) %>
|
|
10
|
+
<% } else { %>
|
|
11
|
+
<%= item.label %>
|
|
12
|
+
<% } %>
|
|
13
|
+
</button>
|
|
14
|
+
</li>
|
|
7
15
|
<% } %>
|
|
8
16
|
</ul>
|
|
@@ -22,10 +22,24 @@ $box-border-color: #666;
|
|
|
22
22
|
border: 1px solid $box-border-color;
|
|
23
23
|
border-radius: 4px;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
&-item {
|
|
26
|
+
button {
|
|
27
|
+
border: none;
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
padding: 0;
|
|
30
|
+
color: white;
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
padding: 5px;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
&_icon {
|
|
40
|
+
width: 20px;
|
|
41
|
+
height: 20px;
|
|
42
|
+
}
|
|
29
43
|
}
|
|
30
44
|
}
|
|
31
45
|
}
|
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
<ul class="gear-sub-menu quality-levels" id="level-selector-menu" role="menu">
|
|
6
6
|
<% if (!removeAuto) { %>
|
|
7
7
|
<li>
|
|
8
|
-
<a href="#"
|
|
8
|
+
<a href="#"
|
|
9
|
+
class="gear-sub-menu_btn gcore-skin-text-color"
|
|
10
|
+
data-id="-1"
|
|
11
|
+
id="level_selector_auto"
|
|
12
|
+
aria-checked="<%= current === -1 %>"
|
|
13
|
+
role="menuitemradio"
|
|
14
|
+
>
|
|
9
15
|
<span class="check-icon"><%= checkIcon %></span>
|
|
10
16
|
<%= i18n.t('auto') %>
|
|
11
17
|
</a>
|
|
@@ -19,8 +25,8 @@
|
|
|
19
25
|
<a href="#"
|
|
20
26
|
class="gear-sub-menu_btn gcore-skin-text-color<%= checked ? ' gcore-skin-active' : '' %>"
|
|
21
27
|
data-id="<%= item.level %>"
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
aria-disabled="<%= disabled %>"
|
|
29
|
+
aria-checked="<%= checked %>"
|
|
24
30
|
role="menuitemradio"
|
|
25
31
|
id="level_selector_<%= item.width > item.height ? item.height : item.width %>"
|
|
26
32
|
>
|
|
@@ -45,12 +45,6 @@
|
|
|
45
45
|
<% var renderMultiCamera = function(name) { %>
|
|
46
46
|
<div class="media-control-multicamera" data-<%= name %>></div>
|
|
47
47
|
<% }; %>
|
|
48
|
-
<% var renderClipsText = function(name) { %>
|
|
49
|
-
<div class="media-clip-container gcore-skin-text-color" data-<%= name %>>
|
|
50
|
-
<div class="media-clip-point gcore-skin-text-color" data-<%= name %>>•</div>
|
|
51
|
-
<div class="media-clip-text gcore-skin-text-color" data-<%= name %>></div>
|
|
52
|
-
</div>
|
|
53
|
-
<% }; %>
|
|
54
48
|
<% var renderVR = function(name) { %>
|
|
55
49
|
<div class="media-control-vr" data-<%= name %>></div>
|
|
56
50
|
<% }; %>
|
|
@@ -72,7 +66,7 @@
|
|
|
72
66
|
renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function (name) {
|
|
73
67
|
return renderSegmentedBar(name);
|
|
74
68
|
});
|
|
75
|
-
} else if (setting === "duration" || setting === "position") {
|
|
69
|
+
} else if (setting === "duration" || setting === "position" || setting === "clips") {
|
|
76
70
|
renderIndicator(setting);
|
|
77
71
|
} else if (setting === "quality") {
|
|
78
72
|
renderQuality(setting)
|
|
@@ -82,8 +76,6 @@
|
|
|
82
76
|
renderMultiCamera(setting)
|
|
83
77
|
} else if (setting === "vr") {
|
|
84
78
|
renderVR(setting)
|
|
85
|
-
} else if (setting === "clipsText") {
|
|
86
|
-
renderClipsText(setting)
|
|
87
79
|
} else if (["playpause", "playstop", "fullscreen"].includes(setting)) {
|
|
88
80
|
renderButton(setting);
|
|
89
81
|
}
|
|
@@ -178,31 +178,6 @@
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.media-clip-container {
|
|
182
|
-
display: none;
|
|
183
|
-
|
|
184
|
-
.media-clip-text,
|
|
185
|
-
.media-clip-point {
|
|
186
|
-
text-overflow: ellipsis;
|
|
187
|
-
white-space: nowrap;
|
|
188
|
-
overflow: hidden;
|
|
189
|
-
display: inline-block;
|
|
190
|
-
float: left;
|
|
191
|
-
color: white;
|
|
192
|
-
cursor: default;
|
|
193
|
-
line-height: var(--bottom-panel);
|
|
194
|
-
position: relative;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.media-clip-point {
|
|
198
|
-
margin-right: 6px;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.media-clip-text {
|
|
202
|
-
max-width: calc(80% - 240px);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
181
|
.bar-container[data-seekbar] {
|
|
207
182
|
position: absolute;
|
|
208
183
|
top: -11px;
|
|
@@ -146,16 +146,16 @@
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.media-clip-container
|
|
149
|
+
.media-clip-container,
|
|
150
|
+
.media-control-clips {
|
|
150
151
|
|
|
151
|
-
.media-clip-text
|
|
152
|
-
.media-clip-point {
|
|
152
|
+
.media-clip-text {
|
|
153
153
|
line-height: 33px;
|
|
154
154
|
font-size: 11px;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.media-clip-text {
|
|
158
|
-
max-width:
|
|
158
|
+
max-width: 50px;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
package/dist/core.js
CHANGED
|
@@ -42133,16 +42133,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
42133
42133
|
this.seek(seekTo);
|
|
42134
42134
|
}
|
|
42135
42135
|
seek(time) {
|
|
42136
|
-
// trace(`${T} seek`, {
|
|
42137
|
-
// time,
|
|
42138
|
-
// duration: this._duration,
|
|
42139
|
-
// startTime: this._startTime,
|
|
42140
|
-
// currentTimestamp: this.currentTimestamp,
|
|
42141
|
-
// playbackType: this.getPlaybackType(),
|
|
42142
|
-
// dvrEnabled: this.dvrEnabled,
|
|
42143
|
-
// durationExcludesAfterLiveSyncPoint: this._durationExcludesAfterLiveSyncPoint,
|
|
42144
|
-
// minDvrSize: this._minDvrSize,
|
|
42145
|
-
// })
|
|
42146
42136
|
if (time < 0) {
|
|
42147
42137
|
Log.warn('Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point.');
|
|
42148
42138
|
time = this.getDuration();
|
|
@@ -42294,11 +42284,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
42294
42284
|
return;
|
|
42295
42285
|
}
|
|
42296
42286
|
this._lastTimeUpdate = update;
|
|
42297
|
-
// trace(`${T} _onTimeUpdate`, {
|
|
42298
|
-
// current: update.current,
|
|
42299
|
-
// total: update.total,
|
|
42300
|
-
// firstFragDateTime: update.firstFragDateTime,
|
|
42301
|
-
// })
|
|
42302
42287
|
this.trigger(Events$1.PLAYBACK_TIMEUPDATE, update, this.name);
|
|
42303
42288
|
}
|
|
42304
42289
|
_onDurationChange() {
|
|
@@ -42569,12 +42554,6 @@ class HlsPlayback extends BasePlayback {
|
|
|
42569
42554
|
this.trigger(Events$1.PLAYBACK_LEVEL_SWITCH_END);
|
|
42570
42555
|
}
|
|
42571
42556
|
get dvrEnabled() {
|
|
42572
|
-
// trace(`${T} dvrEnabled`, {
|
|
42573
|
-
// durationExcludesAfterLiveSyncPoint: this._durationExcludesAfterLiveSyncPoint,
|
|
42574
|
-
// duration: this._duration,
|
|
42575
|
-
// minDvrSize: this._minDvrSize,
|
|
42576
|
-
// playbackType: this.getPlaybackType(),
|
|
42577
|
-
// })
|
|
42578
42557
|
// enabled when:
|
|
42579
42558
|
// - the duration does not include content after hlsjs's live sync point
|
|
42580
42559
|
// - the playable region duration is longer than the configured duration to enable dvr after
|
|
@@ -42863,6 +42842,9 @@ class Player {
|
|
|
42863
42842
|
* ```
|
|
42864
42843
|
*/
|
|
42865
42844
|
attachTo(playerElement) {
|
|
42845
|
+
trace(`${T} attachTo`, {
|
|
42846
|
+
player: !!this.player,
|
|
42847
|
+
});
|
|
42866
42848
|
assert.ok(!this.player, 'Player already initialized');
|
|
42867
42849
|
assert.ok(playerElement, 'Player container element is required');
|
|
42868
42850
|
if (this.config.debug === 'all' || this.config.debug === 'clappr') {
|
|
@@ -43074,9 +43056,9 @@ class Player {
|
|
|
43074
43056
|
trace(`${T} initPlayer`, {
|
|
43075
43057
|
autoPlay: coreOptions.autoPlay,
|
|
43076
43058
|
sources: coreOptions.sources,
|
|
43059
|
+
player: !!this.player,
|
|
43077
43060
|
// TODO selected options
|
|
43078
43061
|
});
|
|
43079
|
-
assert.ok(!this.player, 'Player already initialized');
|
|
43080
43062
|
const player = new Player$1(coreOptions);
|
|
43081
43063
|
this.player = player;
|
|
43082
43064
|
this.bindCoreListeners();
|
|
@@ -43239,7 +43221,7 @@ class Player {
|
|
|
43239
43221
|
}
|
|
43240
43222
|
}
|
|
43241
43223
|
|
|
43242
|
-
var version$1 = "2.22.
|
|
43224
|
+
var version$1 = "2.22.16";
|
|
43243
43225
|
|
|
43244
43226
|
var packages = {
|
|
43245
43227
|
"node_modules/@clappr/core": {
|