@gcorevideo/player 2.25.9 → 2.26.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.
Files changed (177) hide show
  1. package/dist/core.js +23 -78
  2. package/dist/index.css +1193 -1193
  3. package/dist/index.embed.js +89 -153
  4. package/dist/index.js +112 -249
  5. package/dist/player.d.ts +2798 -2785
  6. package/docs/api/player.bigmutebutton.md +0 -3
  7. package/docs/api/player.bottomgear.additem.md +0 -3
  8. package/docs/api/player.bottomgear.md +2 -5
  9. package/docs/api/player.bottomgear.refresh.md +0 -3
  10. package/docs/api/player.clapprstats._constructor_.md +0 -3
  11. package/docs/api/player.clapprstats.clearmetrics.md +0 -3
  12. package/docs/api/player.clapprstats.exportmetrics.md +1 -4
  13. package/docs/api/player.clapprstats.md +2 -7
  14. package/docs/api/player.clapprstatsbitratetrack.md +0 -3
  15. package/docs/api/player.clapprstatschronograph.md +0 -13
  16. package/docs/api/player.clapprstatscounter.md +0 -25
  17. package/docs/api/player.clapprstatsevents.md +1 -4
  18. package/docs/api/player.clapprstatsmetrics.md +0 -3
  19. package/docs/api/player.clapprstatssettings.md +1 -4
  20. package/docs/api/player.clapprstatssettings.runeach.md +0 -3
  21. package/docs/api/player.clicktopause.md +0 -3
  22. package/docs/api/player.clips.destroy.md +0 -3
  23. package/docs/api/player.clips.disable.md +0 -3
  24. package/docs/api/player.clips.enable.md +0 -3
  25. package/docs/api/player.clips.gettext.md +0 -3
  26. package/docs/api/player.clips.md +1 -16
  27. package/docs/api/player.clips.render.md +0 -3
  28. package/docs/api/player.clips.supportedversion.md +0 -3
  29. package/docs/api/player.clips.version.md +0 -3
  30. package/docs/api/player.clipspluginsettings.md +1 -4
  31. package/docs/api/player.clipspluginsettings.text.md +0 -3
  32. package/docs/api/player.closedcaptions.hide.md +0 -3
  33. package/docs/api/player.closedcaptions.md +6 -5
  34. package/docs/api/player.closedcaptions.show.md +0 -3
  35. package/docs/api/player.closedcaptionspluginsettings.md +0 -3
  36. package/docs/api/player.cmcdconfig._constructor_.md +0 -3
  37. package/docs/api/player.cmcdconfig.exportids.md +0 -3
  38. package/docs/api/player.cmcdconfig.md +2 -5
  39. package/docs/api/player.cmcdconfigoptions.contentid.md +0 -3
  40. package/docs/api/player.cmcdconfigoptions.md +2 -5
  41. package/docs/api/player.cmcdconfigoptions.sessionid.md +0 -3
  42. package/docs/api/player.dvrcontrols.md +0 -3
  43. package/docs/api/player.extendedevents.md +0 -7
  44. package/docs/api/player.favicon.md +0 -3
  45. package/docs/api/player.faviconpluginsettings.faviconcolor.md +0 -3
  46. package/docs/api/player.faviconpluginsettings.md +1 -4
  47. package/docs/api/player.gearevents.md +1 -4
  48. package/docs/api/player.md +24 -43
  49. package/docs/api/player.mediacontrol.defaultsettings.md +5 -1
  50. package/docs/api/player.mediacontrol.getavailablepopupheight.md +20 -0
  51. package/docs/api/player.mediacontrol.md +14 -0
  52. package/docs/api/player.menuoption.md +0 -3
  53. package/docs/api/player.nerdstats._constructor_.md +0 -3
  54. package/docs/api/player.nerdstats.md +1 -4
  55. package/docs/api/player.pictureinpicture.attributes.md +0 -3
  56. package/docs/api/player.pictureinpicture.md +2 -7
  57. package/docs/api/player.playbackrateoption.md +0 -3
  58. package/docs/api/player.playbackratesettings.md +0 -3
  59. package/docs/api/player.poster.disable.md +0 -3
  60. package/docs/api/player.poster.enable.md +0 -3
  61. package/docs/api/player.poster.md +2 -5
  62. package/docs/api/player.posterpluginsettings.custom.md +0 -3
  63. package/docs/api/player.posterpluginsettings.md +4 -7
  64. package/docs/api/player.posterpluginsettings.showfornoop.md +0 -3
  65. package/docs/api/player.posterpluginsettings.showonvideoend.md +0 -3
  66. package/docs/api/player.posterpluginsettings.url.md +0 -3
  67. package/docs/api/player.qualitylevels.events.md +0 -3
  68. package/docs/api/player.qualitylevels.md +0 -5
  69. package/docs/api/player.qualitylevelspluginsettings.labels.md +0 -3
  70. package/docs/api/player.qualitylevelspluginsettings.md +2 -5
  71. package/docs/api/player.qualitylevelspluginsettings.restrictresolution.md +0 -3
  72. package/docs/api/player.skiptime.container.md +0 -3
  73. package/docs/api/player.skiptime.md +0 -9
  74. package/docs/api/player.skiptime.name.md +0 -3
  75. package/docs/api/player.skiptime.supportedversion.md +0 -3
  76. package/docs/api/player.volumefadeevents.md +0 -5
  77. package/docs/api/player.volumefadesettings.md +0 -3
  78. package/docs/api/player.zeptoresult.md +0 -3
  79. package/lib/Player.d.ts.map +1 -1
  80. package/lib/Player.js +0 -29
  81. package/lib/playback/HTML5Video.d.ts.map +1 -1
  82. package/lib/playback/HTML5Video.js +0 -18
  83. package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
  84. package/lib/playback/dash-playback/DashPlayback.js +0 -10
  85. package/lib/playback/hls-playback/HlsPlayback.d.ts +0 -1
  86. package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
  87. package/lib/playback/hls-playback/HlsPlayback.js +22 -20
  88. package/lib/plugins/big-mute-button/BigMuteButton.d.ts +1 -1
  89. package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
  90. package/lib/plugins/big-mute-button/BigMuteButton.js +1 -3
  91. package/lib/plugins/bottom-gear/BottomGear.d.ts +2 -2
  92. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  93. package/lib/plugins/bottom-gear/BottomGear.js +4 -8
  94. package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts +1 -1
  95. package/lib/plugins/clappr-nerd-stats/NerdStats.d.ts.map +1 -1
  96. package/lib/plugins/clappr-nerd-stats/NerdStats.js +3 -5
  97. package/lib/plugins/clappr-stats/ClapprStats.d.ts +3 -3
  98. package/lib/plugins/clappr-stats/ClapprStats.js +2 -2
  99. package/lib/plugins/clappr-stats/types.d.ts +5 -5
  100. package/lib/plugins/clappr-stats/types.js +3 -3
  101. package/lib/plugins/click-to-pause/ClickToPause.d.ts +1 -1
  102. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  103. package/lib/plugins/click-to-pause/ClickToPause.js +3 -7
  104. package/lib/plugins/clips/Clips.d.ts +2 -2
  105. package/lib/plugins/clips/Clips.d.ts.map +1 -1
  106. package/lib/plugins/clips/Clips.js +2 -6
  107. package/lib/plugins/cmcd-config/CmcdConfig.d.ts +2 -2
  108. package/lib/plugins/cmcd-config/CmcdConfig.js +1 -1
  109. package/lib/plugins/context-menu/ContextMenu.d.ts +1 -1
  110. package/lib/plugins/dvr-controls/DvrControls.d.ts +1 -1
  111. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  112. package/lib/plugins/dvr-controls/DvrControls.js +3 -4
  113. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  114. package/lib/plugins/error-screen/ErrorScreen.js +0 -3
  115. package/lib/plugins/favicon/Favicon.d.ts +2 -2
  116. package/lib/plugins/favicon/Favicon.js +1 -1
  117. package/lib/plugins/level-selector/QualityLevels.d.ts +2 -2
  118. package/lib/plugins/level-selector/QualityLevels.d.ts.map +1 -1
  119. package/lib/plugins/level-selector/QualityLevels.js +3 -11
  120. package/lib/plugins/media-control/MediaControl.d.ts +2 -5
  121. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  122. package/lib/plugins/media-control/MediaControl.js +4 -6
  123. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +3 -3
  124. package/lib/plugins/picture-in-picture/PictureInPicture.js +3 -3
  125. package/lib/plugins/playback-rate/PlaybackRate.d.ts +2 -2
  126. package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
  127. package/lib/plugins/playback-rate/PlaybackRate.js +0 -10
  128. package/lib/plugins/poster/Poster.d.ts +2 -2
  129. package/lib/plugins/poster/Poster.d.ts.map +1 -1
  130. package/lib/plugins/poster/Poster.js +3 -19
  131. package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
  132. package/lib/plugins/seek-time/SeekTime.js +1 -6
  133. package/lib/plugins/skip-time/SkipTime.d.ts +1 -1
  134. package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
  135. package/lib/plugins/skip-time/SkipTime.js +3 -15
  136. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  137. package/lib/plugins/source-controller/SourceController.js +0 -5
  138. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  139. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +2 -18
  140. package/lib/plugins/subtitles/ClosedCaptions.d.ts +10 -2
  141. package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
  142. package/lib/plugins/subtitles/ClosedCaptions.js +12 -2
  143. package/lib/plugins/volume-fade/VolumeFade.d.ts +2 -2
  144. package/lib/plugins/volume-fade/VolumeFade.js +1 -1
  145. package/lib/types.d.ts +1 -1
  146. package/package.json +1 -1
  147. package/src/Player.ts +0 -30
  148. package/src/playback/HTML5Video.ts +0 -18
  149. package/src/playback/dash-playback/DashPlayback.ts +0 -11
  150. package/src/playback/hls-playback/HlsPlayback.ts +22 -29
  151. package/src/plugins/big-mute-button/BigMuteButton.ts +1 -4
  152. package/src/plugins/bottom-gear/BottomGear.ts +4 -8
  153. package/src/plugins/clappr-nerd-stats/NerdStats.ts +3 -5
  154. package/src/plugins/clappr-stats/ClapprStats.ts +3 -3
  155. package/src/plugins/clappr-stats/types.ts +5 -5
  156. package/src/plugins/click-to-pause/ClickToPause.ts +3 -8
  157. package/src/plugins/clips/Clips.ts +4 -7
  158. package/src/plugins/cmcd-config/CmcdConfig.ts +2 -2
  159. package/src/plugins/context-menu/ContextMenu.ts +1 -1
  160. package/src/plugins/dvr-controls/DvrControls.ts +3 -4
  161. package/src/plugins/error-screen/ErrorScreen.ts +0 -3
  162. package/src/plugins/favicon/Favicon.ts +2 -2
  163. package/src/plugins/level-selector/QualityLevels.ts +4 -12
  164. package/src/plugins/media-control/MediaControl.ts +4 -10
  165. package/src/plugins/picture-in-picture/PictureInPicture.ts +3 -3
  166. package/src/plugins/playback-rate/PlaybackRate.ts +2 -14
  167. package/src/plugins/poster/Poster.ts +4 -21
  168. package/src/plugins/seek-time/SeekTime.ts +2 -6
  169. package/src/plugins/skip-time/SkipTime.ts +3 -15
  170. package/src/plugins/source-controller/SourceController.ts +0 -5
  171. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +2 -18
  172. package/src/plugins/subtitles/ClosedCaptions.ts +13 -3
  173. package/src/plugins/volume-fade/VolumeFade.ts +2 -2
  174. package/src/types.ts +1 -1
  175. package/temp/player.api.json +157 -152
  176. package/tsconfig.tsbuildinfo +1 -1
  177. package/docs/api/player.mediacontrolpluginsettings.md +0 -13
