@gcorevideo/player 2.20.22 → 2.21.1

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.
Files changed (76) hide show
  1. package/assets/audio-selector/style.scss +48 -82
  2. package/assets/audio-selector/track-selector.ejs +3 -3
  3. package/assets/bottom-gear/bottomgear.ejs +10 -12
  4. package/assets/bottom-gear/gear-sub-menu.scss +0 -15
  5. package/assets/bottom-gear/gear.scss +3 -32
  6. package/assets/media-control/media-control.ejs +5 -20
  7. package/assets/media-control/media-control.scss +124 -34
  8. package/assets/media-control/width370.scss +32 -104
  9. package/assets/picture-in-picture/button.ejs +1 -1
  10. package/assets/picture-in-picture/button.scss +5 -4
  11. package/dist/core.js +148 -23
  12. package/dist/index.css +530 -616
  13. package/dist/index.js +284 -282
  14. package/dist/player.d.ts +19 -16
  15. package/dist/plugins/index.css +1009 -1095
  16. package/dist/plugins/index.js +709 -23402
  17. package/docs/api/player.audioselector.md +4 -59
  18. package/docs/api/player.md +1 -1
  19. package/docs/api/player.mediacontrol.getelement.md +5 -0
  20. package/docs/api/player.mediacontrol.md +14 -0
  21. package/docs/api/{player.audioselector.updatecurrenttrack.md → player.mediacontrol.putelement.md} +7 -7
  22. package/docs/api/player.mediacontrolelement.md +1 -1
  23. package/docs/api/{player.audioselector.starttrackswitch.md → player.pictureinpicture.attributes.md} +5 -7
  24. package/docs/api/player.pictureinpicture.md +45 -0
  25. package/lib/playback/BasePlayback.d.ts +0 -1
  26. package/lib/playback/BasePlayback.d.ts.map +1 -1
  27. package/lib/playback/BasePlayback.js +0 -1
  28. package/lib/playback/HTML5Video.d.ts +4 -0
  29. package/lib/playback/HTML5Video.d.ts.map +1 -1
  30. package/lib/playback/HTML5Video.js +53 -4
  31. package/lib/playback/dash-playback/DashPlayback.d.ts +5 -0
  32. package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
  33. package/lib/playback/dash-playback/DashPlayback.js +48 -4
  34. package/lib/playback/hls-playback/HlsPlayback.d.ts +31 -25
  35. package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
  36. package/lib/playback/hls-playback/HlsPlayback.js +47 -14
  37. package/lib/plugins/audio-selector/AudioSelector.d.ts +12 -11
  38. package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
  39. package/lib/plugins/audio-selector/AudioSelector.js +65 -185
  40. package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -1
  41. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  42. package/lib/plugins/bottom-gear/BottomGear.js +10 -9
  43. package/lib/plugins/level-selector/LevelSelector.js +1 -1
  44. package/lib/plugins/media-control/MediaControl.d.ts +3 -3
  45. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  46. package/lib/plugins/media-control/MediaControl.js +17 -9
  47. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +3 -0
  48. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
  49. package/lib/plugins/picture-in-picture/PictureInPicture.js +6 -1
  50. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  51. package/lib/plugins/source-controller/SourceController.js +0 -1
  52. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +0 -2
  53. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  54. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +1 -18
  55. package/lib/testUtils.d.ts.map +1 -1
  56. package/lib/testUtils.js +2 -0
  57. package/package.json +1 -1
  58. package/src/playback/BasePlayback.ts +0 -1
  59. package/src/playback/HTML5Video.ts +57 -4
  60. package/src/playback/dash-playback/DashPlayback.ts +64 -6
  61. package/src/playback/hls-playback/HlsPlayback.ts +82 -40
  62. package/src/plugins/audio-selector/AudioSelector.ts +84 -278
  63. package/src/plugins/bottom-gear/BottomGear.ts +11 -10
  64. package/src/plugins/bottom-gear/__tests__/BottomGear.test.ts +1 -3
  65. package/src/plugins/bottom-gear/__tests__/__snapshots__/BottomGear.test.ts.snap +14 -37
  66. package/src/plugins/level-selector/LevelSelector.ts +1 -1
  67. package/src/plugins/media-control/MediaControl.ts +18 -13
  68. package/src/plugins/picture-in-picture/PictureInPicture.ts +7 -1
  69. package/src/plugins/source-controller/SourceController.ts +0 -1
  70. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +1 -20
  71. package/src/testUtils.ts +2 -0
  72. package/src/typings/globals.d.ts +19 -0
  73. package/temp/player.api.json +102 -143
  74. package/tsconfig.tsbuildinfo +1 -1
  75. package/assets/media-control/plugins.scss +0 -94
  76. package/docs/api/player.audioselector.highlightcurrenttrack.md +0 -18
