@gcorevideo/player 2.20.1 → 2.20.3

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 (262) hide show
  1. package/dist/core.js +1 -1
  2. package/dist/index.css +1328 -1328
  3. package/dist/index.js +305 -217
  4. package/dist/player.d.ts +270 -52
  5. package/dist/plugins/index.css +612 -612
  6. package/dist/plugins/index.js +1459 -1347
  7. package/docs/api/player.audioselector.md +1 -251
  8. package/docs/api/player.bigmutebutton.md +1 -156
  9. package/docs/api/player.clapprstats.exportmetrics.md +4 -0
  10. package/docs/api/player.clapprstats.md +7 -223
  11. package/docs/api/player.clapprstats.setupdatemetrics.md +2 -0
  12. package/docs/api/player.clicktopause.md +5 -113
  13. package/docs/api/player.clipsplugin.gettext.md +9 -0
  14. package/docs/api/player.clipsplugin.md +10 -94
  15. package/docs/api/player.clipspluginsettings.md +57 -0
  16. package/docs/api/player.clipspluginsettings.text.md +13 -0
  17. package/docs/api/player.contextmenu._constructor_.md +6 -3
  18. package/docs/api/player.contextmenu.md +13 -256
  19. package/docs/api/player.contextmenupluginsettings.label.md +11 -0
  20. package/docs/api/player.contextmenupluginsettings.md +93 -0
  21. package/docs/api/player.contextmenupluginsettings.preventshowcontextmenu.md +11 -0
  22. package/docs/api/player.contextmenupluginsettings.url.md +11 -0
  23. package/docs/api/player.dvrcontrols.md +1 -1
  24. package/docs/api/player.errorscreen.md +0 -2
  25. package/docs/api/player.favicon._constructor_.md +3 -0
  26. package/docs/api/player.favicon.bindevents.md +3 -0
  27. package/docs/api/player.favicon.configure.md +3 -0
  28. package/docs/api/player.favicon.destroy.md +3 -0
  29. package/docs/api/player.favicon.disable.md +3 -0
  30. package/docs/api/player.favicon.md +18 -1
  31. package/docs/api/player.favicon.name.md +3 -0
  32. package/docs/api/player.favicon.supportedversion.md +3 -0
  33. package/docs/api/player.gearevents.md +4 -1
  34. package/docs/api/player.googleanalytics._constructor_.md +3 -0
  35. package/docs/api/player.googleanalytics.addeventlisteners.md +3 -0
  36. package/docs/api/player.googleanalytics.embedscript.md +3 -0
  37. package/docs/api/player.googleanalytics.md +42 -1
  38. package/docs/api/player.googleanalytics.name.md +3 -0
  39. package/docs/api/player.googleanalytics.onbufferfull.md +3 -0
  40. package/docs/api/player.googleanalytics.onbuffering.md +3 -0
  41. package/docs/api/player.googleanalytics.ondvr.md +3 -0
  42. package/docs/api/player.googleanalytics.onended.md +3 -0
  43. package/docs/api/player.googleanalytics.onerror.md +3 -0
  44. package/docs/api/player.googleanalytics.onfullscreen.md +3 -0
  45. package/docs/api/player.googleanalytics.onhd.md +3 -0
  46. package/docs/api/player.googleanalytics.onpause.md +3 -0
  47. package/docs/api/player.googleanalytics.onplay.md +3 -0
  48. package/docs/api/player.googleanalytics.onready.md +3 -0
  49. package/docs/api/player.googleanalytics.onseek.md +3 -0
  50. package/docs/api/player.googleanalytics.onstop.md +3 -0
  51. package/docs/api/player.googleanalytics.onvolumechanged.md +3 -0
  52. package/docs/api/player.googleanalytics.push.md +3 -0
  53. package/docs/api/player.googleanalytics.supportedversion.md +3 -0
  54. package/docs/api/player.initeventdata.event.md +3 -0
  55. package/docs/api/player.initeventdata.md +7 -0
  56. package/docs/api/player.logo._constructor_.md +3 -0
  57. package/docs/api/player.logo.attributes.md +3 -0
  58. package/docs/api/player.logo.bindevents.md +3 -0
  59. package/docs/api/player.logo.md +20 -1
  60. package/docs/api/player.logo.name.md +3 -0
  61. package/docs/api/player.logo.render.md +3 -0
  62. package/docs/api/player.logo.stoplistening.md +3 -0
  63. package/docs/api/player.logo.supportedversion.md +3 -0
  64. package/docs/api/player.logo.template.md +3 -0
  65. package/docs/api/player.md +68 -20
  66. package/docs/api/player.mediacontrolelement.md +1 -1
  67. package/docs/api/player.multicamera.md +2 -0
  68. package/docs/api/player.seektime.attributes.md +3 -0
  69. package/docs/api/player.seektime.bindevents.md +3 -0
  70. package/docs/api/player.seektime.durationshown.md +3 -0
  71. package/docs/api/player.seektime.getseektime.md +3 -0
  72. package/docs/api/player.seektime.islivestreamwithdvr.md +3 -0
  73. package/docs/api/player.seektime.md +31 -0
  74. package/docs/api/player.seektime.mediacontrol.md +3 -0
  75. package/docs/api/player.seektime.mediacontrolcontainer.md +3 -0
  76. package/docs/api/player.seektime.name.md +3 -0
  77. package/docs/api/player.seektime.render.md +3 -0
  78. package/docs/api/player.seektime.shouldbevisible.md +3 -0
  79. package/docs/api/player.seektime.supportedversion.md +3 -0
  80. package/docs/api/player.seektime.template.md +3 -0
  81. package/docs/api/player.seektime.update.md +3 -0
  82. package/docs/api/player.share.md +2 -0
  83. package/docs/api/player.skiptime.md +2 -0
  84. package/docs/api/player.stalleventdata.count.md +3 -0
  85. package/docs/api/player.stalleventdata.event.md +3 -0
  86. package/docs/api/player.stalleventdata.md +8 -3
  87. package/docs/api/player.stalleventdata.time.md +3 -0
  88. package/docs/api/player.stalleventdata.total_ms.md +3 -0
  89. package/docs/api/player.starteventdata.event.md +3 -0
  90. package/docs/api/player.starteventdata.md +7 -0
  91. package/docs/api/player.telemetryevent.md +11 -0
  92. package/docs/api/player.telemetryeventdata.md +3 -0
  93. package/docs/api/player.telemetrypluginsettings.md +4 -1
  94. package/docs/api/player.telemetrypluginsettings.send.md +3 -0
  95. package/docs/api/player.telemetryrecord.md +3 -0
  96. package/docs/api/player.thumbnails.md +21 -139
  97. package/docs/api/player.thumbnailspluginsettings.md +23 -0
  98. package/docs/api/player.volumefade.md +1 -0
  99. package/docs/api/player.watcheventdata.event.md +3 -0
  100. package/docs/api/player.watcheventdata.md +7 -0
  101. package/lib/index.plugins.d.ts +0 -1
  102. package/lib/index.plugins.d.ts.map +1 -1
  103. package/lib/index.plugins.js +0 -1
  104. package/lib/plugins/audio-selector/AudioSelector.d.ts +28 -6
  105. package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
  106. package/lib/plugins/audio-selector/AudioSelector.js +52 -22
  107. package/lib/plugins/big-mute-button/BigMuteButton.d.ts +18 -2
  108. package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
  109. package/lib/plugins/big-mute-button/BigMuteButton.js +21 -16
  110. package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -0
  111. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  112. package/lib/plugins/bottom-gear/BottomGear.js +1 -0
  113. package/lib/plugins/clappr-stats/ClapprStats.d.ts +31 -8
  114. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
  115. package/lib/plugins/clappr-stats/ClapprStats.js +24 -0
  116. package/lib/plugins/clappr-stats/types.d.ts +12 -0
  117. package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
  118. package/lib/plugins/clappr-stats/types.js +3 -0
  119. package/lib/plugins/click-to-pause/ClickToPause.d.ts +13 -1
  120. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  121. package/lib/plugins/click-to-pause/ClickToPause.js +14 -4
  122. package/lib/plugins/clips/Clips.d.ts +34 -2
  123. package/lib/plugins/clips/Clips.d.ts.map +1 -1
  124. package/lib/plugins/clips/Clips.js +51 -22
  125. package/lib/plugins/context-menu/ContextMenu.d.ts +40 -13
  126. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
  127. package/lib/plugins/context-menu/ContextMenu.js +48 -36
  128. package/lib/plugins/dvr-controls/DvrControls.d.ts +1 -3
  129. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  130. package/lib/plugins/dvr-controls/DvrControls.js +11 -28
  131. package/lib/plugins/error-screen/ErrorScreen.d.ts +0 -1
  132. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  133. package/lib/plugins/error-screen/ErrorScreen.js +0 -1
  134. package/lib/plugins/favicon/Favicon.d.ts +4 -0
  135. package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
  136. package/lib/plugins/favicon/Favicon.js +4 -0
  137. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +4 -0
  138. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -1
  139. package/lib/plugins/google-analytics/GoogleAnalytics.js +5 -1
  140. package/lib/plugins/index.d.ts +0 -1
  141. package/lib/plugins/index.d.ts.map +1 -1
  142. package/lib/plugins/index.js +0 -1
  143. package/lib/plugins/logo/Logo.d.ts +4 -0
  144. package/lib/plugins/logo/Logo.d.ts.map +1 -1
  145. package/lib/plugins/logo/Logo.js +4 -0
  146. package/lib/plugins/media-control/MediaControl.d.ts +1 -1
  147. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  148. package/lib/plugins/media-control/MediaControl.js +3 -1
  149. package/lib/plugins/multi-camera/MultiCamera.d.ts +3 -0
  150. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
  151. package/lib/plugins/multi-camera/MultiCamera.js +3 -0
  152. package/lib/plugins/seek-time/SeekTime.d.ts +4 -0
  153. package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
  154. package/lib/plugins/seek-time/SeekTime.js +5 -1
  155. package/lib/plugins/share/Share.d.ts +3 -0
  156. package/lib/plugins/share/Share.d.ts.map +1 -1
  157. package/lib/plugins/share/Share.js +3 -0
  158. package/lib/plugins/skip-time/SkipTime.d.ts +3 -0
  159. package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
  160. package/lib/plugins/skip-time/SkipTime.js +3 -0
  161. package/lib/plugins/telemetry/Telemetry.d.ts +18 -0
  162. package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -1
  163. package/lib/plugins/telemetry/Telemetry.js +1 -0
  164. package/lib/plugins/thumbnails/Thumbnails.d.ts +48 -3
  165. package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -1
  166. package/lib/plugins/thumbnails/Thumbnails.js +52 -18
  167. package/lib/plugins/volume-fade/VolumeFade.d.ts +1 -0
  168. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  169. package/lib/plugins/volume-fade/VolumeFade.js +1 -0
  170. package/package.json +1 -1
  171. package/src/index.plugins.ts +0 -1
  172. package/src/plugins/audio-selector/AudioSelector.ts +227 -154
  173. package/src/plugins/big-mute-button/BigMuteButton.ts +100 -79
  174. package/src/plugins/bottom-gear/BottomGear.ts +1 -0
  175. package/src/plugins/clappr-stats/ClapprStats.ts +32 -8
  176. package/src/plugins/clappr-stats/types.ts +13 -0
  177. package/src/plugins/click-to-pause/ClickToPause.ts +47 -36
  178. package/src/plugins/clips/Clips.ts +127 -71
  179. package/src/plugins/context-menu/ContextMenu.ts +105 -76
  180. package/src/plugins/dvr-controls/DvrControls.ts +11 -30
  181. package/src/plugins/error-screen/ErrorScreen.ts +0 -1
  182. package/src/plugins/favicon/Favicon.ts +4 -0
  183. package/src/plugins/google-analytics/GoogleAnalytics.ts +5 -1
  184. package/src/plugins/index.ts +0 -1
  185. package/src/plugins/logo/Logo.ts +4 -0
  186. package/src/plugins/media-control/MediaControl.ts +4 -1
  187. package/src/plugins/multi-camera/MultiCamera.ts +3 -0
  188. package/src/plugins/seek-time/SeekTime.ts +5 -1
  189. package/src/plugins/share/Share.ts +3 -0
  190. package/src/plugins/skip-time/SkipTime.ts +3 -0
  191. package/src/plugins/telemetry/Telemetry.ts +18 -0
  192. package/src/plugins/thumbnails/Thumbnails.ts +268 -194
  193. package/src/plugins/volume-fade/VolumeFade.ts +1 -0
  194. package/temp/player.api.json +622 -2463
  195. package/tsconfig.tsbuildinfo +1 -1
  196. package/docs/api/player.audioselector.attributes.md +0 -17
  197. package/docs/api/player.audioselector.bindevents.md +0 -18
  198. package/docs/api/player.audioselector.events.md +0 -17
  199. package/docs/api/player.audioselector.hideselecttrackmenu.md +0 -18
  200. package/docs/api/player.audioselector.name.md +0 -14
  201. package/docs/api/player.audioselector.onshowlevelselectmenu.md +0 -18
  202. package/docs/api/player.audioselector.reload.md +0 -18
  203. package/docs/api/player.audioselector.render.md +0 -18
  204. package/docs/api/player.audioselector.supportedversion.md +0 -16
  205. package/docs/api/player.audioselector.template.md +0 -14
  206. package/docs/api/player.audioselector.togglecontextmenu.md +0 -18
  207. package/docs/api/player.audioselector.unbindevents.md +0 -18
  208. package/docs/api/player.audioselector.version.md +0 -14
  209. package/docs/api/player.bigmutebutton.bindevents.md +0 -18
  210. package/docs/api/player.bigmutebutton.events.md +0 -17
  211. package/docs/api/player.bigmutebutton.name.md +0 -14
  212. package/docs/api/player.bigmutebutton.render.md +0 -18
  213. package/docs/api/player.bigmutebutton.supportedversion.md +0 -16
  214. package/docs/api/player.bigmutebutton.template.md +0 -14
  215. package/docs/api/player.clapprstats._buildreport.md +0 -18
  216. package/docs/api/player.clapprstats._defaultreport.md +0 -52
  217. package/docs/api/player.clapprstats._playbackname.md +0 -14
  218. package/docs/api/player.clapprstats._playbacktype.md +0 -14
  219. package/docs/api/player.clapprstats.bindevents.md +0 -18
  220. package/docs/api/player.clapprstats.destroy.md +0 -18
  221. package/docs/api/player.clapprstats.name.md +0 -14
  222. package/docs/api/player.clapprstats.onfirstplaying.md +0 -18
  223. package/docs/api/player.clapprstats.playafterpause.md +0 -18
  224. package/docs/api/player.clapprstats.starttimers.md +0 -18
  225. package/docs/api/player.clapprstats.stopreporting.md +0 -18
  226. package/docs/api/player.clapprstats.supportedversion.md +0 -16
  227. package/docs/api/player.clicktopause.bindevents.md +0 -15
  228. package/docs/api/player.clicktopause.config.md +0 -11
  229. package/docs/api/player.clicktopause.name.md +0 -11
  230. package/docs/api/player.clicktopause.supportedversion.md +0 -13
  231. package/docs/api/player.clipsplugin.attributes.md +0 -13
  232. package/docs/api/player.clipsplugin.bindevents.md +0 -15
  233. package/docs/api/player.clipsplugin.makesvg.md +0 -49
  234. package/docs/api/player.clipsplugin.name.md +0 -11
  235. package/docs/api/player.clipsplugin.unbindevents.md +0 -15
  236. package/docs/api/player.contextmenu.attributes.md +0 -13
  237. package/docs/api/player.contextmenu.bindevents.md +0 -15
  238. package/docs/api/player.contextmenu.destroy.md +0 -15
  239. package/docs/api/player.contextmenu.events.md +0 -13
  240. package/docs/api/player.contextmenu.exposeversion.md +0 -14
  241. package/docs/api/player.contextmenu.label.md +0 -11
  242. package/docs/api/player.contextmenu.mediacontrol.md +0 -11
  243. package/docs/api/player.contextmenu.name.md +0 -11
  244. package/docs/api/player.contextmenu.render.md +0 -15
  245. package/docs/api/player.contextmenu.supportedversion.md +0 -13
  246. package/docs/api/player.contextmenu.template.md +0 -11
  247. package/docs/api/player.contextmenu.url.md +0 -11
  248. package/docs/api/player.disablecontrols.bindevents.md +0 -15
  249. package/docs/api/player.disablecontrols.container.md +0 -11
  250. package/docs/api/player.disablecontrols.md +0 -138
  251. package/docs/api/player.disablecontrols.name.md +0 -11
  252. package/docs/api/player.disablecontrols.supportedversion.md +0 -13
  253. package/docs/api/player.disablecontrols.unbindevents.md +0 -15
  254. package/docs/api/player.thumbnails.attributes.md +0 -13
  255. package/docs/api/player.thumbnails.bindevents.md +0 -15
  256. package/docs/api/player.thumbnails.name.md +0 -11
  257. package/docs/api/player.thumbnails.settext.md +0 -49
  258. package/docs/api/player.thumbnails.supportedversion.md +0 -13
  259. package/docs/api/player.thumbnails.template.md +0 -11
  260. package/src/plugins/disable-controls/DisableControls.ts +0 -81
  261. package/src/plugins/ga-events/GaEvents.js +0 -395
  262. package/src/plugins/ga-events/ga-tracking.js +0 -46