package/src/Player.ts CHANGED
@@ -159,20 +159,13 @@ export class Player {
159
159
  * ```
160
160
  */
161
161
  attachTo(playerElement: HTMLElement): void {
162
- trace(`${T} attachTo`, {
163
- player: !!this.player,
164
- })
165
162
  assert.ok(!this.player, 'Player already initialized')
166
163
  assert.ok(playerElement, 'Player container element is required')
167
164
  if (this.config.debug === 'all' || this.config.debug === 'clappr') {
168
165
  Log.setLevel(0)
169
166
  }
170
-
171
167
  const coreOpts = this.buildCoreOptions(playerElement)
172
168
  const { core, container } = Player.getRegisteredPlugins()
173
- trace(`${T} init`, {
174
- registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
175
- })
176
169
  coreOpts.plugins = {
177
170
  core: Object.values(core),
178
171
  container: Object.values(container),
@@ -185,9 +178,6 @@ export class Player {
185
178
  * Destroys the player, releasing all resources and unmounting its UI from the DOM.
186
179
  */
187
180
  destroy() {
188
- trace(`${T} destroy`, {
189
- player: !!this.player,
190
- })
191
181
  if (this.player) {
192
182
  this.player.destroy()
193
183
  this.player = null
@@ -398,12 +388,6 @@ export class Player {
398
388
  }
399
389
 
400
390
  private initPlayer(coreOptions: CoreOptions): void {
401
- trace(`${T} initPlayer`, {
402
- autoPlay: coreOptions.autoPlay,
403
- sources: coreOptions.sources,
404
- player: !!this.player,
405
- // TODO selected options
406
- })
407
391
  const player = new PlayerClappr(coreOptions)
408
392
  this.player = player
409
393
  this.bindCoreListeners()
@@ -564,13 +548,6 @@ export class Player {
564
548
  core.on(
565
549
  ClapprEvents.CORE_SCREEN_ORIENTATION_CHANGED,
566
550
  ({ orientation }: { orientation: 'landscape' | 'portrait' }) => {
567
- trace(`${T} on CORE_SCREEN_ORIENTATION_CHANGED`, {
568
- orientation,
569
- rootNode: {
570
- width: this.rootNode?.clientWidth,
571
- height: this.rootNode?.clientHeight,
572
- },
573
- })
574
551
  if (Browser.isiOS && this.rootNode) {
575
552
  core?.resize({
576
553
  width: this.rootNode.clientWidth,
@@ -583,10 +560,6 @@ export class Player {
583
560
  core.on(
584
561
  ClapprEvents.CORE_RESIZE,
585
562
  ({ width, height }: { width: number; height: number }) => {
586
- trace(`${T} on CORE_RESIZE`, {
587
- width,
588
- height,
589
- })
590
563
  this.safeTriggerEvent(PlayerEvent.Resize, { width, height })
591
564
  },
592
565
  null,
@@ -594,9 +567,6 @@ export class Player {
594
567
  core.on(
595
568
  ClapprEvents.CORE_FULLSCREEN,
596
569
  (isFullscreen: boolean) => {
597
- trace(`${T} CORE_FULLSCREEN`, {
598
- isFullscreen,
599
- })
600
570
  this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen)
601
571
  },
602
572
  null,
@@ -18,9 +18,6 @@ export default class HTML5Video extends BasePlayback {
18
18
  * @internal
19
19
  */
20
20
  override createError(errorData: any, options?: ErrorOptions) {
21
- trace(`${T} createError`, {
22
- errorData: { ...errorData },
23
- })
24
21
  const i18n =
25
22
  this.i18n ||
26
23
  // @ts-ignore
@@ -39,12 +36,10 @@ export default class HTML5Video extends BasePlayback {
39
36
  }
40
37
 
41
38
  override _onWaiting() {
42
- trace(`${T} _onWaiting`)
43
39
  super._onWaiting()
44
40
  }
45
41
 
46
42
  override _onEnded() {
47
- trace(`${T} _onEnded`)
48
43
  if (this.stallTimerId) {
49
44
  clearTimeout(this.stallTimerId)
50
45
  this.stallTimerId = null
@@ -53,15 +48,8 @@ export default class HTML5Video extends BasePlayback {
53
48
  }
54
49
 
55
50
  override _handleBufferingEvents() {
56
- trace(`${T} _handleBufferingEvents`, {
57
- networkState: (this.el as HTMLMediaElement).networkState,
58
- })
59
51
  if (!this.stallTimerId) {
60
52
  this.stallTimerId = setTimeout(() => {
61
- trace(`${T} _handleBufferingEvents stall timeout`, {
62
- buffering: this.buffering,
63
- ended: this.ended,
64
- })
65
53
  this.stallTimerId = null
66
54
  const error = this.createError({
67
55
  code: PlaybackErrorCode.MediaSourceUnavailable,
@@ -77,7 +65,6 @@ export default class HTML5Video extends BasePlayback {
77
65
  }
78
66
 
79
67
  override _onPlaying() {
80
- trace(`${T} _onPlaying`)
81
68
  if (this.stallTimerId) {
82
69
  clearTimeout(this.stallTimerId)
83
70
  this.stallTimerId = null
@@ -86,7 +73,6 @@ export default class HTML5Video extends BasePlayback {
86
73
  }
87
74
 
88
75
  override _onPause() {
89
- trace(`${T} _onPause`)
90
76
  super._onPause()
91
77
  if (this.stallTimerId) {
92
78
  clearTimeout(this.stallTimerId)
@@ -97,7 +83,6 @@ export default class HTML5Video extends BasePlayback {
97
83
  get audioTracks(): AudioTrack[] {
98
84
  const tracks = (this.el as HTMLMediaElement).audioTracks
99
85
  const supported = !!tracks
100
- trace(`${T} get audioTracks`, { supported })
101
86
  const retval: AudioTrack[] = []
102
87
  if (supported) {
103
88
  for (let i = 0; i < tracks.length; i++) {
@@ -117,9 +102,6 @@ export default class HTML5Video extends BasePlayback {
117
102
  get currentAudioTrack() {
118
103
  const tracks = (this.el as HTMLMediaElement).audioTracks
119
104
  const supported = !!tracks
120
- trace(`${T} get currentAudioTrack`, {
121
- supported,
122
- })
123
105
  if (supported) {
124
106
  for (let i = 0; i < tracks.length; i++) {
125
107
  const track = tracks[i]
@@ -436,7 +436,6 @@ export default class DashPlayback extends BasePlayback {
436
436
  }
437
437
 
438
438
  private _onDASHJSSError = (event: DashErrorEvent) => {
439
- trace(`${T} _onDASHJSSError`, { event })
440
439
  this._stopTimeUpdateTimer()
441
440
 
442
441
  // Note that the other error types are deprecated
@@ -475,8 +474,6 @@ export default class DashPlayback extends BasePlayback {
475
474
  private triggerError(
476
475
  error: Pick<PlaybackError, 'code' | 'message' | 'description' | 'level'>,
477
476
  ) {
478
- trace(`${T} triggerError`, { error })
479
-
480
477
  // this triggers Events.ERROR to be handled by the UI
481
478
  this.trigger(
482
479
  Events.PLAYBACK_ERROR,
@@ -525,14 +522,8 @@ export default class DashPlayback extends BasePlayback {
525
522
 
526
523
  get dvrEnabled() {
527
524
  if (!this._dash) {
528
- trace(`${T} dvrEnable no dash player instance`)
529
525
  return false
530
526
  }
531
- trace(`${T} get.dvrEnabled`, {
532
- dvrWindowSize: this._dash?.getDVRWindowSize(),
533
- minDvrSize: this._minDvrSize,
534
- playbackType: this.getPlaybackType(),
535
- })
536
527
  return (
537
528
  this._dash?.getDVRWindowSize() >= this._minDvrSize &&
538
529
  this.getPlaybackType() === Playback.LIVE
@@ -556,7 +547,6 @@ export default class DashPlayback extends BasePlayback {
556
547
  }
557
548
 
558
549
  override play() {
559
- trace(`${T} play`, { dash: !!this._dash })
560
550
  !this._dash && this._setup()
561
551
  super.play()
562
552
  this._startTimeUpdateTimer()
@@ -663,7 +653,6 @@ export default class DashPlayback extends BasePlayback {
663
653
 
664
654
  // @ts-expect-error
665
655
  get currentAudioTrack(): AudioTrack | null {
666
- trace(`${T} get currentAudioTrack`)
667
656
  assert.ok(this._dash, 'DASH.js MediaPlayer is not initialized')
668
657
  const t = this._dash.getCurrentTrackFor('audio')
669
658
  if (!t) {
@@ -373,8 +373,6 @@ export default class HlsPlayback extends BasePlayback {
373
373
  },
374
374
  this.options.playback.hlsjsConfig,
375
375
  )
376
- trace(`${T} _createHLSInstance`, { config })
377
-
378
376
  this._hls = new HLSJS(config)
379
377
  }
380
378
 
@@ -450,14 +448,9 @@ export default class HlsPlayback extends BasePlayback {
450
448
  this._hls.on(HLSJS.Events.ERROR, (evt, data) =>
451
449
  this._onHLSJSError(evt, data),
452
450
  )
453
- // this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, (evt, data) => this._onSubtitleLoaded(evt, data));
454
- this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, () =>
455
- this._onSubtitleLoaded(),
456
- )
457
- this._hls.on(
458
- HLSJS.Events.SUBTITLE_TRACKS_UPDATED,
459
- () => (this._ccTracksUpdated = true),
460
- )
451
+ // this._hls.on(HLSJS.Events.SUBTITLE_TRACK_LOADED, () =>
452
+ // this._onSubtitleLoaded(),
453
+ // )
461
454
  this._hls.on(HlsEvents.AUDIO_TRACKS_UPDATED, (evt, data) =>
462
455
  this._onAudioTracksUpdated(evt, data),
463
456
  )
@@ -863,13 +856,13 @@ export default class HlsPlayback extends BasePlayback {
863
856
  ) as PlaybackType
864
857
  this._onLevelUpdated(evt, data)
865
858
  // Live stream subtitle tracks detection hack (may not immediately available)
866
- if (
867
- this._ccTracksUpdated &&
868
- this._playbackType === Playback.LIVE &&
869
- this.hasClosedCaptionsTracks
870
- ) {
871
- this._onSubtitleLoaded()
872
- }
859
+ // if (
860
+ // this._ccTracksUpdated &&
861
+ // this._playbackType === Playback.LIVE &&
862
+ // this.hasClosedCaptionsTracks
863
+ // ) {
864
+ // this._onSubtitleLoaded()
865
+ // }
873
866
  if (prevPlaybackType !== this._playbackType) {
874
867
  this._updateSettings()
875
868
  }
@@ -1044,18 +1037,19 @@ export default class HlsPlayback extends BasePlayback {
1044
1037
  this.trigger(Events.PLAYBACK_FRAGMENT_LOADED, data)
1045
1038
  }
1046
1039
 
1047
- _onSubtitleLoaded() {
1048
- // This event may be triggered multiple times
1049
- // Setup CC only once (disable CC by default)
1050
- if (!this._ccIsSetup) {
1051
- this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)
1052
- const trackId =
1053
- this._playbackType === Playback.LIVE ? -1 : this.closedCaptionsTrackId
1040
+ // _onSubtitleLoaded() {
1041
+ // trace(`${T} _onSubtitleLoaded`)
1042
+ // // This event may be triggered multiple times
1043
+ // // Setup CC only once (disable CC by default)
1044
+ // if (!this._ccIsSetup) {
1045
+ // this.trigger(Events.PLAYBACK_SUBTITLE_AVAILABLE)
1046
+ // const trackId =
1047
+ // this._playbackType === Playback.LIVE ? -1 : this.closedCaptionsTrackId
1054
1048
 
1055
- this.closedCaptionsTrackId = trackId
1056
- this._ccIsSetup = true
1057
- }
1058
- }
1049
+ // this.closedCaptionsTrackId = trackId
1050
+ // this._ccIsSetup = true
1051
+ // }
1052
+ // }
1059
1053
 
1060
1054
  _onLevelSwitch(evt: HlsEvents.LEVEL_SWITCHING, data: LevelSwitchingData) {
1061
1055
  if (!this.levels.length) {
@@ -1138,7 +1132,6 @@ export default class HlsPlayback extends BasePlayback {
1138
1132
  _: HlsEvents.AUDIO_TRACKS_UPDATED,
1139
1133
  data: AudioTracksUpdatedData,
1140
1134
  ) {
1141
- trace(`${T} onAudioTracksUpdated`)
1142
1135
  this.trigger(
1143
1136
  Events.PLAYBACK_AUDIO_AVAILABLE,
1144
1137
  data.audioTracks.map(toClapprTrack),
@@ -1,6 +1,5 @@
1
1
  import { Events, template, UICorePlugin, Utils } from '@clappr/core'
2
2
  import { trace } from '@gcorevideo/utils'
3
- import assert from 'assert'
4
3
 
5
4
  import { CLAPPR_VERSION } from '../../build.js'
6
5
 
@@ -14,7 +13,7 @@ const T = 'plugins.big_mute_button'
14
13
 
15
14
  /**
16
15
  * `PLUGIN` that displays a big mute button over the video when it's being played muted.
17
- * @beta
16
+ * @public
18
17
  * @remarks
19
18
  * When pressed, it unmutes the video.
20
19
  * @example
@@ -142,7 +141,6 @@ export class BigMuteButton extends UICorePlugin {
142
141
  * @internal
143
142
  */
144
143
  override render() {
145
- trace(`${T} render`)
146
144
  this.$el.html(BigMuteButton.template())
147
145
  this.$el.find('#gplayer-big-mute-icon').append(volumeMuteIcon)
148
146
 
@@ -168,7 +166,6 @@ export class BigMuteButton extends UICorePlugin {
168
166
  }
169
167
 
170
168
  private clicked(e: MouseEvent) {
171
- trace(`${T} clicked`)
172
169
  const mediaControl = this.core.getPlugin('media_control')
173
170
  // TODO delegate to media_control plugin
174
171
  const localVolume = Utils.Config.restore('volume')
@@ -5,7 +5,7 @@ import {
5
5
  $,
6
6
  Container,
7
7
  } from '@clappr/core'
8
- import { trace } from '@gcorevideo/utils'
8
+ // import { trace } from '@gcorevideo/utils'
9
9
  import assert from 'assert'
10
10
 
11
11
  import { CLAPPR_VERSION } from '../../build.js'
@@ -20,14 +20,13 @@ import { ExtendedEvents } from '../media-control/MediaControl.js'
20
20
 
21
21
  const VERSION = '2.19.12'
22
22
 
23
- const T = 'plugins.bottom_gear'
23
+ // const T = 'plugins.bottom_gear'
24
24
 
25
- const MENU_VMARGIN = 12
26
25
  const MENU_BACKLINK_HEIGHT = 44
27
26
 
28
27
  /**
29
28
  * Events triggered by the plugin
30
- * @beta
29
+ * @public
31
30
  */
32
31
  export enum GearEvents {
33
32
  /**
@@ -38,7 +37,7 @@ export enum GearEvents {
38
37
 
39
38
  /**
40
39
  * `PLUGIN` that adds a button to extend the media controls UI with extra options.
41
- * @beta
40
+ * @public
42
41
  * @remarks
43
42
  * The plugin renders small gear icon to the right of the media controls.
44
43
  * It provides a base for attaching custom settings UI in the gear menu
@@ -184,14 +183,12 @@ export class BottomGear extends UICorePlugin {
184
183
  addItem(name: string, $subMenu?: ZeptoResult): ZeptoResult {
185
184
  const $existingItem = this.$el.find(`#gear-options li[data-${name}]`)
186
185
  if ($existingItem.length) {
187
- trace(`${T} addItem already exists`, { name })
188
186
  return $existingItem
189
187
  }
190
188
  const $item = $('<li></li>')
191
189
  .attr(`data-${name}`, '')
192
190
  .appendTo(this.$el.find('#gear-options'))
193
191
  if ($subMenu) {
194
- trace(`${T} addItem adding submenu`, { name })
195
192
  $subMenu
196
193
  .addClass('gear-sub-menu-wrapper')
197
194
  .hide()
@@ -220,7 +217,6 @@ export class BottomGear extends UICorePlugin {
220
217
  }
221
218
 
222
219
  private highDefinitionUpdate(isHd: boolean) {
223
- trace(`${T} highDefinitionUpdate`, { isHd })
224
220
  this.hd = isHd
225
221
  this.$el.find('#gear-button').html(isHd ? gearHdIcon : gearIcon)
226
222
  }
@@ -6,7 +6,7 @@ import {
6
6
  Container,
7
7
  Playback,
8
8
  } from '@clappr/core'
9
- import { reportError, trace } from '@gcorevideo/utils'
9
+ import { reportError/* , trace */ } from '@gcorevideo/utils'
10
10
  import Mousetrap from 'mousetrap'
11
11
  import assert from 'assert'
12
12
 
@@ -59,11 +59,11 @@ type Metrics = PerfMetrics & {
59
59
  }
60
60
  }
61
61
 
62
- const T = 'plugins.nerd_stats'
62
+ // const T = 'plugins.nerd_stats'
63
63
 
64
64
  /**
65
65
  * `PLUGIN` that displays useful statistics regarding the playback as well as the network quality estimation.
66
- * @beta
66
+ * @public
67
67
  *
68
68
  * @remarks
69
69
  * Depends on:
@@ -446,7 +446,6 @@ export class NerdStats extends UICorePlugin {
446
446
  }
447
447
 
448
448
  private attach() {
449
- trace(`${T} attach`)
450
449
  const gear = this.core.getPlugin('bottom_gear') as BottomGear
451
450
  gear
452
451
  .addItem('nerd_stats')
@@ -463,7 +462,6 @@ export class NerdStats extends UICorePlugin {
463
462
  }
464
463
 
465
464
  private clearSpeedtestMetrics() {
466
- trace(`${T} clearSpeedtestMetrics`);
467
465
  const clapprStats = this.container?.getPlugin('clappr_stats')
468
466
 
469
467
  this.speedtestMetrics.connectionSpeed = 0
@@ -22,7 +22,7 @@ import { isFullscreen } from '../utils/fullscreen.js'
22
22
 
23
23
  /**
24
24
  * Config options for the {@link ClapprStats} plugin
25
- * @beta
25
+ * @public
26
26
  */
27
27
  export interface ClapprStatsSettings {
28
28
  /**
@@ -34,7 +34,7 @@ export interface ClapprStatsSettings {
34
34
 
35
35
  /**
36
36
  * `PLUGIN` that measures data about playback, which can be useful for analyzing performance and UX.
37
- * @beta
37
+ * @public
38
38
  * @remarks
39
39
  * This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
40
40
  *
@@ -175,7 +175,7 @@ export class ClapprStats extends ContainerPlugin {
175
175
 
176
176
  /**
177
177
  * Returns the collected metrics.
178
- * @returns Measurements collected so far
178
+ * @returns {@link ClapprStatsMetrics | Measurements} collected so far
179
179
  */
180
180
  exportMetrics() {
181
181
  return structuredClone(this.metrics)
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @beta
2
+ * @public
3
3
  */
4
4
  export enum ClapprStatsChronograph {
5
5
  Startup = 'startup',
@@ -11,7 +11,7 @@ export enum ClapprStatsChronograph {
11
11
  }
12
12
 
13
13
  /**
14
- * @beta
14
+ * @public
15
15
  */
16
16
  export enum ClapprStatsCounter {
17
17
  Play = 'play',
@@ -28,7 +28,7 @@ export enum ClapprStatsCounter {
28
28
  }
29
29
 
30
30
  /**
31
- * @beta
31
+ * @public
32
32
  */
33
33
  export type ClapprStatsMetrics = {
34
34
  /**
@@ -87,7 +87,7 @@ export type ClapprStatsMetrics = {
87
87
  }
88
88
 
89
89
  /**
90
- * @beta
90
+ * @public
91
91
  */
92
92
  export type ClapprStatsBitrateTrack = {
93
93
  start: number
@@ -97,7 +97,7 @@ export type ClapprStatsBitrateTrack = {
97
97
  }
98
98
 
99
99
  /**
100
- * @beta
100
+ * @public
101
101
  */
102
102
  export enum ClapprStatsEvents {
103
103
  /**
@@ -4,17 +4,17 @@
4
4
  // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
5
5
 
6
6
  import { ContainerPlugin, Events, Playback } from '@clappr/core'
7
- import { trace } from '@gcorevideo/utils'
7
+ // import { trace } from '@gcorevideo/utils'
8
8
 
9
9
  import { CLAPPR_VERSION } from '../../build.js'
10
10
 
11
11
  type Timer = ReturnType<typeof setTimeout>
12
12
 
13
- const T = 'plugins.click_to_pause'
13
+ // const T = 'plugins.click_to_pause'
14
14
 
15
15
  /**
16
16
  * A small `PLUGIN` that toggles the playback state on click over the video container
17
- * @beta
17
+ * @public
18
18
  */
19
19
  export class ClickToPause extends ContainerPlugin {
20
20
  private pointerEnabled = false
@@ -51,11 +51,6 @@ export class ClickToPause extends ContainerPlugin {
51
51
  const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE
52
52
  const isDvrEnabled = this.container.isDvrEnabled()
53
53
 
54
- trace(`${T} click`, {
55
- isLivePlayback,
56
- isDvrEnabled,
57
- })
58
-
59
54
  if (isLivePlayback && !isDvrEnabled) {
60
55
  this.togglePlay(true)
61
56
  return
@@ -1,5 +1,5 @@
1
1
  import { Container, Events, UICorePlugin, $, template } from '@clappr/core'
2
- import { trace } from '@gcorevideo/utils'
2
+ // import { trace } from '@gcorevideo/utils'
3
3
  import assert from 'assert'
4
4
 
5
5
  import { TimeProgress, TimeValue } from '../../playback.types.js'
@@ -9,11 +9,11 @@ import { ClipDesc } from './types.js'
9
9
  import { buildSvg, parseClips } from './utils.js'
10
10
  import clipsHTML from '../../../assets/clips/clips.ejs'
11
11
 
12
- const T = 'plugins.clips'
12
+ // const T = 'plugins.clips'
13
13
 
14
14
  /**
15
15
  * Configuration options for the {@link Clips} plugin.
16
- * @beta
16
+ * @public
17
17
  */
18
18
  export interface ClipsPluginSettings {
19
19
  /**
@@ -30,7 +30,7 @@ const COMPACT_WIDTH = 495
30
30
 
31
31
  /**
32
32
  * `PLUGIN` that allows marking up the timeline of the video
33
- * @beta
33
+ * @public
34
34
  * @remarks
35
35
  * The plugin decorates the seekbar with notches to indicate the clips of the video and displays current clip text in the left panel
36
36
  *
@@ -129,7 +129,6 @@ export class Clips extends UICorePlugin {
129
129
  }
130
130
 
131
131
  private onCoreReady() {
132
- trace(`${T} onCoreReady`)
133
132
  const mediaControl = this.core.getPlugin('media_control')
134
133
  assert(mediaControl, 'media_control plugin is required')
135
134
 
@@ -138,12 +137,10 @@ export class Clips extends UICorePlugin {
138
137
  }
139
138
 
140
139
  private onMcRender() {
141
- trace(`${T} onMcRender`)
142
140
  this.core.getPlugin('media_control')?.slot('clips', this.$el)
143
141
  }
144
142
 
145
143
  private onContainerChanged() {
146
- trace(`${T} onContainerChanged`)
147
144
  // TODO figure out the conditions of changing the container (without destroying the previous one)
148
145
  // probably it is the case with the MultiCamera plugin
149
146
  if (this.oldContainer) {
@@ -28,7 +28,7 @@ const CMCD_KEYS = [
28
28
 
29
29
  /**
30
30
  * Config options for the {@link CmcdConfig} plugin
31
- * @beta
31
+ * @public
32
32
  */
33
33
  export interface CmcdConfigOptions {
34
34
  /**
@@ -46,7 +46,7 @@ export interface CmcdConfigOptions {
46
46
 
47
47
  /**
48
48
  * A `PLUGIN` that configures {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf | CMCD} for playback
49
- * @beta
49
+ * @public
50
50
  * @remarks
51
51
  * Configuration options - {@link CmcdConfigOptions}.
52
52
  * @example
@@ -6,7 +6,7 @@ import '../../../assets/context-menu/context_menu.scss'
6
6
  import templateHtml from '../../../assets/context-menu/context_menu.ejs'
7
7
 
8
8
  /**
9
- * @beta
9
+ * @public
10
10
  */
11
11
  export type MenuOption = {
12
12
  /**
@@ -1,6 +1,6 @@
1
1
  import { Events, Playback, UICorePlugin, template } from '@clappr/core'
2
2
  import assert from 'assert'
3
- import { trace } from '@gcorevideo/utils'
3
+ // import { trace } from '@gcorevideo/utils'
4
4
 
5
5
  import { CLAPPR_VERSION } from '../../build.js'
6
6
 
@@ -8,12 +8,12 @@ import dvrHTML from '../../../assets/dvr-controls/index.ejs'
8
8
  import '../../../assets/dvr-controls/dvr_controls.scss'
9
9
  import { MediaControl } from '../media-control/MediaControl.js'
10
10
 
11
- const T = 'plugins.dvr_controls'
11
+ // const T = 'plugins.dvr_controls'
12
12
 
13
13
  /**
14
14
  * `PLUGIN` that adds the DVR controls to the media control UI
15
15
  *
16
- * @beta
16
+ * @public
17
17
  *
18
18
  * @remarks
19
19
  * Depends on:
@@ -104,7 +104,6 @@ export class DvrControls extends UICorePlugin {
104
104
  * @internal
105
105
  */
106
106
  override render() {
107
- trace(`${T} render`)
108
107
  this.$el.html(
109
108
  DvrControls.template({
110
109
  i18n: this.core.i18n,
@@ -131,9 +131,6 @@ export class ErrorScreen extends UICorePlugin {
131
131
  }
132
132
 
133
133
  private onActiveContainerChanged() {
134
- trace(`${T} onActiveContainerChanged`, {
135
- reloading: this.core.options.reloading,
136
- })
137
134
  this.err = null
138
135
  this.listenTo(
139
136
  this.core.activeContainer.playback,
@@ -11,7 +11,7 @@ const FAVICON_COLOR = '#567';
11
11
  const FAVICON_SELECTOR = 'link[rel="shortcut icon"]';
12
12
 
13
13
  /**
14
- * @beta
14
+ * @public
15
15
  */
16
16
  export interface FaviconPluginSettings {
17
17
  /**
@@ -22,7 +22,7 @@ export interface FaviconPluginSettings {
22
22
 
23
23
  /**
24
24
  * `PLUGIN` that changes the favicon according to the player's state.
25
- * @beta
25
+ * @public
26
26
  * @remarks
27
27
  * There are three states: stopped, playing and paused.
28
28
  */