@@ -18,29 +18,6 @@
18
18
  max-height: 300px;
19
19
  transform: none;
20
20
 
21
- .share-container-main {
22
- // .share-container-header--linktext,
23
- // .share-container-header--socialtext,
24
- // .share-container-header--embedtext,
25
- // .share-container-header--embed {
26
- // display: none;
27
- // }
28
-
29
- //.share-container-header--socialicon {
30
- // margin-top: -84px;
31
- //}
32
- //
33
- //.share-container-header--link {
34
- // width: 100%;
35
- // border-left: none;
36
- // border-right: none;
37
- // margin-top: 52px;
38
- // height: 32px;
39
- // font-size: 12px;
40
- // padding: 10px;
41
- //}
42
- }
43
-
44
21
  .share-container-header {
45
22
  border: none;
46
23
 
@@ -54,39 +31,42 @@
54
31
  .media-control-quality,
55
32
  .media-control-audio-tracks {
56
33
  display: block;
34
+ }
57
35
 
58
- .level_selector[data-level-selector],
59
- .audio_selector[data-track-selector] {
60
- margin-top: 3px;
61
- margin-right: 10px;
36
+ .level-selector[data-level-selector],
37
+ .media-control-audio-tracks[data-track-selector] {
38
+ margin-top: 3px;
39
+ margin-right: 10px;
62
40
 
63
- ul {
64
- bottom: 30px;
65
- width: 50px;
41
+ ul {
42
+ bottom: 30px;
43
+ width: 50px;
66
44
 
67
- li {
68
- height: 23px;
69
- font-size: 14px;
45
+ li {
46
+ height: 23px;
47
+ font-size: 14px;
70
48
 
71
- a {
72
- height: 23px;
73
- padding: 2px 5px;
74
- }
49
+ a {
50
+ height: 23px;
51
+ padding: 2px 5px;
75
52
  }
76
53
  }
54
+ }
77
55
 
78
- button[data-level-selector-button],
79
- button[data-track-selector-button] {
80
- .quality-text, .audio-text {
81
- font-size: 13px;
82
- }
56
+ button[data-level-selector-button],
57
+ button[data-track-selector-button] {
83
58
 
84
- span.quality-arrow, span.audio-arrow {
85
- width: 7px;
86
- height: 5px;
87
- margin-left: 4px;
88
- margin-top: 11px;
89
- }
59
+ .quality-text,
60
+ .audio-text {
61
+ font-size: 13px;
62
+ }
63
+
64
+ span.quality-arrow,
65
+ span.audio-arrow {
66
+ width: 7px;
67
+ height: 5px;
68
+ margin-left: 4px;
69
+ margin-top: 11px;
90
70
  }
91
71
  }
92
72
  }
@@ -104,54 +84,12 @@
104
84
  margin: 0;
105
85
  }
106
86
  }
107
-
108
- // ul {
109
- // width: 150px;
110
- // bottom: 32px;
111
- // padding: 0;
112
-
113
- // li {
114
- // .multicamera-item {
115
- // .multicamera-poster {
116
- // width: 40px;
117
- // height: 30px;
118
- // img {
119
- // width: 40px;
120
- // height: 30px;
121
- // }
122
- // }
123
- // .multicamera-text {
124
- // width: 70px;
125
- // .multicamera-title {
126
- // width: 70px;
127
- // height: 15px;
128
- // font-size: 12px;
129
- // }
130
- // }
131
- // }
132
- // }
133
- // &::after {
134
- // display: none;
135
- // }
136
- // }
137
-
138
87
  }
139
88
  }
140
89
 
141
90
  .media-control-layer[data-controls] {
142
- height: 32px;
143
-
144
- .media-control-bottomgear {
145
- .button-gear {
146
- height: 33px;
147
- margin-right: 10px;
148
- padding-right: 0;
149
-
150
- svg {
151
- height: 17px;
152
- }
153
- }
154
- }
91
+ padding-left: 10px;
92
+ padding-right: 12px;
155
93
 
156
94
  .media-control-indicator {
157
95
  line-height: 32px;
@@ -201,18 +139,7 @@
201
139
  button.media-control-button {
202
140
  height: 32px;
203
141
 
204
- &[data-playpause] {
205
- margin-left: 10px;
206
- margin-right: 10px;
207
- }
208
-
209
- &[data-playstop] {
210
- margin-left: 10px;
211
- margin-right: 10px;
212
- }
213
-
214
142
  &[data-fullscreen] {
215
- margin-right: 12px;
216
143
  height: 33px;
217
144
  }
218
145
 
@@ -222,6 +149,7 @@
222
149
  }
223
150
 
224
151
  .media-clip-container {
152
+
225
153
  .media-clip-text,
226
154
  .media-clip-point {
227
155
  line-height: 33px;
@@ -260,4 +188,4 @@
260
188
  }
261
189
  }
262
190
  }
263
- }
191
+ }
@@ -1,3 +1,3 @@
1
1
  <button class="gplayer-lite-btn gcore-skin-button-color">