package/dist/index.js CHANGED
@@ -42835,7 +42835,7 @@ class Player {
42835
42835
  }
42836
42836
  }
42837
42837
 
42838
- var version$1 = "2.20.1";
42838
+ var version$1 = "2.20.3";
42839
42839
 
42840
42840
  var packages = {
42841
42841
  "node_modules/@clappr/core": {
@@ -42867,38 +42867,57 @@ const VERSION$6 = '0.0.1';
42867
42867
  // const T = 'plugins.audio_selector';
42868
42868
  const AUTO = 0;
42869
42869
  /**
42870
+ * Adds an audio track selector to the media control UI.
42870
42871
  * @beta
42871
42872
  */
42872
42873
  class AudioSelector extends UICorePlugin {
42874
+ // TODO
42873
42875
  selectedTrackId;
42874
42876
  currentTrack = null;
42875
42877
  tracks = [];
42878
+ /**
42879
+ * @internal
42880
+ */
42876
42881
  get name() {
42877
- return 'media_control_audio_selector';
42882
+ return 'audio_selector';
42878
42883
  }
42884
+ /**
42885
+ * @internal
42886
+ */
42879
42887
  get supportedVersion() {
42880
42888
  return { min: CLAPPR_VERSION };
42881
42889
  }
42890
+ /**
42891
+ * @internal
42892
+ */
42882
42893
  static get version() {
42883
42894
  return VERSION$6;
42884
42895
  }
42885
- get template() {
42886
- return tmpl(pluginHtml$8);
42887
- }
42896
+ static template = tmpl(pluginHtml$8);
42897
+ /**
42898
+ * @internal
42899
+ */
42888
42900
  get attributes() {
42889
42901
  return {
42890
- 'class': this.name,
42891
- 'data-track-selector': ''
42902
+ class: this.name,
42903
+ 'data-track-selector': '',
42892
42904
  };
42893
42905
  }
42906
+ /**
42907
+ * @internal
42908
+ */
42894
42909
  get events() {
42895
42910
  return {
42896
42911
  'click [data-track-selector-select]': 'onTrackSelect',
42897
- 'click [data-track-selector-button]': 'onShowLevelSelectMenu'
42912
+ 'click [data-track-selector-button]': 'onShowLevelSelectMenu',
42898
42913
  };
42899
42914
  }
42915
+ /**
42916
+ * @internal
42917
+ */
42900
42918
  bindEvents() {
42901
42919
  this.listenTo(this.core, Events$1.CORE_READY, this.bindPlaybackEvents);
42920
+ // TODO CORE_ACTIVE_CONTAINER_CHANGED
42902
42921
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.reload);
42903
42922
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
42904
42923
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_HIDE, this.hideSelectTrackMenu);
@@ -42939,12 +42958,12 @@ class AudioSelector extends UICorePlugin {
42939
42958
  if (defaultTrack) {
42940
42959
  this.currentTrack = {
42941
42960
  id: defaultTrack.id,
42942
- label: defaultTrack.name
42961
+ label: defaultTrack.name,
42943
42962
  };
42944
42963
  }
42945
- this.fillTracks(data.audioTracks.map(p => ({
42964
+ this.fillTracks(data.audioTracks.map((p) => ({
42946
42965
  id: p.id,
42947
- label: p.name
42966
+ label: p.name,
42948
42967
  })), defaultTrack?.id);
42949
42968
  });
42950
42969
  currentPlayback._hls.on(Events.AUDIO_TRACK_SWITCHING, this.startTrackSwitch.bind(this));
@@ -42990,23 +43009,30 @@ class AudioSelector extends UICorePlugin {
42990
43009
  if (!currentPlayback) {
42991
43010
  return false;
42992
43011
  }
42993
- const { audioTracks } = (currentPlayback.activePlayback._hls || currentPlayback.$el.get(0));
43012
+ const { audioTracks } = currentPlayback.activePlayback._hls || currentPlayback.$el.get(0);
42994
43013
  this.tracks = audioTracks;
42995
43014
  // Only care if we have at least 2 to choose from
42996
43015
  return this.tracks && this.tracks.length > 1;
42997
43016
  }
43017
+ /**
43018
+ * @internal
43019
+ */
42998
43020
  render() {
42999
- if (this.shouldRender()) {
43000
- this.$el.html(this.template({ 'tracks': this.tracks, 'title': this.getTitle() }));
43001
- if (Object.prototype.hasOwnProperty.call(this.core.mediaControl, '$audioTracksSelector') &&
43002
- this.core.mediaControl.$audioTracksSelector.length > 0) {
43003
- this.core.mediaControl.$audioTracksSelector.append(this.el);
43004
- }
43005
- this.highlightCurrentTrack();
43021
+ if (!this.shouldRender()) {
43022
+ return this;
43006
43023
  }
43007
- if (Object.prototype.hasOwnProperty.call(this.core.mediaControl, '$audioTracksSelector') &&
43008
- this.core.mediaControl.$audioTracksSelector.find('span.audio-arrow').length > 0) {
43009
- this.core.mediaControl.$audioTracksSelector.find('span.audio-arrow').append(audioArrow);
43024
+ const mediaControl = this.core.getPlugin('media_control');
43025
+ assert(mediaControl, 'media_control plugin is required');
43026
+ this.$el.html(AudioSelector.template({ tracks: this.tracks, title: this.getTitle() }));
43027
+ const ats = mediaControl.getElement('audioTracksSelector');
43028
+ if (!(ats && ats.length > 0)) {
43029
+ return this;
43030
+ }
43031
+ ats.append(this.el);
43032
+ this.highlightCurrentTrack();
43033
+ const aa = ats.find('audioArrow');
43034
+ if (aa.length > 0) {
43035
+ aa.append(audioArrow);
43010
43036
  }
43011
43037
  return this;
43012
43038
  }
@@ -43070,7 +43096,8 @@ class AudioSelector extends UICorePlugin {
43070
43096
  return this.$('.audio_selector button .audio-text');
43071
43097
  }
43072
43098
  trackElement(id) {
43073
- return this.$('.audio_selector ul a' + (id !== undefined ? '[data-track-selector-select="' + id + '"]' : '')).parent();
43099
+ return this.$('.audio_selector ul a' +
43100
+ (id !== undefined ? '[data-track-selector-select="' + id + '"]' : '')).parent();
43074
43101
  }
43075
43102
  getTitle() {
43076
43103
  if (!this.tracks) {
@@ -43141,8 +43168,11 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
43141
43168
 
43142
43169
  const pluginHtml$7 = "<div class=\"big-mute-icon-wrapper\" data-big-mute>\n <div class=\"big-mute-icon gcore-skin-border-color\" data-big-mute-icon></div>\n</div>\n";
43143
43170
 
43144
- const T$c = "plugins.big_mute_button";
43171
+ const T$c = 'plugins.big_mute_button';
43172
+ // TODO rewrite as a container plugin
43145
43173
  /**
43174
+ * Displays a big mute button over the video when it's muted.
43175
+ * Once pressed, it unmutes the video.
43146
43176
  * @beta
43147
43177
  */
43148
43178
  class BigMuteButton extends UICorePlugin {
@@ -43150,21 +43180,31 @@ class BigMuteButton extends UICorePlugin {
43150
43180
  _adIsPlaying = false;
43151
43181
  $bigMuteBtnContainer = null;
43152
43182
  $bigMuteButton = null;
43183
+ /**
43184
+ * @internal
43185
+ */
43153
43186
  get name() {
43154
43187
  return 'big_mute_button';
43155
43188
  }
43189
+ /**
43190
+ * @internal
43191
+ */
43156
43192
  get supportedVersion() {
43157
43193
  return { min: CLAPPR_VERSION };
43158
43194
  }
43159
- get template() {
43160
- return tmpl(pluginHtml$7);
43161
- }
43195
+ static template = tmpl(pluginHtml$7);
43196
+ /**
43197
+ * @internal
43198
+ */
43162
43199
  get events() {
43163
43200
  return {
43164
43201
  'click .big-mute-icon': 'handleBigMuteBtnClick',
43165
43202
  'click .big-mute-icon-wrapper': 'destroyBigMuteBtn',
43166
43203
  };
43167
43204
  }
43205
+ /**
43206
+ * @internal
43207
+ */
43168
43208
  bindEvents() {
43169
43209
  super.bindEvents();
43170
43210
  this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
@@ -43175,17 +43215,6 @@ class BigMuteButton extends UICorePlugin {
43175
43215
  });
43176
43216
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
43177
43217
  }
43178
- unBindEvents() {
43179
- // @ts-ignore
43180
- this.stopListening(this.core, Events$1.CORE_READY);
43181
- this.stopListening(this.core, 'core:advertisement:start', this.onStartAd);
43182
- this.stopListening(this.core, 'core:advertisement:finish', this.onFinishAd);
43183
- this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
43184
- const container = this.core.activeContainer;
43185
- if (container) {
43186
- this.stopListening(container.playback, Events$1.PLAYBACK_PLAY, this.render);
43187
- }
43188
- }
43189
43218
  onCoreReady() {
43190
43219
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_VOLUME, this.onContainerVolume);
43191
43220
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_READY, this.onContainerStart);
@@ -43242,12 +43271,15 @@ class BigMuteButton extends UICorePlugin {
43242
43271
  });
43243
43272
  return autoPlay && !wasMuted && volume === 0;
43244
43273
  }
43274
+ /**
43275
+ * @internal
43276
+ */
43245
43277
  render() {
43246
43278
  if (this.shouldRender()) {
43247
43279
  trace(`${T$c} render`, {
43248
43280
  el: !!this.$el,
43249
43281
  });
43250
- this.$el.html(this.template());
43282
+ this.$el.html(BigMuteButton.template());
43251
43283
  this.$bigMuteBtnContainer = this.$el.find('.big-mute-icon-wrapper[data-big-mute]');
43252
43284
  this._adIsPlaying && this.$bigMuteBtnContainer.addClass('hide');
43253
43285
  this.$bigMuteButton = this.$bigMuteBtnContainer.find('.big-mute-icon');
@@ -43293,6 +43325,7 @@ const VERSION$5 = '2.19.12';
43293
43325
  const T$b = 'plugins.bottom_gear';
43294
43326
  /**
43295
43327
  * Custom events emitted by the plugin
43328
+ * @beta
43296
43329
  */
43297
43330
  var GearEvents;
43298
43331
  (function (GearEvents) {
@@ -44490,6 +44523,9 @@ function requireMousetrap () {
44490
44523
  var mousetrapExports = requireMousetrap();
44491
44524
  const Mousetrap = /*@__PURE__*/getDefaultExportFromCjs$1(mousetrapExports);
44492
44525
 
44526
+ /**
44527
+ * @beta
44528
+ */
44493
44529
  var ClapprStatsEvents;
44494
44530
  (function (ClapprStatsEvents) {
44495
44531
  ClapprStatsEvents["REPORT_EVENT"] = "clappr:stats:report";
@@ -45823,7 +45859,10 @@ function newMetrics() {
45823
45859
  // TODO: fix
45824
45860
  const updateMetrics = () => { };
45825
45861
  /**
45862
+ * Collects useful statistics about playback performance.
45826
45863
  * @beta
45864
+ * @remarks
45865
+ * This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
45827
45866
  */
45828
45867
  class ClapprStats extends ContainerPlugin {
45829
45868
  bwMeasureCount = 0;
@@ -45845,9 +45884,15 @@ class ClapprStats extends ContainerPlugin {
45845
45884
  updateFn = updateMetrics;
45846
45885
  urisToMeasureBandwidth;
45847
45886
  uriToMeasureLatency;
45887
+ /**
45888
+ * @internal
45889
+ */
45848
45890
  get name() {
45849
45891
  return 'clappr_stats';
45850
45892
  }
45893
+ /**
45894
+ * @internal
45895
+ */
45851
45896
  get supportedVersion() {
45852
45897
  return { min: CLAPPR_VERSION };
45853
45898
  }
@@ -45875,6 +45920,10 @@ class ClapprStats extends ContainerPlugin {
45875
45920
  // this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
45876
45921
  this.metrics.timers[timer] += this._now() - this.timers[timer];
45877
45922
  }
45923
+ /**
45924
+ * Registers a callback to receive the metrics.
45925
+ * @param updateMetricsFn
45926
+ */
45878
45927
  setUpdateMetrics(updateMetricsFn) {
45879
45928
  this.updateFn = updateMetricsFn;
45880
45929
  }
@@ -45893,6 +45942,9 @@ class ClapprStats extends ContainerPlugin {
45893
45942
  calls: []
45894
45943
  };
45895
45944
  }
45945
+ /**
45946
+ * @internal
45947
+ */
45896
45948
  bindEvents() {
45897
45949
  this.listenTo(this.container, Events$1.CONTAINER_BITRATE, this.onBitrate);
45898
45950
  this.listenTo(this.container, Events$1.CONTAINER_STOP, this.stopReporting);
@@ -45911,10 +45963,17 @@ class ClapprStats extends ContainerPlugin {
45911
45963
  this.listenTo(this.container.playback, Events$1.PLAYBACK_PROGRESS, this.onProgress);
45912
45964
  this.listenTo(this.container.playback, Events$1.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
45913
45965
  }
45966
+ /**
45967
+ * @internal
45968
+ */
45914
45969
  destroy() {
45915
45970
  this.stopReporting();
45916
45971
  super.destroy();
45917
45972
  }
45973
+ /**
45974
+ * Returns the collected metrics.
45975
+ * @returns The collected metrics
45976
+ */
45918
45977
  exportMetrics() {
45919
45978
  return structuredClone(this.metrics);
45920
45979
  }
@@ -45936,6 +45995,7 @@ class ClapprStats extends ContainerPlugin {
45936
45995
  this.intervalId = null;
45937
45996
  }
45938
45997
  this._newMetrics();
45998
+ // TODO
45939
45999
  // @ts-ignore
45940
46000
  this.stopListening();
45941
46001
  this.bindEvents();
@@ -46153,20 +46213,30 @@ class ClapprStats extends ContainerPlugin {
46153
46213
 
46154
46214
  //Copyright 2014 Globo.com Player authors. All rights reserved.
46155
46215
  // Use of this source code is governed by a BSD-style
46156
- // license that can be found in the LICENSE file.
46216
+ // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
46157
46217
  const T$a = 'plugins.click_to_pause_custom';
46218
+ /**
46219
+ * Adds a behavior of toggling the playback state on click over the container
46220
+ * @beta
46221
+ */
46158
46222
  class ClickToPause extends ContainerPlugin {
46159
46223
  pointerEnabled = false;
46160
46224
  timer = null;
46225
+ /**
46226
+ * @internal
46227
+ */
46161
46228
  get name() {
46162
46229
  return 'click_to_pause_custom';
46163
46230
  }
46231
+ /**
46232
+ * @internal
46233
+ */
46164
46234
  get supportedVersion() {
46165
46235
  return { min: CLAPPR_VERSION };
46166
46236
  }
46167
- get config() {
46168
- return this.container.options.clickToPauseConfig || {};
46169
- }
46237
+ /**
46238
+ * @internal
46239
+ */
46170
46240
  bindEvents() {
46171
46241
  this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.click);
46172
46242
  this.listenTo(this.container, Events$1.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
@@ -46282,23 +46352,45 @@ function getPageX(event) {
46282
46352
  return 0;
46283
46353
  }
46284
46354
 
46355
+ /**
46356
+ * Adds a behavior of showing a text over the seekbar to indicate the current clip.
46357
+ * @beta
46358
+ * @remarks
46359
+ * Depends on:
46360
+ *
46361
+ * - {@link MediaControl}
46362
+ *
46363
+ * Configuration options - {@link ClipsPluginSettings}
46364
+ */
46285
46365
  class ClipsPlugin extends UICorePlugin {
46286
46366
  clips = new Map();
46287
46367
  duration = 0;
46288
46368
  durationGetting = false;
46289
46369
  _oldContainer;
46290
46370
  svgMask = null;
46371
+ /**
46372
+ * @internal
46373
+ */
46291
46374
  get name() {
46292
- return 'media_control_clips';
46375
+ return 'clips';
46293
46376
  }
46377
+ /**
46378
+ * @internal
46379
+ */
46294
46380
  get attributes() {
46295
46381
  return {
46296
- 'class': this.name
46382
+ class: this.name,
46297
46383
  };
46298
46384
  }
46385
+ /**
46386
+ * @internal
46387
+ */
46299
46388
  bindEvents() {
46389
+ const mediaControl = this.core.getPlugin('media_control');
46390
+ assert(mediaControl, 'media_control plugin is required');
46300
46391
  this.listenToOnce(this.core, Events$1.CORE_READY, this._onCoreReady);
46301
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
46392
+ // TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
46393
+ this.listenTo(mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
46302
46394
  this.listenTo(this.core, Events$1.CORE_RESIZE, this.playerResize);
46303
46395
  }
46304
46396
  _onCoreReady() {
@@ -46308,12 +46400,6 @@ class ClipsPlugin extends UICorePlugin {
46308
46400
  }
46309
46401
  this.parseClips();
46310
46402
  }
46311
- unbindEvents() {
46312
- // @ts-ignore
46313
- this.stopListening(this.core, Events$1.CORE_READY);
46314
- // @ts-ignore
46315
- this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED);
46316
- }
46317
46403
  _onMediaControlContainerChanged() {
46318
46404
  this._bindContainerEvents();
46319
46405
  }
@@ -46327,9 +46413,10 @@ class ClipsPlugin extends UICorePlugin {
46327
46413
  if (this._oldContainer) {
46328
46414
  this.stopListening(this._oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
46329
46415
  }
46330
- this._oldContainer = this.core.mediaControl.container;
46416
+ const mediaControl = this.core.getPlugin('media_control');
46417
+ this._oldContainer = mediaControl.container;
46331
46418
  this.durationGetting = false;
46332
- this.listenTo(this.core.mediaControl.container, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
46419
+ this.listenTo(mediaControl.container, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
46333
46420
  }
46334
46421
  onTimeUpdate(event) {
46335
46422
  if (!this.durationGetting) {
@@ -46346,13 +46433,17 @@ class ClipsPlugin extends UICorePlugin {
46346
46433
  }
46347
46434
  parseClips() {
46348
46435
  const textArr = this.options.clips.text.split('\n');
46349
- const clipsArr = textArr.map((val) => {
46436
+ const clipsArr = textArr
46437
+ .map((val) => {
46350
46438
  const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
46351
- return matchRes ? {
46352
- start: strtimeToMiliseconds(matchRes[1]),
46353
- text: matchRes[2],
46354
- } : null;
46355
- }).filter((clip) => clip !== null);
46439
+ return matchRes
46440
+ ? {
46441
+ start: strtimeToMiliseconds(matchRes[1]),
46442
+ text: matchRes[2],
46443
+ }
46444
+ : null;
46445
+ })
46446
+ .filter((clip) => clip !== null);
46356
46447
  clipsArr.sort((a, b) => a.start - b.start);
46357
46448
  clipsArr.forEach((clip, index) => {
46358
46449
  this.clips.set(clip.start, {
@@ -46363,6 +46454,11 @@ class ClipsPlugin extends UICorePlugin {
46363
46454
  });
46364
46455
  });
46365
46456
  }
46457
+ /**
46458
+ * Returns the text of the current clip.
46459
+ * @param time - The current time of the player.
46460
+ * @returns The text of the current clip.
46461
+ */
46366
46462
  getText(time) {
46367
46463
  for (const [key, value] of this.clips.entries()) {
46368
46464
  if (time >= value.start && time < value.end) {
@@ -46373,14 +46469,14 @@ class ClipsPlugin extends UICorePlugin {
46373
46469
  }
46374
46470
  makeSvg(duration) {
46375
46471
  let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
46376
- const widthOfSeek = this.core.mediaControl.container.$el.width();
46472
+ const widthOfSeek = this.core.activeContainer.$el.width();
46377
46473
  let finishValue = 0;
46378
- this.clips.forEach(val => {
46474
+ this.clips.forEach((val) => {
46379
46475
  let end = val.end;
46380
46476
  if (!end) {
46381
46477
  end = val.end = duration;
46382
46478
  }
46383
- const widthChunk = (end - val.start) * widthOfSeek / duration;
46479
+ const widthChunk = ((end - val.start) * widthOfSeek) / duration;
46384
46480
  svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
46385
46481
  finishValue += widthChunk;
46386
46482
  });
@@ -46393,7 +46489,8 @@ class ClipsPlugin extends UICorePlugin {
46393
46489
  if (this.svgMask) {
46394
46490
  this.svgMask.remove();
46395
46491
  }
46396
- const $seekBarContainer = this.core.mediaControl.getElement('seekBarContainer');
46492
+ const mediaControl = this.core.getPlugin('media_control');
46493
+ const $seekBarContainer = mediaControl.getElement('seekBarContainer');
46397
46494
  if ($seekBarContainer?.get(0)) {
46398
46495
  $seekBarContainer.addClass('clips');
46399
46496
  }
@@ -46401,7 +46498,8 @@ class ClipsPlugin extends UICorePlugin {
46401
46498
  $seekBarContainer?.append(this.svgMask);
46402
46499
  }
46403
46500
  setClipText(text) {
46404
- const $clipText = this.core.mediaControl.getElement('clipText');
46501
+ const mediaControl = this.core.getPlugin('media_control');
46502
+ const $clipText = mediaControl.getElement('clipText');
46405
46503
  if ($clipText && text) {
46406
46504
  $clipText.show();
46407
46505
  $clipText.text(`${text}`);
@@ -46411,28 +46509,37 @@ class ClipsPlugin extends UICorePlugin {
46411
46509
 
46412
46510
  const templateHtml$1 = "<ul class=\"context-menu-list\">\n <% if(options) { %>\n <% for (var i = 0; i < options.length; i++) { %>\n <li class=\"context-menu-list-item <%= options[i].class %>\"\n data-<%= options[i].name %>><%= options[i].label %></li>\n <% } %>\n <% } %>\n</ul>\n";
46413
46511
 
46414
- class ContextMenu extends UICorePlugin {
46512
+ /**
46513
+ * Displays a small context menu when clicked on the player container.
46514
+ * @beta
46515
+ * @remarks
46516
+ * Configuration options - {@link ContextMenuPluginSettings}
46517
+ */
46518
+ class ContextMenu extends UIContainerPlugin {
46415
46519
  _label = '';
46416
46520
  _url = '';
46417
- container = null;
46418
46521
  menuOptions = [];
46522
+ /**
46523
+ * @internal
46524
+ */
46419
46525
  get name() {
46420
46526
  return 'context_menu';
46421
46527
  }
46528
+ /**
46529
+ * @internal
46530
+ */
46422
46531
  get supportedVersion() {
46423
46532
  return { min: CLAPPR_VERSION };
46424
46533
  }
46534
+ /**
46535
+ * @internal
46536
+ */
46425
46537
  get attributes() {
46426
- return { 'class': 'context-menu' };
46427
- }
46428
- get mediaControl() {
46429
- return this.core.mediaControl;
46430
- }
46431
- get template() {
46432
- return tmpl(templateHtml$1);
46538
+ return { class: 'context-menu' };
46433
46539
  }
46540
+ static template = tmpl(templateHtml$1);
46434
46541
  get label() {
46435
- return this._label || 'Gcore player ver. ' + process.env.VERSION;
46542
+ return this._label || 'Gcore player ver. ' + version().gplayer;
46436
46543
  }
46437
46544
  get url() {
46438
46545
  return this._url || 'https://gcore.com/';
@@ -46440,16 +46547,19 @@ class ContextMenu extends UICorePlugin {
46440
46547
  get exposeVersion() {
46441
46548
  return {
46442
46549
  label: this.label,
46443
- name: 'version'
46550
+ name: 'version',
46444
46551
  };
46445
46552
  }
46553
+ /**
46554
+ * @internal
46555
+ */
46446
46556
  get events() {
46447
46557
  return {
46448
- 'click [data-version]': 'onOpenMainPage'
46558
+ 'click [data-version]': 'onOpenMainPage',
46449
46559
  };
46450
46560
  }
46451
- constructor(core) {
46452
- super(core);
46561
+ constructor(container) {
46562
+ super(container);
46453
46563
  if (this.options.contextMenu && this.options.contextMenu.label) {
46454
46564
  this._label = this.options.contextMenu.label;
46455
46565
  }
@@ -46459,28 +46569,21 @@ class ContextMenu extends UICorePlugin {
46459
46569
  this.render();
46460
46570
  this.bindEvents();
46461
46571
  }
46572
+ /**
46573
+ * @internal
46574
+ */
46462
46575
  bindEvents() {
46463
- if (this.mediaControl) {
46464
- this.listenTo(this.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);
46465
- if (this.container) {
46466
- this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
46467
- this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.hide);
46468
- }
46469
- }
46470
- $('body').on('click', this.hide.bind(this));
46576
+ this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
46577
+ this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.hide);
46578
+ $('body').on('click', this.hideOnBodyClick);
46471
46579
  }
46580
+ /**
46581
+ * @internal
46582
+ */
46472
46583
  destroy() {
46473
- $('body').off('click', this.hide.bind(this));
46474
- // @ts-ignore
46475
- this.stopListening();
46584
+ $('body').off('click', this.hideOnBodyClick);
46476
46585
  return super.destroy();
46477
46586
  }
46478
- containerChanged() {
46479
- this.container = this.core.activeContainer;
46480
- // @ts-ignore
46481
- this.stopListening();
46482
- this.bindEvents();
46483
- }
46484
46587
  toggleContextMenu(event) {
46485
46588
  event.preventDefault();
46486
46589
  const offset = this.container?.$el.offset();
@@ -46488,7 +46591,8 @@ class ContextMenu extends UICorePlugin {
46488
46591
  }
46489
46592
  show(top, left) {
46490
46593
  this.hide();
46491
- if (this.options.contextMenu && this.options.contextMenu.preventShowContextMenu) {
46594
+ if (this.options.contextMenu &&
46595
+ this.options.contextMenu.preventShowContextMenu) {
46492
46596
  return;
46493
46597
  }
46494
46598
  this.$el.css({ top, left });
@@ -46500,80 +46604,19 @@ class ContextMenu extends UICorePlugin {
46500
46604
  onOpenMainPage() {
46501
46605
  window.open(this.url, '_blank');
46502
46606
  }
46607
+ /**
46608
+ * @internal
46609
+ */
46503
46610
  render() {
46504
46611
  this.menuOptions = [this.exposeVersion];
46505
- this.$el.html(this.template({ options: this.menuOptions }));
46506
- this.core.$el.append(this.$el);
46612
+ this.$el.html(ContextMenu.template({ options: this.menuOptions }));
46613
+ this.container.$el.append(this.$el); // TODO append to the container, turn into a container plugin
46507
46614
  this.hide();
46508
- this.disable();
46509
46615
  return this;
46510
46616
  }
46511
- }
46512
-
46513
- class DisableControls extends UICorePlugin {
46514
- get name() {
46515
- return 'disable_controls';
46516
- }
46517
- get container() {
46518
- return this.core && this.core.activeContainer;
46519
- }
46520
- get supportedVersion() {
46521
- return { min: CLAPPR_VERSION };
46522
- }
46523
- bindEvents() {
46524
- if (this.container) {
46525
- this.listenTo(this.container, Events$1.CONTAINER_MEDIACONTROL_ENABLE, this.enableControls);
46526
- this.listenTo(this.container, Events$1.CONTAINER_PLAY, this.enableControls);
46527
- this.listenTo(this.container, Events$1.CONTAINER_PAUSE, this.enableControls);
46528
- this.listenTo(this.container, Events$1.CONTAINER_STOP, this.enableControls);
46529
- this.listenTo(this.container, Events$1.CONTAINER_ENDED, this.enableControls);
46530
- this.listenTo(this.container, 'container:advertisement:start', this.enableControls);
46531
- }
46532
- this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
46533
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_SHOW, this.enableControls);
46534
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.enableControls);
46535
- }
46536
- unbindEvents() {
46537
- // @ts-ignore
46538
- this.stopListening(this.core, Events$1.CORE_READY);
46539
- // @ts-ignore
46540
- this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_SHOW);
46541
- // @ts-ignore
46542
- this.stopListening(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED);
46543
- // @ts-ignore
46544
- this.stopListening(this.container, Events$1.CONTAINER_MEDIACONTROL_ENABLE);
46545
- // @ts-ignore
46546
- this.stopListening(this.container, Events$1.CONTAINER_PLAY);
46547
- // @ts-ignore
46548
- this.stopListening(this.container, Events$1.CONTAINER_PAUSE);
46549
- // @ts-ignore
46550
- this.stopListening(this.container, Events$1.CONTAINER_STOP);
46551
- // @ts-ignore
46552
- this.stopListening(this.container, Events$1.CONTAINER_ENDED);
46553
- // @ts-ignore
46554
- this.stopListening(this.container, 'container:advertisement:start');
46555
- }
46556
- setDisableStyles() {
46557
- const css = document.createElement('style');
46558
- const styles = '.control-need-disable { display: none!important; }';
46559
- css.appendChild(document.createTextNode(styles));
46560
- this.core.$el.get(0).appendChild(css);
46561
- }
46562
- onCoreReady() {
46563
- this.setDisableStyles();
46564
- this.bindEvents();
46565
- this.enableControls();
46566
- }
46567
- enableControls() {
46568
- this.disableAllControls();
46569
- }
46570
- disableAllControls() {
46571
- setTimeout(() => {
46572
- const spinnerPlugin = this.container.getPlugin('spinner');
46573
- spinnerPlugin?.destroy();
46574
- this.container.disableMediaControl();
46575
- }, 0);
46576
- }
46617
+ hideOnBodyClick = () => {
46618
+ this.hide();
46619
+ };
46577
46620
  }
46578
46621
 
46579
46622
  const dvrHTML = "<div class=\"live-info\"><%= live %></div>\n<button type=\"button\" class=\"live-button\" aria-label=\"<%= backToLive %>\"><%= backToLive %></button>\n";
@@ -46585,7 +46628,7 @@ const dvrHTML = "<div class=\"live-info\"><%= live %></div>\n<button type=\"butt
46585
46628
  * @remarks
46586
46629
  * Depends on:
46587
46630
  *
46588
- * - {@link MediaControl | media_control}
46631
+ * - {@link MediaControl}
46589
46632
  *
46590
46633
  * The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
46591
46634
  */
@@ -46595,7 +46638,7 @@ class DvrControls extends UICorePlugin {
46595
46638
  * @internal
46596
46639
  */
46597
46640
  get name() {
46598
- return 'media_control_dvr';
46641
+ return 'dvr_controls';
46599
46642
  }
46600
46643
  /**
46601
46644
  * @internal
@@ -46628,32 +46671,15 @@ class DvrControls extends UICorePlugin {
46628
46671
  * @internal
46629
46672
  */
46630
46673
  bindEvents() {
46631
- this.bindCoreEvents();
46632
- this.bindContainerEvents();
46633
- if (this.core.activeContainer) {
46634
- this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
46635
- }
46636
- }
46637
- bindCoreEvents() {
46638
- if (this.core.mediaControl.settings) {
46639
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);
46640
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.settingsUpdate);
46641
- this.listenTo(this.core, Events$1.CORE_OPTIONS_CHANGE, this.render);
46642
- }
46643
- else {
46644
- setTimeout(() => this.bindCoreEvents(), 100);
46645
- }
46674
+ const mediaControl = this.core.getPlugin('media_control');
46675
+ assert(mediaControl, 'media_control plugin is required');
46676
+ this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.settingsUpdate);
46677
+ this.listenTo(this.core, Events$1.CORE_OPTIONS_CHANGE, this.render);
46678
+ this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.bindContainerEvents);
46646
46679
  }
46647
46680
  bindContainerEvents() {
46648
- if (this.core.activeContainer) {
46649
- this.listenToOnce(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.render);
46650
- this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
46651
- }
46652
- }
46653
- containerChanged() {
46654
- // @ts-ignore
46655
- this.stopListening();
46656
- this.bindEvents();
46681
+ this.listenToOnce(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.render);
46682
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
46657
46683
  }
46658
46684
  dvrChanged(dvrEnabled) {
46659
46685
  if (this.core.getPlaybackType() !== Playback.LIVE) {
@@ -46686,7 +46712,7 @@ class DvrControls extends UICorePlugin {
46686
46712
  settingsUpdate() {
46687
46713
  // @ts-ignore
46688
46714
  this.stopListening(); // TODO sort out
46689
- this.core.mediaControl.$el.removeClass('live');
46715
+ this.core.getPlugin('media_control').$el.removeClass('live'); // TODO don't access directly
46690
46716
  if (this.shouldRender()) {
46691
46717
  this.render();
46692
46718
  this.$el.click(() => this.click());
@@ -46706,7 +46732,7 @@ class DvrControls extends UICorePlugin {
46706
46732
  backToLive: this.core.i18n.t('back_to_live')
46707
46733
  }));
46708
46734
  if (this.shouldRender()) {
46709
- const mediaControl = this.core.mediaControl;
46735
+ const mediaControl = this.core.getPlugin('media_control');
46710
46736
  assert(mediaControl, 'media_control plugin is required');
46711
46737
  // TODO don't tap into the $el directly
46712
46738
  mediaControl.$el.addClass('live');
@@ -46726,7 +46752,6 @@ const T$9 = 'plugins.error_screen';
46726
46752
  /**
46727
46753
  * Displays a descriptive error in the overlay on top of the player.
46728
46754
  * @beta
46729
- * TODO
46730
46755
  */
46731
46756
  class ErrorScreen extends UICorePlugin {
46732
46757
  _retry = 0;
@@ -46909,6 +46934,10 @@ const stopIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
46909
46934
  const FAVICON_COLOR = '#567';
46910
46935
  const FAVICON_SELECTOR = 'link[rel="shortcut icon"]';
46911
46936
  // const oldIcon = $(FAVICON_SELECTOR);
46937
+ /**
46938
+ * The plugin adds custom favicon to the player's tab.
46939
+ * @beta
46940
+ */
46912
46941
  class Favicon extends CorePlugin {
46913
46942
  _container = null;
46914
46943
  oldIcon;
@@ -47010,7 +47039,11 @@ class Favicon extends CorePlugin {
47010
47039
 
47011
47040
  // Copyright 2014 Globo.com Player authors. All rights reserved.
47012
47041
  // Use of this source code is governed by a BSD-style
47013
- // license that can be found in the LICENSE file.
47042
+ // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE
47043
+ /**
47044
+ * An example Google Analytics integration plugin
47045
+ * @beta
47046
+ */
47014
47047
  class GoogleAnalytics extends ContainerPlugin {
47015
47048
  account = '';
47016
47049
  trackerName = '';
@@ -47660,6 +47693,10 @@ function calculateSize(original) {
47660
47693
 
47661
47694
  const logoHTML = "<div class=\"clappr-logo control-need-disable\">\n <img class=\"clappr-logo-img\"/>\n</div>\n";
47662
47695
 
47696
+ /**
47697
+ * The plugin adds custom logo to the player.
47698
+ * @beta
47699
+ */
47663
47700
  class Logo extends UIContainerPlugin {
47664
47701
  hasStartedPlaying = false;
47665
47702
  $logoContainer = null;
@@ -47937,7 +47974,7 @@ class MediaControl extends UICorePlugin {
47937
47974
  return { min: CLAPPR_VERSION };
47938
47975
  }
47939
47976
  get disabled() {
47940
- const playbackIsNOOP = this.container && this.container.getPlaybackType() === Playback.NO_OP;
47977
+ const playbackIsNOOP = this.core.activeContainer && this.core.activeContainer.getPlaybackType() === Playback.NO_OP;
47941
47978
  return this.userDisabled || playbackIsNOOP;
47942
47979
  }
47943
47980
  /**
@@ -48618,6 +48655,8 @@ class MediaControl extends UICorePlugin {
48618
48655
  */
48619
48656
  getElement(name) {
48620
48657
  switch (name) {
48658
+ case 'audioTracksSelector':
48659
+ return this.$audioTracksSelector;
48621
48660
  case 'clipText':
48622
48661
  return this.$clipText;
48623
48662
  case 'bottomGear':
@@ -48923,6 +48962,9 @@ const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:
48923
48962
 
48924
48963
  const VERSION$3 = '0.0.1';
48925
48964
  const T$7 = 'plugins.media_control_multicamera';
48965
+ /**
48966
+ * The plugin adds support for loading multiple streams and switching between them using the media control UI.
48967
+ */
48926
48968
  class MultiCamera extends UICorePlugin {
48927
48969
  currentCamera = null;
48928
48970
  currentTime = 0;
@@ -49877,8 +49919,12 @@ const seekTimeHTML = "<span data-seek-time></span>\n<span data-duration></span>\
49877
49919
 
49878
49920
  // Copyright 2014 Globo.com Player authors. All rights reserved.
49879
49921
  // Use of this source code is governed by a BSD-style
49880
- // license that can be found in the LICENSE file.
49922
+ // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE
49881
49923
  const { formatTime } = Utils;
49924
+ /**
49925
+ * The plugin adds a seek time indicator to the media control UI.
49926
+ * @beta
49927
+ */
49882
49928
  class SeekTime extends UICorePlugin {
49883
49929
  get name() {
49884
49930
  return 'media_control_seek_time';
@@ -50035,6 +50081,9 @@ const fbIcon = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"32px\"
50035
50081
 
50036
50082
  const twIcon = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"32px\" height=\"32px\" viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <!-- Generator: Sketch 49 (51002) - http://www.bohemiancoding.com/sketch -->\n <title>twitter</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id=\"twitter\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g fill-rule=\"nonzero\" id=\"Shape\">\n <path d=\"M32,30 C32,31.104 31.104,32 30,32 L2,32 C0.896,32 0,31.104 0,30 L0,2 C0,0.896 0.896,0 2,0 L30,0 C31.104,0 32,0.896 32,2 L32,30 Z\" fill=\"#55ACEE\"></path>\n <path class=\"icon-hover\" d=\"M25.987,9.894 C25.251,10.216 24.462,10.431 23.63,10.529 C24.48,10.031 25.13,9.24 25.436,8.298 C24.644,8.759 23.766,9.095 22.831,9.276 C22.083,8.491 21.017,8 19.838,8 C17.572,8 15.738,9.807 15.738,12.038 C15.738,12.352 15.774,12.663 15.842,12.96 C12.435,12.788 9.413,11.181 7.39,8.739 C7.038,9.336 6.834,10.029 6.834,10.771 C6.834,12.17 7.56,13.406 8.658,14.131 C7.987,14.109 7.354,13.928 6.802,13.625 C6.801,13.642 6.801,13.659 6.801,13.677 C6.801,15.632 8.215,17.266 10.091,17.637 C9.748,17.727 9.386,17.779 9.01,17.779 C8.746,17.779 8.49,17.755 8.24,17.707 C8.76,19.311 10.274,20.478 12.068,20.512 C10.67,21.594 8.9,22.24 6.979,22.24 C6.649,22.24 6.321,22.222 6,22.184 C7.814,23.329 9.971,23.997 12.287,23.997 C19.828,23.997 23.953,17.843 23.953,12.506 C23.953,12.333 23.948,12.156 23.941,11.985 C24.741,11.414 25.438,10.703 25.987,9.894 Z\" fill=\"#FFFFFF\"></path>\n </g>\n </g>\n</svg>";
50037
50083
 
50084
+ /**
50085
+ * The plugin adds a share button to the media control UI.
50086
+ */
50038
50087
  class Share extends UICorePlugin {
50039
50088
  hide = false;
50040
50089
  container = null;
@@ -50152,6 +50201,9 @@ class Share extends UICorePlugin {
50152
50201
 
50153
50202
  const pluginHtml$1 = "<div class=\"skip-container\" data-skip-container>\n <div class=\"skip-item\" data-skip-left>\n </div>\n <div class=\"skip-item\" data-skip-mid>\n </div>\n <div class=\"skip-item\" data-skip-right>\n </div>\n</div>\n";
50154
50203
 
50204
+ /**
50205
+ * The plugin adds skip controls to the media control UI.
50206
+ */
50155
50207
  class SkipTime extends UICorePlugin {
50156
50208
  get name() {
50157
50209
  return 'skip_time';
@@ -50949,6 +51001,7 @@ const STALL_MEASURE_PERIOD = 10;
50949
51001
  const T$1 = 'plugins.telemetry';
50950
51002
  /**
50951
51003
  * Telemetry event type
51004
+ * @beta
50952
51005
  */
50953
51006
  var TelemetryEvent;
50954
51007
  (function (TelemetryEvent) {
@@ -51236,7 +51289,29 @@ const parseSRT = /*@__PURE__*/getDefaultExportFromCjs$1(parseSrtExports);
51236
51289
 
51237
51290
  const pluginHtml = "<div class=\"thumbnails-text\"></div>\n<% if (backdropHeight) { %>\n <div class=\"backdrop\" style=\"height: <%= backdropHeight %>px;\">\n <div class=\"carousel\"></div>\n </div>\n<% }; %>\n<% if (spotlightHeight) { %>\n <div class=\"spotlight\" style=\"height: <%= spotlightHeight %>px;\">\n </div>\n<% }; %>\n";
51238
51291
 
51239
- const T = 'plugins.media_control_thumbnails';
51292
+ const T = 'plugins.thumbnails';
51293
+ /**
51294
+ * Displays the thumbnails of the video when available.
51295
+ * @beta
51296
+ * @example
51297
+ * ```ts
51298
+ * import { Thumbnails } from '@gcorevideo/player'
51299
+ *
51300
+ * Player.registerPlugin(Thumbnails)
51301
+ *
51302
+ * new Player({
51303
+ * thumbnails: {
51304
+ * backdropHeight: 200,
51305
+ * backdropMinOpacity: 0.9,
51306
+ * backdropMaxOpacity: 0.99,
51307
+ * spotlightHeight: 100,
51308
+ * vtt: '1\n00:00:00,000 --> 00:00:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=0,0,100,56\n\n2\n00:00:10,000 --> 00:00:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=100,0,100,56\n\n3\n00:00:20,000 --> 00:00:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=200,0,100,56\n\n4\n00:00:30,000 --> 00:00:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=300,0,100,56\n\n5\n00:00:40,000 --> 00:00:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=400,0,100,56\n\n6\n00:00:50,000 --> 00:01:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=500,0,100,56\n\n7\n00:01:00,000 --> 00:01:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=600,0,100,56\n\n8\n00:01:10,000 --> 00:01:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=0,56,100,56\n\n9\n00:01:20,000 --> 00:01:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=100,56,100,56\n\n10\n00:01:30,000 --> 00:01:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=200,56,100,56\n\n11\n00:01:40,000 --> 00:01:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=300,56,100,56\n\n12\n00:01:50,000 --> 00:02:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=400,56,100,56\n\n13\n00:02:00,000 --> 00:02:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=500,56,100,56\n\n14\n00:02:10,000 --> 00:02:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=600,56,100,56\n\n15\n00:02:20,000 --> 00:02:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=0,112,100,56\n\n16\n00:02:30,000 --> 00:02:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=100,112,100,56\n\n17\n00:02:40,000 --> 00:02:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=200,112,100,56\n\n18\n00:02:50,000 --> 00:03:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=300,112,100,56\n\n19\n00:03:00,000 --> 00:03:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=400,112,100,56\n\n20\n00:03:10,000 --> 00:03:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=500,112,100,56\n\n21\n00:03:20,000 --> 00:03:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=600,112,100,56\n\n22\n00:03:30,000 --> 00:03:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=0,168,100,56\n\n23\n00:03:40,000 --> 00:03:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=100,168,100,56\n\n24\n00:03:50,000 --> 00:04:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=200,168,100,56\n\n25\n00:04:00,000 --> 00:04:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=300,168,100,56\n\n26\n00:04:10,000 --> 00:04:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=400,168,100,56\n\n27\n00:04:20,000 --> 00:04:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=500,168,100,56\n\n28\n00:04:30,000 --> 00:04:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=600,168,100,56\n\n29\n00:04:40,000 --> 00:04:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=0,224,100,56\n\n30\n00:04:50,000 --> 00:05:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=100,224,100,56\n\n31\n00:05:00,000 --> 00:05:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=200,224,100,56\n\n32\n00:05:10,000 --> 00:05:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=300,224,100,56\n\n33\n00:05:20,000 --> 00:05:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=400,224,100,56\n\n34\n00:05:30,000 --> 00:05:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=500,224,100,56\n\n35\n00:05:40,000 --> 00:05:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=600,224,100,56\n\n36\n00:05:50,000 --> 00:06:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=0,280,100,56\n\n37\n00:06:00,000 --> 00:06:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=100,280,100,56\n\n38\n00:06:10,000 --> 00:06:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=200,280,100,56\n\n39\n00:06:20,000 --> 00:06:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=300,280,100,56\n\n40\n00:06:30,000 --> 00:06:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=400,280,100,56\n\n41\n00:06:40,000 --> 00:06:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=500,280,100,56\n\n42\n00:06:50,000 --> 00:07:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=600,280,100,56\n\n43\n00:07:00,000 --> 00:07:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=0,336,100,56\n\n44\n00:07:10,000 --> 00:07:20,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=100,336,100,56\n\n45\n00:07:20,000 --> 00:07:30,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=200,336,100,56\n\n46\n00:07:30,000 --> 00:07:40,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=300,336,100,56\n\n47\n00:07:40,000 --> 00:07:50,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=400,336,100,56\n\n48\n00:07:50,000 --> 00:08:00,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=500,336,100,56\n\n49\n00:08:00,000 --> 00:08:10,000\n3dk4NsRt6vWsffEr_sprite.jpg#xywh=600,336,100,56\n',
51309
+ * sprite:
51310
+ * 'https://static.gvideo.co/videoplatform/sprites/2675/2452164_3dk4NsRt6vWsffEr.mp4_sprite.jpg',
51311
+ * },
51312
+ * })
51313
+ * ```
51314
+ */
51240
51315
  class Thumbnails extends UICorePlugin {
51241
51316
  _$spotlight = null;
51242
51317
  _$backdrop = null;
@@ -51251,20 +51326,27 @@ class Thumbnails extends UICorePlugin {
51251
51326
  _thumbsLoaded = false;
51252
51327
  _oldContainer = null;
51253
51328
  _thumbs = [];
51329
+ /**
51330
+ * @internal
51331
+ */
51254
51332
  get name() {
51255
- return 'media_control_thumbnails';
51333
+ return 'thumbnails';
51256
51334
  }
51335
+ /**
51336
+ * @internal
51337
+ */
51257
51338
  get supportedVersion() {
51258
51339
  return { min: CLAPPR_VERSION };
51259
51340
  }
51341
+ /**
51342
+ * @internal
51343
+ */
51260
51344
  get attributes() {
51261
51345
  return {
51262
- 'class': this.name
51346
+ class: this.name,
51263
51347
  };
51264
51348
  }
51265
- get template() {
51266
- return tmpl(pluginHtml);
51267
- }
51349
+ static template = tmpl(pluginHtml);
51268
51350
  /*
51269
51351
  * Helper to build the "thumbs" property for a sprite sheet.
51270
51352
  *
@@ -51308,6 +51390,9 @@ class Thumbnails extends UICorePlugin {
51308
51390
  return thumbs;
51309
51391
  }
51310
51392
  // TODO check if seek enabled
51393
+ /**
51394
+ * @internal
51395
+ */
51311
51396
  bindEvents() {
51312
51397
  this.listenToOnce(this.core, Events$1.CORE_READY, this._onCoreReady);
51313
51398
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this._onMouseMove);
@@ -51324,7 +51409,9 @@ class Thumbnails extends UICorePlugin {
51324
51409
  }
51325
51410
  _onCoreReady() {
51326
51411
  try {
51327
- if (!this.options.thumbnails || !this.options.thumbnails.sprite || !this.options.thumbnails.vtt) {
51412
+ if (!this.options.thumbnails ||
51413
+ !this.options.thumbnails.sprite ||
51414
+ !this.options.thumbnails.vtt) {
51328
51415
  this.destroy();
51329
51416
  return;
51330
51417
  }
@@ -51375,7 +51462,7 @@ class Thumbnails extends UICorePlugin {
51375
51462
  }
51376
51463
  _getOptions() {
51377
51464
  if (!('thumbnails' in this.core.options)) {
51378
- throw '\'thumbnail property missing from options object.';
51465
+ throw "'thumbnail property missing from options object.";
51379
51466
  }
51380
51467
  return this.core.options.thumbnails;
51381
51468
  }
@@ -51476,7 +51563,7 @@ class Thumbnails extends UICorePlugin {
51476
51563
  this.$img.css({
51477
51564
  height: this.spriteSheetHeight * scaleFactor,
51478
51565
  left: -1 * thumb.x * scaleFactor,
51479
- top: -1 * thumb.y * scaleFactor
51566
+ top: -1 * thumb.y * scaleFactor,
51480
51567
  });
51481
51568
  if (this.$container.find(this.$img).length === 0) {
51482
51569
  this.$container.append(this.$img);
@@ -51518,7 +51605,7 @@ class Thumbnails extends UICorePlugin {
51518
51605
  const videoDuration = this.core.mediaControl.container.getDuration();
51519
51606
  const startTimeOffset = this.core.mediaControl.container.getStartTimeOffset();
51520
51607
  // the time into the video at the current hover position
51521
- const hoverTime = startTimeOffset + (videoDuration * hoverPosition);
51608
+ const hoverTime = startTimeOffset + videoDuration * hoverPosition;
51522
51609
  const backdropWidth = this._$backdrop.width();
51523
51610
  const $carousel = this._$carousel;
51524
51611
  const carouselWidth = $carousel.width();
@@ -51543,9 +51630,9 @@ class Thumbnails extends UICorePlugin {
51543
51630
  const positionInThumb = timeIntoThumb / thumbDuration;
51544
51631
  const xCoordInThumb = thumbWidth * positionInThumb;
51545
51632
  // now calculate the position along carousel that we want to be above the hover position
51546
- const xCoordInCarousel = (thumbIndex * thumbWidth) + xCoordInThumb;
51633
+ const xCoordInCarousel = thumbIndex * thumbWidth + xCoordInThumb;
51547
51634
  // and finally the position of the carousel when the hover position is taken in to consideration
51548
- const carouselXCoord = xCoordInCarousel - (hoverPosition * backdropWidth);
51635
+ const carouselXCoord = xCoordInCarousel - hoverPosition * backdropWidth;
51549
51636
  $carousel.css('left', -carouselXCoord);
51550
51637
  const maxOpacity = this._getOptions().backdropMaxOpacity || 0.6;
51551
51638
  const minOpacity = this._getOptions().backdropMinOpacity || 0.08;
@@ -51561,7 +51648,7 @@ class Thumbnails extends UICorePlugin {
51561
51648
  distance = Math.min(0, distance + thumbWidth);
51562
51649
  }
51563
51650
  // fade over the width of 2 thumbnails
51564
- const opacity = Math.max(maxOpacity - (Math.abs(distance) / (2 * thumbWidth)), minOpacity);
51651
+ const opacity = Math.max(maxOpacity - Math.abs(distance) / (2 * thumbWidth), minOpacity);
51565
51652
  this._$backdropCarouselImgs[i].css('opacity', opacity);
51566
51653
  }
51567
51654
  }
@@ -51577,7 +51664,7 @@ class Thumbnails extends UICorePlugin {
51577
51664
  const videoDuration = this.core.mediaControl.container.getDuration();
51578
51665
  // the time into the video at the current hover position
51579
51666
  const startTimeOffset = this.core.mediaControl.container.getStartTimeOffset();
51580
- const hoverTime = startTimeOffset + (videoDuration * hoverPosition);
51667
+ const hoverTime = startTimeOffset + videoDuration * hoverPosition;
51581
51668
  this.setText(hoverTime);
51582
51669
  // determine which thumbnail applies to the current time
51583
51670
  const thumbIndex = this._getThumbIndexForTime(hoverTime);
@@ -51589,7 +51676,7 @@ class Thumbnails extends UICorePlugin {
51589
51676
  const elWidth = this.$el.width();
51590
51677
  const thumbWidth = $spotlight.width();
51591
51678
  const thumbHeight = $spotlight.height();
51592
- let spotlightXPos = (elWidth * hoverPosition) - (thumbWidth / 2);
51679
+ let spotlightXPos = elWidth * hoverPosition - thumbWidth / 2;
51593
51680
  // adjust so the entire thumbnail is always visible
51594
51681
  spotlightXPos = Math.max(Math.min(spotlightXPos, elWidth - thumbWidth), 0);
51595
51682
  $spotlight.css('left', spotlightXPos);
@@ -51630,9 +51717,9 @@ class Thumbnails extends UICorePlugin {
51630
51717
  }
51631
51718
  _createElements() {
51632
51719
  trace(`${T} _createElements`);
51633
- this.$el.html(this.template({
51634
- 'backdropHeight': this._getOptions().backdropHeight,
51635
- 'spotlightHeight': this._getOptions().spotlightHeight
51720
+ this.$el.html(Thumbnails.template({
51721
+ backdropHeight: this._getOptions().backdropHeight,
51722
+ spotlightHeight: this._getOptions().spotlightHeight,
51636
51723
  }));
51637
51724
  // cache dom references
51638
51725
  this._$spotlight = this.$el.find('.spotlight');
@@ -51649,6 +51736,7 @@ var VolumeFadeEvents;
51649
51736
  VolumeFadeEvents["FADE"] = "core:volume:fade";
51650
51737
  })(VolumeFadeEvents || (VolumeFadeEvents = {}));
51651
51738
  /**
51739
+ * Applies fade effect to the player's volume change.
51652
51740
  * @beta
51653
51741
  */
51654
51742
  class VolumeFade extends UICorePlugin {
@@ -51743,4 +51831,4 @@ class VolumeFade extends UICorePlugin {
51743
51831
  }
51744
51832
  }
51745
51833
 
51746
- export { AudioSelector, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause, ClipsPlugin, ContextMenu, DisableControls, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, Kibo, LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerEvents, SpinnerThreeBounce, Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };
51834
+ export { AudioSelector, BigMuteButton, BottomGear, ClapprNerdStats, ClapprStats, ClickToPause, ClipsPlugin, ContextMenu, DvrControls, ErrorScreen, Favicon, GearEvents, GoogleAnalytics, Kibo, LevelSelector, LogTracer, Logger, Logo, MediaControl, MultiCamera, PictureInPicture, PlaybackErrorCode, PlaybackRate, Player, PlayerEvent, Poster, SeekTime, SentryTracer, Share, SkipTime, SourceController, SpinnerEvents, SpinnerThreeBounce, Subtitles, Telemetry, TelemetryEvent, Thumbnails, VolumeFade, VolumeFadeEvents, reportError, setTracer, trace, version };