2
- <span><%= pipIcon %></span>
2
+ <%= pipIcon %>
3
3
  </button>
@@ -1,11 +1,12 @@
1
1
  .media-control-pip {
2
+ order: 95;
3
+ display: flex;
4
+
2
5
  button {
3
- float: right;
4
- height: 40px;
5
- margin-right: 20px;
6
+ height: 20px;
6
7
 
7
8
  svg {
8
9
  height: 20px;
9
10
  }
10
11
  }
11
- }
12
+ }
package/dist/core.js CHANGED
@@ -12540,7 +12540,6 @@ var PlaybackErrorCode;
12540
12540
  /**
12541
12541
  * This class adds common behaviors to all playback modules.
12542
12542
  * @internal
12543
- * TODO use custom HTML5Video playback with this layer applied
12544
12543
  */
12545
12544
  class BasePlayback extends HTML5Video$1 {
12546
12545
  createError(errorData, options) {
@@ -12586,13 +12585,13 @@ var PlaybackEvents;
12586
12585
  PlaybackEvents["PLAYBACK_RATE_CHANGED"] = "playback:rate-changed";
12587
12586
  })(PlaybackEvents || (PlaybackEvents = {}));
12588
12587
 
12589
- // Copyright 2014 Globo.com Player authors. All rights reserved.
12590
- // Use of this source code is governed by a BSD-style
12591
- // license that can be found in the LICENSE file.
12588
+ // This code is derived on works by Globo.com.
12589
+ // This code is distributed under the terms of the Apache License 2.0.
12590
+ // Original code's license can be found on
12591
+ // https://github.com/clappr/clappr/blob/8752995ea439321ac7ca3cd35e8c64de7a3c3d17/LICENSE
12592
12592
  const AUTO$1 = -1;
12593
12593
  const { now: now$2 } = Utils;
12594
12594
  const T$3 = 'playback.dash';
12595
- // @ts-expect-error
12596
12595
  class DashPlayback extends BasePlayback {
12597
12596
  _levels = null;
12598
12597
  _currentLevel = null;
@@ -12752,6 +12751,7 @@ class DashPlayback extends BasePlayback {
12752
12751
  const newLevel = this.getLevel(evt.newQuality);
12753
12752
  this.onLevelSwitch(newLevel);
12754
12753
  });
12754
+ this.checkAudioTracks();
12755
12755
  });
12756
12756
  this._dash.on(DASHJS.MediaPlayer.events.QUALITY_CHANGE_RENDERED, (evt) => {
12757
12757
  const currentLevel = this.getLevel(evt.newQuality);
@@ -12772,6 +12772,11 @@ class DashPlayback extends BasePlayback {
12772
12772
  this._dash.on(DASHJS.MediaPlayer.events.PLAYBACK_RATE_CHANGED, (e) => {
12773
12773
  this.trigger(PlaybackEvents.PLAYBACK_RATE_CHANGED, e.playbackRate);
12774
12774
  });
12775
+ this._dash.on(DASHJS.MediaPlayer.events.TRACK_CHANGE_RENDERED, (e) => {
12776
+ if (e.mediaType === 'audio') {
12777
+ this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack$1(e.newMediaInfo));
12778
+ }
12779
+ });
12775
12780
  }
12776
12781
  render() {
12777
12782
  this._ready();
@@ -13039,6 +13044,36 @@ class DashPlayback extends BasePlayback {
13039
13044
  setPlaybackRate(rate) {
13040
13045
  this._dash?.setPlaybackRate(rate);
13041
13046
  }
13047
+ get audioTracks() {
13048
+ assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
13049
+ const tracks = this._dash.getTracksFor('audio');
13050
+ trace(`${T$3} get audioTracks`, { tracks });
13051
+ return tracks.map(toClapprTrack$1);
13052
+ }
13053
+ // @ts-expect-error
13054
+ get currentAudioTrack() {
13055
+ trace(`${T$3} get currentAudioTrack`);
13056
+ assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
13057
+ const t = this._dash.getCurrentTrackFor('audio');
13058
+ if (!t) {
13059
+ return null;
13060
+ }
13061
+ return toClapprTrack$1(t);
13062
+ }
13063
+ switchAudioTrack(id) {
13064
+ assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized');
13065
+ const tracks = this._dash.getTracksFor('audio');
13066
+ const track = tracks.find((t) => t.id === id);
13067
+ assert.ok(track, 'Invalid audio track ID');
13068
+ this._dash.setCurrentTrack(track);
13069
+ }
13070
+ checkAudioTracks() {
13071
+ // @ts-ignore
13072
+ const tracks = this._dash.getTracksFor('audio');
13073
+ if (tracks.length) {
13074
+ this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, tracks.map(toClapprTrack$1));
13075
+ }
13076
+ }
13042
13077
  }
13043
13078
  DashPlayback.canPlay = function (resource, mimeType) {
13044
13079
  if (!isDashSource(resource, mimeType)) {
@@ -13050,6 +13085,14 @@ DashPlayback.canPlay = function (resource, mimeType) {
13050
13085
  const ctor = ms || mms || wms;
13051
13086
  return typeof ctor === 'function';
13052
13087
  };
13088
+ function toClapprTrack$1(t) {
13089
+ return {
13090
+ id: t.id,
13091
+ kind: t.roles && t.roles?.length > 0 ? t.roles[0] : 'main', // TODO
13092
+ label: t.labels.map((l) => l.text).join(' '), // TODO
13093
+ language: t.lang,
13094
+ };
13095
+ }
13053
13096
 
13054
13097
  function getDefaultExportFromCjs (x) {
13055
13098
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -41711,7 +41754,6 @@ const DEFAULT_RECOVER_ATTEMPTS = 16;
41711
41754
  Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
41712
41755
  Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
41713
41756
  const T$2 = 'playback.hls';
41714
- // @ts-expect-error
41715
41757
  class HlsPlayback extends BasePlayback {
41716
41758
  _ccIsSetup = false;
41717
41759
  _ccTracksUpdated = false;
@@ -41756,7 +41798,7 @@ class HlsPlayback extends BasePlayback {
41756
41798
  set currentLevel(id) {
41757
41799
  this._currentLevel = id;
41758
41800
  this.trigger(Events$1.PLAYBACK_LEVEL_SWITCH_START);
41759
- assert.ok(this._hls, 'Hls.js instance is not available');
41801
+ assert.ok(this._hls, 'HLS.js is not initialized');
41760
41802
  if (this.options.playback.hlsUseNextLevel) {
41761
41803
  this._hls.nextLevel = this._currentLevel;
41762
41804
  }
@@ -41765,11 +41807,11 @@ class HlsPlayback extends BasePlayback {
41765
41807
  }
41766
41808
  }
41767
41809
  get latency() {
41768
- assert.ok(this._hls, 'Hls.js instance is not available');
41810
+ assert.ok(this._hls, 'HLS.js is not initialized');
41769
41811
  return this._hls.latency;
41770
41812
  }
41771
41813
  get currentProgramDateTime() {
41772
- assert.ok(this._hls, 'Hls.js instance is not available');
41814
+ assert.ok(this._hls, 'HLS.js is not initialized');
41773
41815
  assert.ok(this._hls.playingDate, 'Hls.js playingDate is not defined');
41774
41816
  return this._hls.playingDate;
41775
41817
  }
@@ -41954,7 +41996,7 @@ class HlsPlayback extends BasePlayback {
41954
41996
  return;
41955
41997
  }
41956
41998
  this._hls.once(Hls.Events.MEDIA_ATTACHED, () => {
41957
- assert.ok(this._hls, 'Hls.js instance is not available');
41999
+ assert.ok(this._hls, 'HLS.js is not initialized');
41958
42000
  this.options.hlsPlayback.preload && this._hls.loadSource(this.options.src);
41959
42001
  });
41960
42002
  const onPlaying = () => {
@@ -41979,13 +42021,15 @@ class HlsPlayback extends BasePlayback {
41979
42021
  // this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, (evt, data) => this._onSubtitleLoaded(evt, data));
41980
42022
  this._hls.on(Hls.Events.SUBTITLE_TRACK_LOADED, () => this._onSubtitleLoaded());
41981
42023
  this._hls.on(Hls.Events.SUBTITLE_TRACKS_UPDATED, () => (this._ccTracksUpdated = true));
42024
+ this._hls.on(Events.AUDIO_TRACKS_UPDATED, (evt, data) => this._onAudioTracksUpdated(evt, data));
42025
+ this._hls.on(Events.AUDIO_TRACK_SWITCHED, (evt, data) => this._onAudioTrackSwitched(evt, data));
41982
42026
  this.bindCustomListeners();
41983
42027
  }
41984
42028
  bindCustomListeners() {
41985
42029
  this.customListeners.forEach((item) => {
41986
42030
  const requestedEventName = item.eventName;
41987
42031
  const typeOfListener = item.once ? 'once' : 'on';
41988
- assert.ok(this._hls, 'Hls.js instance is not available');
42032
+ assert.ok(this._hls, 'HLS.js is not initialized');
41989
42033
  requestedEventName &&
41990
42034
  this._hls[`${typeOfListener}`](requestedEventName, item.callback);
41991
42035
  });
@@ -41993,7 +42037,7 @@ class HlsPlayback extends BasePlayback {
41993
42037
  unbindCustomListeners() {
41994
42038
  this.customListeners.forEach((item) => {
41995
42039
  const requestedEventName = item.eventName;
41996
- assert.ok(this._hls, 'Hls.js instance is not available');
42040
+ assert.ok(this._hls, 'HLS.js is not initialized');
41997
42041
  requestedEventName && this._hls.off(requestedEventName, item.callback);
41998
42042
  });
41999
42043
  }
@@ -42017,7 +42061,7 @@ class HlsPlayback extends BasePlayback {
42017
42061
  this.trigger(Events$1.PLAYBACK_READY, this.name);
42018
42062
  }
42019
42063
  _recover(evt, data, error) {
42020
- assert(this._hls, 'Hls.js instance is not available');
42064
+ assert(this._hls, 'HLS.js is not initialized');
42021
42065
  if (!this._recoveredDecodingError) {
42022
42066
  this._recoveredDecodingError = true;
42023
42067
  this._hls.recoverMediaError();
@@ -42180,10 +42224,6 @@ class HlsPlayback extends BasePlayback {
42180
42224
  details: data.details,
42181
42225
  });
42182
42226
  error.level = PlayerError.Levels.WARN;
42183
- // TODO check
42184
- // if (data.error instanceof MediaError && data.error.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) {
42185
- // error.code = PlaybackErrorCode.MediaSourceUnavailable
42186
- // }
42187
42227
  this._recover(evt, data, error);
42188
42228
  break;
42189
42229
  default:
@@ -42325,7 +42365,7 @@ class HlsPlayback extends BasePlayback {
42325
42365
  }
42326
42366
  }
42327
42367
  _fillLevels() {
42328
- assert.ok(this._hls, 'Hls.js instance is not available');
42368
+ assert.ok(this._hls, 'HLS.js is not initialized');
42329
42369
  this._levels = this._hls.levels.map((level, index) => {
42330
42370
  return {
42331
42371
  level: index, // or level.id?
@@ -42526,6 +42566,34 @@ class HlsPlayback extends BasePlayback {
42526
42566
  }));
42527
42567
  this.stop();
42528
42568
  }
42569
+ get audioTracks() {
42570
+ assert.ok(this._hls, 'HLS.js is not initialized');
42571
+ return this._hls.audioTracks.map(toClapprTrack);
42572
+ }
42573
+ // @ts-expect-error
42574
+ get currentAudioTrack() {
42575
+ assert.ok(this._hls, 'HLS.js is not initialized');
42576
+ const idx = this._hls.audioTrack;
42577
+ const track = this._hls.audioTracks[idx]; // TODO or find by .id == idx?
42578
+ if (track) {
42579
+ return toClapprTrack(track);
42580
+ }
42581
+ return null;
42582
+ }
42583
+ switchAudioTrack(id) {
42584
+ assert.ok(this._hls, 'HLS.js is not initialized');
42585
+ this._hls.audioTrack = Number(id); // TODO or find index by .id == id?
42586
+ }
42587
+ _onAudioTracksUpdated(_, data) {
42588
+ trace(`${T$2} onAudioTracksUpdated`);
42589
+ this.trigger(Events$1.PLAYBACK_AUDIO_AVAILABLE, data.audioTracks.map(toClapprTrack));
42590
+ }
42591
+ _onAudioTrackSwitched(_, data) {
42592
+ trace(`${T$2} onAudioTrackSwitched`);
42593
+ // @ts-ignore
42594
+ const track = this._hls.audioTracks[data.id];
42595
+ this.trigger(Events$1.PLAYBACK_AUDIO_CHANGED, toClapprTrack(track));
42596
+ }
42529
42597
  }
42530
42598
  HlsPlayback.canPlay = function (resource, mimeType) {
42531
42599
  if (!isHlsSource(resource, mimeType)) {
@@ -42533,6 +42601,14 @@ HlsPlayback.canPlay = function (resource, mimeType) {
42533
42601
  }
42534
42602
  return Hls.isSupported();
42535
42603
  };
42604
+ function toClapprTrack(t) {
42605
+ return {
42606
+ id: String(t.id),
42607
+ language: t.lang ?? '',
42608
+ kind: t.type === 'main' ? 'main' : 'description', // TODO check
42609
+ label: t.name,
42610
+ };
42611
+ }
42536
42612
 
42537
42613
  const T$1 = 'playback.html5_video';
42538
42614
  const STALL_TIMEOUT = 15000;
@@ -42553,10 +42629,6 @@ class HTML5Video extends BasePlayback {
42553
42629
  if (i18n &&
42554
42630
  !errorData.UI &&
42555
42631
  errorData.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) {
42556
- // errorData.UI = {
42557
- // title: i18n.t('no_broadcast'),
42558
- // message: errorData.message,
42559
- // }
42560
42632
  errorData.code = PlaybackErrorCode.MediaSourceUnavailable;
42561
42633
  }
42562
42634
  return super.createError(errorData, { ...options, useCodePrefix: false });
@@ -42612,6 +42684,59 @@ class HTML5Video extends BasePlayback {
42612
42684
  this.stallTimerId = null;
42613
42685
  }
42614
42686
  }
42687
+ get audioTracks() {
42688
+ const tracks = this.el.audioTracks;
42689
+ const supported = !!tracks;
42690
+ trace(`${T$1} get audioTracks`, { supported });
42691
+ const retval = [];
42692
+ if (supported) {
42693
+ for (let i = 0; i < tracks.length; i++) {
42694
+ const track = tracks[i];
42695
+ retval.push({
42696
+ id: track.id,
42697
+ label: track.label,
42698
+ language: track.language,
42699
+ kind: track.kind, // TODO check
42700
+ });
42701
+ }
42702
+ }
42703
+ return retval;
42704
+ }
42705
+ // @ts-expect-error
42706
+ get currentAudioTrack() {
42707
+ const tracks = this.el.audioTracks;
42708
+ const supported = !!tracks;
42709
+ trace(`${T$1} get currentAudioTrack`, {
42710
+ supported,
42711
+ });
42712
+ if (supported) {
42713
+ for (let i = 0; i < tracks.length; i++) {
42714
+ const track = tracks[i];
42715
+ if (track.enabled) {
42716
+ return {
42717
+ id: track.id,
42718
+ label: track.label,
42719
+ language: track.language,
42720
+ kind: track.kind,
42721
+ };
42722
+ }
42723
+ }
42724
+ }
42725
+ return null;
42726
+ }
42727
+ switchAudioTrack(id) {
42728
+ const tracks = this.el.audioTracks;
42729
+ const supported = !!tracks;
42730
+ trace(`${T$1} switchAudioTrack`, {
42731
+ supported,
42732
+ });
42733
+ if (supported) {
42734
+ for (let i = 0; i < tracks.length; i++) {
42735
+ const track = tracks[i];
42736
+ track.enabled = track.id === id;
42737
+ }
42738
+ }
42739
+ }
42615
42740
  }
42616
42741
 
42617
42742
  // TODO consider allowing the variation of the order of playback modules
@@ -43085,7 +43210,7 @@ class Player {
43085
43210
  }
43086
43211
  }
43087
43212
 
43088
- var version$1 = "2.20.22";
43213
+ var version$1 = "2.21.1";
43089
43214
 
43090
43215
  var packages = {
43091
43216
  "node_modules/@clappr/core": {