@gcorevideo/player 2.20.1 → 2.20.4

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 (289) hide show
  1. package/dist/core.js +30 -6
  2. package/dist/index.css +1572 -1572
  3. package/dist/index.js +343 -226
  4. package/dist/player.d.ts +280 -52
  5. package/dist/plugins/index.css +619 -619
  6. package/dist/plugins/index.js +1468 -1351
  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.audioselector.bindevents.md → player.contextmenupluginsettings.label.md} +3 -7
  20. package/docs/api/player.contextmenupluginsettings.md +98 -0
  21. package/docs/api/{player.audioselector.attributes.md → player.contextmenupluginsettings.preventshowcontextmenu.md} +3 -6
  22. package/docs/api/{player.audioselector.reload.md → player.contextmenupluginsettings.url.md} +3 -7
  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 +73 -21
  66. package/docs/api/player.mediacontrolelement.md +1 -1
  67. package/docs/api/player.multicamera._constructor_.md +3 -0
  68. package/docs/api/player.multicamera.activebyid.md +3 -0
  69. package/docs/api/player.multicamera.attributes.md +3 -0
  70. package/docs/api/player.multicamera.bindevents.md +3 -0
  71. package/docs/api/player.multicamera.events.md +3 -0
  72. package/docs/api/player.multicamera.getcameraslist.md +3 -0
  73. package/docs/api/player.multicamera.getcurrentcamera.md +3 -0
  74. package/docs/api/player.multicamera.md +30 -1
  75. package/docs/api/player.multicamera.name.md +3 -0
  76. package/docs/api/player.multicamera.render.md +3 -0
  77. package/docs/api/player.multicamera.supportedversion.md +3 -0
  78. package/docs/api/player.multicamera.template.md +3 -0
  79. package/docs/api/player.multicamera.unbindevents.md +3 -0
  80. package/docs/api/player.multicamera.version.md +3 -0
  81. package/docs/api/player.seektime.attributes.md +3 -0
  82. package/docs/api/player.seektime.bindevents.md +3 -0
  83. package/docs/api/player.seektime.durationshown.md +3 -0
  84. package/docs/api/player.seektime.getseektime.md +3 -0
  85. package/docs/api/player.seektime.islivestreamwithdvr.md +3 -0
  86. package/docs/api/player.seektime.md +31 -0
  87. package/docs/api/player.seektime.mediacontrol.md +3 -0
  88. package/docs/api/player.seektime.mediacontrolcontainer.md +3 -0
  89. package/docs/api/player.seektime.name.md +3 -0
  90. package/docs/api/player.seektime.render.md +3 -0
  91. package/docs/api/player.seektime.shouldbevisible.md +3 -0
  92. package/docs/api/player.seektime.supportedversion.md +3 -0
  93. package/docs/api/player.seektime.template.md +3 -0
  94. package/docs/api/player.seektime.update.md +3 -0
  95. package/docs/api/player.share.md +2 -0
  96. package/docs/api/player.skiptime.md +2 -0
  97. package/docs/api/player.stalleventdata.count.md +3 -0
  98. package/docs/api/player.stalleventdata.event.md +3 -0
  99. package/docs/api/player.stalleventdata.md +8 -3
  100. package/docs/api/player.stalleventdata.time.md +3 -0
  101. package/docs/api/player.stalleventdata.total_ms.md +3 -0
  102. package/docs/api/player.starteventdata.event.md +3 -0
  103. package/docs/api/player.starteventdata.md +7 -0
  104. package/docs/api/player.telemetryevent.md +11 -0
  105. package/docs/api/player.telemetryeventdata.md +3 -0
  106. package/docs/api/player.telemetrypluginsettings.md +4 -1
  107. package/docs/api/player.telemetrypluginsettings.send.md +3 -0
  108. package/docs/api/player.telemetryrecord.md +3 -0
  109. package/docs/api/player.thumbnails.md +21 -139
  110. package/docs/api/player.thumbnailspluginsettings.md +23 -0
  111. package/docs/api/player.volumefade.md +1 -0
  112. package/docs/api/player.volumefadeevents.md +7 -0
  113. package/docs/api/player.watcheventdata.event.md +3 -0
  114. package/docs/api/player.watcheventdata.md +7 -0
  115. package/docs/api/player.zeptoresult.md +1 -0
  116. package/lib/Player.d.ts +5 -3
  117. package/lib/Player.d.ts.map +1 -1
  118. package/lib/Player.js +30 -6
  119. package/lib/index.plugins.d.ts +0 -1
  120. package/lib/index.plugins.d.ts.map +1 -1
  121. package/lib/index.plugins.js +0 -1
  122. package/lib/internal.types.d.ts +7 -7
  123. package/lib/internal.types.d.ts.map +1 -1
  124. package/lib/plugins/audio-selector/AudioSelector.d.ts +28 -6
  125. package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
  126. package/lib/plugins/audio-selector/AudioSelector.js +52 -22
  127. package/lib/plugins/big-mute-button/BigMuteButton.d.ts +18 -2
  128. package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
  129. package/lib/plugins/big-mute-button/BigMuteButton.js +21 -16
  130. package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -0
  131. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  132. package/lib/plugins/bottom-gear/BottomGear.js +1 -0
  133. package/lib/plugins/clappr-stats/ClapprStats.d.ts +31 -8
  134. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
  135. package/lib/plugins/clappr-stats/ClapprStats.js +24 -0
  136. package/lib/plugins/clappr-stats/types.d.ts +12 -0
  137. package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
  138. package/lib/plugins/clappr-stats/types.js +3 -0
  139. package/lib/plugins/click-to-pause/ClickToPause.d.ts +13 -1
  140. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  141. package/lib/plugins/click-to-pause/ClickToPause.js +14 -4
  142. package/lib/plugins/clips/Clips.d.ts +34 -2
  143. package/lib/plugins/clips/Clips.d.ts.map +1 -1
  144. package/lib/plugins/clips/Clips.js +51 -22
  145. package/lib/plugins/context-menu/ContextMenu.d.ts +44 -13
  146. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
  147. package/lib/plugins/context-menu/ContextMenu.js +48 -36
  148. package/lib/plugins/dvr-controls/DvrControls.d.ts +1 -3
  149. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  150. package/lib/plugins/dvr-controls/DvrControls.js +11 -28
  151. package/lib/plugins/error-screen/ErrorScreen.d.ts +0 -1
  152. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  153. package/lib/plugins/error-screen/ErrorScreen.js +0 -1
  154. package/lib/plugins/favicon/Favicon.d.ts +4 -0
  155. package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
  156. package/lib/plugins/favicon/Favicon.js +4 -0
  157. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +4 -0
  158. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -1
  159. package/lib/plugins/google-analytics/GoogleAnalytics.js +5 -1
  160. package/lib/plugins/index.d.ts +0 -1
  161. package/lib/plugins/index.d.ts.map +1 -1
  162. package/lib/plugins/index.js +0 -1
  163. package/lib/plugins/logo/Logo.d.ts +4 -0
  164. package/lib/plugins/logo/Logo.d.ts.map +1 -1
  165. package/lib/plugins/logo/Logo.js +4 -0
  166. package/lib/plugins/media-control/MediaControl.d.ts +1 -1
  167. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  168. package/lib/plugins/media-control/MediaControl.js +3 -1
  169. package/lib/plugins/multi-camera/MultiCamera.d.ts +4 -0
  170. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
  171. package/lib/plugins/multi-camera/MultiCamera.js +6 -2
  172. package/lib/plugins/seek-time/SeekTime.d.ts +4 -0
  173. package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
  174. package/lib/plugins/seek-time/SeekTime.js +6 -2
  175. package/lib/plugins/share/Share.d.ts +3 -0
  176. package/lib/plugins/share/Share.d.ts.map +1 -1
  177. package/lib/plugins/share/Share.js +4 -1
  178. package/lib/plugins/skip-time/SkipTime.d.ts +3 -0
  179. package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
  180. package/lib/plugins/skip-time/SkipTime.js +3 -0
  181. package/lib/plugins/telemetry/Telemetry.d.ts +18 -0
  182. package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -1
  183. package/lib/plugins/telemetry/Telemetry.js +1 -0
  184. package/lib/plugins/thumbnails/Thumbnails.d.ts +48 -3
  185. package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -1
  186. package/lib/plugins/thumbnails/Thumbnails.js +52 -18
  187. package/lib/plugins/volume-fade/VolumeFade.d.ts +5 -0
  188. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  189. package/lib/plugins/volume-fade/VolumeFade.js +5 -0
  190. package/lib/types.d.ts +9 -1
  191. package/lib/types.d.ts.map +1 -1
  192. package/lib/utils/types.d.ts +1 -0
  193. package/lib/utils/types.d.ts.map +1 -1
  194. package/package.json +1 -1
  195. package/release_notes +297 -0
  196. package/src/Player.ts +101 -46
  197. package/src/__tests__/Player.test.ts +23 -1
  198. package/src/index.plugins.ts +0 -1
  199. package/src/internal.types.ts +86 -79
  200. package/src/plugins/audio-selector/AudioSelector.ts +227 -154
  201. package/src/plugins/big-mute-button/BigMuteButton.ts +100 -79
  202. package/src/plugins/bottom-gear/BottomGear.ts +1 -0
  203. package/src/plugins/clappr-stats/ClapprStats.ts +32 -8
  204. package/src/plugins/clappr-stats/types.ts +13 -0
  205. package/src/plugins/click-to-pause/ClickToPause.ts +47 -36
  206. package/src/plugins/clips/Clips.ts +127 -71
  207. package/src/plugins/context-menu/ContextMenu.ts +109 -76
  208. package/src/plugins/dvr-controls/DvrControls.ts +11 -30
  209. package/src/plugins/error-screen/ErrorScreen.ts +0 -1
  210. package/src/plugins/favicon/Favicon.ts +4 -0
  211. package/src/plugins/google-analytics/GoogleAnalytics.ts +5 -1
  212. package/src/plugins/index.ts +0 -1
  213. package/src/plugins/logo/Logo.ts +4 -0
  214. package/src/plugins/media-control/MediaControl.ts +4 -1
  215. package/src/plugins/multi-camera/MultiCamera.ts +6 -2
  216. package/src/plugins/seek-time/SeekTime.ts +6 -2
  217. package/src/plugins/share/Share.ts +4 -1
  218. package/src/plugins/skip-time/SkipTime.ts +3 -0
  219. package/src/plugins/telemetry/Telemetry.ts +18 -0
  220. package/src/plugins/thumbnails/Thumbnails.ts +268 -194
  221. package/src/plugins/volume-fade/VolumeFade.ts +5 -0
  222. package/src/types.ts +11 -1
  223. package/src/utils/types.ts +1 -0
  224. package/temp/player.api.json +627 -2468
  225. package/tsconfig.tsbuildinfo +1 -1
  226. package/docs/api/player.audioselector.events.md +0 -17
  227. package/docs/api/player.audioselector.hideselecttrackmenu.md +0 -18
  228. package/docs/api/player.audioselector.name.md +0 -14
  229. package/docs/api/player.audioselector.onshowlevelselectmenu.md +0 -18
  230. package/docs/api/player.audioselector.render.md +0 -18
  231. package/docs/api/player.audioselector.supportedversion.md +0 -16
  232. package/docs/api/player.audioselector.template.md +0 -14
  233. package/docs/api/player.audioselector.togglecontextmenu.md +0 -18
  234. package/docs/api/player.audioselector.unbindevents.md +0 -18
  235. package/docs/api/player.audioselector.version.md +0 -14
  236. package/docs/api/player.bigmutebutton.bindevents.md +0 -18
  237. package/docs/api/player.bigmutebutton.events.md +0 -17
  238. package/docs/api/player.bigmutebutton.name.md +0 -14
  239. package/docs/api/player.bigmutebutton.render.md +0 -18
  240. package/docs/api/player.bigmutebutton.supportedversion.md +0 -16
  241. package/docs/api/player.bigmutebutton.template.md +0 -14
  242. package/docs/api/player.clapprstats._buildreport.md +0 -18
  243. package/docs/api/player.clapprstats._defaultreport.md +0 -52
  244. package/docs/api/player.clapprstats._playbackname.md +0 -14
  245. package/docs/api/player.clapprstats._playbacktype.md +0 -14
  246. package/docs/api/player.clapprstats.bindevents.md +0 -18
  247. package/docs/api/player.clapprstats.destroy.md +0 -18
  248. package/docs/api/player.clapprstats.name.md +0 -14
  249. package/docs/api/player.clapprstats.onfirstplaying.md +0 -18
  250. package/docs/api/player.clapprstats.playafterpause.md +0 -18
  251. package/docs/api/player.clapprstats.starttimers.md +0 -18
  252. package/docs/api/player.clapprstats.stopreporting.md +0 -18
  253. package/docs/api/player.clapprstats.supportedversion.md +0 -16
  254. package/docs/api/player.clicktopause.bindevents.md +0 -15
  255. package/docs/api/player.clicktopause.config.md +0 -11
  256. package/docs/api/player.clicktopause.name.md +0 -11
  257. package/docs/api/player.clicktopause.supportedversion.md +0 -13
  258. package/docs/api/player.clipsplugin.attributes.md +0 -13
  259. package/docs/api/player.clipsplugin.bindevents.md +0 -15
  260. package/docs/api/player.clipsplugin.makesvg.md +0 -49
  261. package/docs/api/player.clipsplugin.name.md +0 -11
  262. package/docs/api/player.clipsplugin.unbindevents.md +0 -15
  263. package/docs/api/player.contextmenu.attributes.md +0 -13
  264. package/docs/api/player.contextmenu.bindevents.md +0 -15
  265. package/docs/api/player.contextmenu.destroy.md +0 -15
  266. package/docs/api/player.contextmenu.events.md +0 -13
  267. package/docs/api/player.contextmenu.exposeversion.md +0 -14
  268. package/docs/api/player.contextmenu.label.md +0 -11
  269. package/docs/api/player.contextmenu.mediacontrol.md +0 -11
  270. package/docs/api/player.contextmenu.name.md +0 -11
  271. package/docs/api/player.contextmenu.render.md +0 -15
  272. package/docs/api/player.contextmenu.supportedversion.md +0 -13
  273. package/docs/api/player.contextmenu.template.md +0 -11
  274. package/docs/api/player.contextmenu.url.md +0 -11
  275. package/docs/api/player.disablecontrols.bindevents.md +0 -15
  276. package/docs/api/player.disablecontrols.container.md +0 -11
  277. package/docs/api/player.disablecontrols.md +0 -138
  278. package/docs/api/player.disablecontrols.name.md +0 -11
  279. package/docs/api/player.disablecontrols.supportedversion.md +0 -13
  280. package/docs/api/player.disablecontrols.unbindevents.md +0 -15
  281. package/docs/api/player.thumbnails.attributes.md +0 -13
  282. package/docs/api/player.thumbnails.bindevents.md +0 -15
  283. package/docs/api/player.thumbnails.name.md +0 -11
  284. package/docs/api/player.thumbnails.settext.md +0 -49
  285. package/docs/api/player.thumbnails.supportedversion.md +0 -13
  286. package/docs/api/player.thumbnails.template.md +0 -11
  287. package/src/plugins/disable-controls/DisableControls.ts +0 -81
  288. package/src/plugins/ga-events/GaEvents.js +0 -395
  289. package/src/plugins/ga-events/ga-tracking.js +0 -46
package/dist/index.js CHANGED
@@ -42494,7 +42494,7 @@ class Player {
42494
42494
  Log.setLevel(0);
42495
42495
  }
42496
42496
  const coreOpts = this.buildCoreOptions(playerElement);
42497
- const { core, container } = Loader.registeredPlugins;
42497
+ const { core, container } = Player.getRegisteredPlugins();
42498
42498
  trace(`${T$d} init`, {
42499
42499
  registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.name),
42500
42500
  });
@@ -42656,13 +42656,35 @@ class Player {
42656
42656
  * ```
42657
42657
  */
42658
42658
  static registerPlugin(plugin) {
42659
+ assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
42660
+ if (plugin.type === 'core') {
42661
+ if (plugin.prototype.name === 'media_control') {
42662
+ Player.corePlugins.unshift(plugin);
42663
+ }
42664
+ else {
42665
+ Player.corePlugins.push(plugin);
42666
+ }
42667
+ return;
42668
+ }
42659
42669
  Loader.registerPlugin(plugin);
42660
42670
  }
42671
+ static getRegisteredPlugins() {
42672
+ for (const plugin of Player.corePlugins) {
42673
+ Loader.registerPlugin(plugin);
42674
+ }
42675
+ return Loader.registeredPlugins;
42676
+ }
42677
+ static corePlugins = [];
42661
42678
  /**
42662
42679
  * Unregisters a plugin registered earlier with {@link Player.registerPlugin}.
42663
42680
  * @param plugin - a plugin class
42664
42681
  */
42665
42682
  static unregisterPlugin(plugin) {
42683
+ assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
42684
+ if (plugin.type === 'core') {
42685
+ Player.corePlugins = Player.corePlugins.filter((p) => p !== plugin);
42686
+ return;
42687
+ }
42666
42688
  Loader.unregisterPlugin(plugin);
42667
42689
  }
42668
42690
  setConfig(config) {
@@ -42803,8 +42825,10 @@ class Player {
42803
42825
  }, null);
42804
42826
  }
42805
42827
  bindCoreListeners() {
42806
- const core = this.player?.core;
42807
- core?.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42828
+ // TODO create an class inherited from PlayerClappr
42829
+ assert.ok(this.player, 'Player is not initialized');
42830
+ const core = this.player.core;
42831
+ core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42808
42832
  trace(`${T$d} on CORE_SCREEN_ORIENTATION_CHANGED`, {
42809
42833
  orientation,
42810
42834
  rootNode: {
@@ -42819,14 +42843,14 @@ class Player {
42819
42843
  });
42820
42844
  }
42821
42845
  }, null);
42822
- core?.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42846
+ core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42823
42847
  trace(`${T$d} on CORE_RESIZE`, {
42824
42848
  width,
42825
42849
  height,
42826
42850
  });
42827
42851
  this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
42828
42852
  }, null);
42829
- core?.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42853
+ core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42830
42854
  trace(`${T$d} CORE_FULLSCREEN`, {
42831
42855
  isFullscreen,
42832
42856
  });
@@ -42835,7 +42859,7 @@ class Player {
42835
42859
  }
42836
42860
  }
42837
42861
 
42838
- var version$1 = "2.20.1";
42862
+ var version$1 = "2.20.4";
42839
42863
 
42840
42864
  var packages = {
42841
42865
  "node_modules/@clappr/core": {
@@ -42867,38 +42891,57 @@ const VERSION$6 = '0.0.1';
42867
42891
  // const T = 'plugins.audio_selector';
42868
42892
  const AUTO = 0;
42869
42893
  /**
42894
+ * Adds an audio track selector to the media control UI.
42870
42895
  * @beta
42871
42896
  */
42872
42897
  class AudioSelector extends UICorePlugin {
42898
+ // TODO
42873
42899
  selectedTrackId;
42874
42900
  currentTrack = null;
42875
42901
  tracks = [];
42902
+ /**
42903
+ * @internal
42904
+ */
42876
42905
  get name() {
42877
- return 'media_control_audio_selector';
42906
+ return 'audio_selector';
42878
42907
  }
42908
+ /**
42909
+ * @internal
42910
+ */
42879
42911
  get supportedVersion() {
42880
42912
  return { min: CLAPPR_VERSION };
42881
42913
  }
42914
+ /**
42915
+ * @internal
42916
+ */
42882
42917
  static get version() {
42883
42918
  return VERSION$6;
42884
42919
  }
42885
- get template() {
42886
- return tmpl(pluginHtml$8);
42887
- }
42920
+ static template = tmpl(pluginHtml$8);
42921
+ /**
42922
+ * @internal
42923
+ */
42888
42924
  get attributes() {
42889
42925
  return {
42890
- 'class': this.name,
42891
- 'data-track-selector': ''
42926
+ class: this.name,
42927
+ 'data-track-selector': '',
42892
42928
  };
42893
42929
  }
42930
+ /**
42931
+ * @internal
42932
+ */
42894
42933
  get events() {
42895
42934
  return {
42896
42935
  'click [data-track-selector-select]': 'onTrackSelect',
42897
- 'click [data-track-selector-button]': 'onShowLevelSelectMenu'
42936
+ 'click [data-track-selector-button]': 'onShowLevelSelectMenu',
42898
42937
  };
42899
42938
  }
42939
+ /**
42940
+ * @internal
42941
+ */
42900
42942
  bindEvents() {
42901
42943
  this.listenTo(this.core, Events$1.CORE_READY, this.bindPlaybackEvents);
42944
+ // TODO CORE_ACTIVE_CONTAINER_CHANGED
42902
42945
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.reload);
42903
42946
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.render);
42904
42947
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_HIDE, this.hideSelectTrackMenu);
@@ -42939,12 +42982,12 @@ class AudioSelector extends UICorePlugin {
42939
42982
  if (defaultTrack) {
42940
42983
  this.currentTrack = {
42941
42984
  id: defaultTrack.id,
42942
- label: defaultTrack.name
42985
+ label: defaultTrack.name,
42943
42986
  };
42944
42987
  }
42945
- this.fillTracks(data.audioTracks.map(p => ({
42988
+ this.fillTracks(data.audioTracks.map((p) => ({
42946
42989
  id: p.id,
42947
- label: p.name
42990
+ label: p.name,
42948
42991
  })), defaultTrack?.id);
42949
42992
  });
42950
42993
  currentPlayback._hls.on(Events.AUDIO_TRACK_SWITCHING, this.startTrackSwitch.bind(this));
@@ -42990,23 +43033,30 @@ class AudioSelector extends UICorePlugin {
42990
43033
  if (!currentPlayback) {
42991
43034
  return false;
42992
43035
  }
42993
- const { audioTracks } = (currentPlayback.activePlayback._hls || currentPlayback.$el.get(0));
43036
+ const { audioTracks } = currentPlayback.activePlayback._hls || currentPlayback.$el.get(0);
42994
43037
  this.tracks = audioTracks;
42995
43038
  // Only care if we have at least 2 to choose from
42996
43039
  return this.tracks && this.tracks.length > 1;
42997
43040
  }
43041
+ /**
43042
+ * @internal
43043
+ */
42998
43044
  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();
43045
+ if (!this.shouldRender()) {
43046
+ return this;
43047
+ }
43048
+ const mediaControl = this.core.getPlugin('media_control');
43049
+ assert(mediaControl, 'media_control plugin is required');
43050
+ this.$el.html(AudioSelector.template({ tracks: this.tracks, title: this.getTitle() }));
43051
+ const ats = mediaControl.getElement('audioTracksSelector');
43052
+ if (!(ats && ats.length > 0)) {
43053
+ return this;
43006
43054
  }
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);
43055
+ ats.append(this.el);
43056
+ this.highlightCurrentTrack();
43057
+ const aa = ats.find('audioArrow');
43058
+ if (aa.length > 0) {
43059
+ aa.append(audioArrow);
43010
43060
  }
43011
43061
  return this;
43012
43062
  }
@@ -43070,7 +43120,8 @@ class AudioSelector extends UICorePlugin {
43070
43120
  return this.$('.audio_selector button .audio-text');
43071
43121
  }
43072
43122
  trackElement(id) {
43073
- return this.$('.audio_selector ul a' + (id !== undefined ? '[data-track-selector-select="' + id + '"]' : '')).parent();
43123
+ return this.$('.audio_selector ul a' +
43124
+ (id !== undefined ? '[data-track-selector-select="' + id + '"]' : '')).parent();
43074
43125
  }
43075
43126
  getTitle() {
43076
43127
  if (!this.tracks) {
@@ -43141,8 +43192,11 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
43141
43192
 
43142
43193
  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
43194
 
43144
- const T$c = "plugins.big_mute_button";
43195
+ const T$c = 'plugins.big_mute_button';
43196
+ // TODO rewrite as a container plugin
43145
43197
  /**
43198
+ * Displays a big mute button over the video when it's muted.
43199
+ * Once pressed, it unmutes the video.
43146
43200
  * @beta
43147
43201
  */
43148
43202
  class BigMuteButton extends UICorePlugin {
@@ -43150,21 +43204,31 @@ class BigMuteButton extends UICorePlugin {
43150
43204
  _adIsPlaying = false;
43151
43205
  $bigMuteBtnContainer = null;
43152
43206
  $bigMuteButton = null;
43207
+ /**
43208
+ * @internal
43209
+ */
43153
43210
  get name() {
43154
43211
  return 'big_mute_button';
43155
43212
  }
43213
+ /**
43214
+ * @internal
43215
+ */
43156
43216
  get supportedVersion() {
43157
43217
  return { min: CLAPPR_VERSION };
43158
43218
  }
43159
- get template() {
43160
- return tmpl(pluginHtml$7);
43161
- }
43219
+ static template = tmpl(pluginHtml$7);
43220
+ /**
43221
+ * @internal
43222
+ */
43162
43223
  get events() {
43163
43224
  return {
43164
43225
  'click .big-mute-icon': 'handleBigMuteBtnClick',
43165
43226
  'click .big-mute-icon-wrapper': 'destroyBigMuteBtn',
43166
43227
  };
43167
43228
  }
43229
+ /**
43230
+ * @internal
43231
+ */
43168
43232
  bindEvents() {
43169
43233
  super.bindEvents();
43170
43234
  this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
@@ -43175,17 +43239,6 @@ class BigMuteButton extends UICorePlugin {
43175
43239
  });
43176
43240
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
43177
43241
  }
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
43242
  onCoreReady() {
43190
43243
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_VOLUME, this.onContainerVolume);
43191
43244
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_READY, this.onContainerStart);
@@ -43242,12 +43295,15 @@ class BigMuteButton extends UICorePlugin {
43242
43295
  });
43243
43296
  return autoPlay && !wasMuted && volume === 0;
43244
43297
  }
43298
+ /**
43299
+ * @internal
43300
+ */
43245
43301
  render() {
43246
43302
  if (this.shouldRender()) {
43247
43303
  trace(`${T$c} render`, {
43248
43304
  el: !!this.$el,
43249
43305
  });
43250
- this.$el.html(this.template());
43306
+ this.$el.html(BigMuteButton.template());
43251
43307
  this.$bigMuteBtnContainer = this.$el.find('.big-mute-icon-wrapper[data-big-mute]');
43252
43308
  this._adIsPlaying && this.$bigMuteBtnContainer.addClass('hide');
43253
43309
  this.$bigMuteButton = this.$bigMuteBtnContainer.find('.big-mute-icon');
@@ -43293,6 +43349,7 @@ const VERSION$5 = '2.19.12';
43293
43349
  const T$b = 'plugins.bottom_gear';
43294
43350
  /**
43295
43351
  * Custom events emitted by the plugin
43352
+ * @beta
43296
43353
  */
43297
43354
  var GearEvents;
43298
43355
  (function (GearEvents) {
@@ -44490,6 +44547,9 @@ function requireMousetrap () {
44490
44547
  var mousetrapExports = requireMousetrap();
44491
44548
  const Mousetrap = /*@__PURE__*/getDefaultExportFromCjs$1(mousetrapExports);
44492
44549
 
44550
+ /**
44551
+ * @beta
44552
+ */
44493
44553
  var ClapprStatsEvents;
44494
44554
  (function (ClapprStatsEvents) {
44495
44555
  ClapprStatsEvents["REPORT_EVENT"] = "clappr:stats:report";
@@ -45823,7 +45883,10 @@ function newMetrics() {
45823
45883
  // TODO: fix
45824
45884
  const updateMetrics = () => { };
45825
45885
  /**
45886
+ * Collects useful statistics about playback performance.
45826
45887
  * @beta
45888
+ * @remarks
45889
+ * This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
45827
45890
  */
45828
45891
  class ClapprStats extends ContainerPlugin {
45829
45892
  bwMeasureCount = 0;
@@ -45845,9 +45908,15 @@ class ClapprStats extends ContainerPlugin {
45845
45908
  updateFn = updateMetrics;
45846
45909
  urisToMeasureBandwidth;
45847
45910
  uriToMeasureLatency;
45911
+ /**
45912
+ * @internal
45913
+ */
45848
45914
  get name() {
45849
45915
  return 'clappr_stats';
45850
45916
  }
45917
+ /**
45918
+ * @internal
45919
+ */
45851
45920
  get supportedVersion() {
45852
45921
  return { min: CLAPPR_VERSION };
45853
45922
  }
@@ -45875,6 +45944,10 @@ class ClapprStats extends ContainerPlugin {
45875
45944
  // this._metrics.timers[timer] += this._now() - this[`_start${timer}`];
45876
45945
  this.metrics.timers[timer] += this._now() - this.timers[timer];
45877
45946
  }
45947
+ /**
45948
+ * Registers a callback to receive the metrics.
45949
+ * @param updateMetricsFn
45950
+ */
45878
45951
  setUpdateMetrics(updateMetricsFn) {
45879
45952
  this.updateFn = updateMetricsFn;
45880
45953
  }
@@ -45893,6 +45966,9 @@ class ClapprStats extends ContainerPlugin {
45893
45966
  calls: []
45894
45967
  };
45895
45968
  }
45969
+ /**
45970
+ * @internal
45971
+ */
45896
45972
  bindEvents() {
45897
45973
  this.listenTo(this.container, Events$1.CONTAINER_BITRATE, this.onBitrate);
45898
45974
  this.listenTo(this.container, Events$1.CONTAINER_STOP, this.stopReporting);
@@ -45911,10 +45987,17 @@ class ClapprStats extends ContainerPlugin {
45911
45987
  this.listenTo(this.container.playback, Events$1.PLAYBACK_PROGRESS, this.onProgress);
45912
45988
  this.listenTo(this.container.playback, Events$1.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
45913
45989
  }
45990
+ /**
45991
+ * @internal
45992
+ */
45914
45993
  destroy() {
45915
45994
  this.stopReporting();
45916
45995
  super.destroy();
45917
45996
  }
45997
+ /**
45998
+ * Returns the collected metrics.
45999
+ * @returns The collected metrics
46000
+ */
45918
46001
  exportMetrics() {
45919
46002
  return structuredClone(this.metrics);
45920
46003
  }
@@ -45936,6 +46019,7 @@ class ClapprStats extends ContainerPlugin {
45936
46019
  this.intervalId = null;
45937
46020
  }
45938
46021
  this._newMetrics();
46022
+ // TODO
45939
46023
  // @ts-ignore
45940
46024
  this.stopListening();
45941
46025
  this.bindEvents();
@@ -46153,20 +46237,30 @@ class ClapprStats extends ContainerPlugin {
46153
46237
 
46154
46238
  //Copyright 2014 Globo.com Player authors. All rights reserved.
46155
46239
  // Use of this source code is governed by a BSD-style
46156
- // license that can be found in the LICENSE file.
46240
+ // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
46157
46241
  const T$a = 'plugins.click_to_pause_custom';
46242
+ /**
46243
+ * Adds a behavior of toggling the playback state on click over the container
46244
+ * @beta
46245
+ */
46158
46246
  class ClickToPause extends ContainerPlugin {
46159
46247
  pointerEnabled = false;
46160
46248
  timer = null;
46249
+ /**
46250
+ * @internal
46251
+ */
46161
46252
  get name() {
46162
46253
  return 'click_to_pause_custom';
46163
46254
  }
46255
+ /**
46256
+ * @internal
46257
+ */
46164
46258
  get supportedVersion() {
46165
46259
  return { min: CLAPPR_VERSION };
46166
46260
  }
46167
- get config() {
46168
- return this.container.options.clickToPauseConfig || {};
46169
- }
46261
+ /**
46262
+ * @internal
46263
+ */
46170
46264
  bindEvents() {
46171
46265
  this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.click);
46172
46266
  this.listenTo(this.container, Events$1.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
@@ -46282,23 +46376,45 @@ function getPageX(event) {
46282
46376
  return 0;
46283
46377
  }
46284
46378
 
46379
+ /**
46380
+ * Adds a behavior of showing a text over the seekbar to indicate the current clip.
46381
+ * @beta
46382
+ * @remarks
46383
+ * Depends on:
46384
+ *
46385
+ * - {@link MediaControl}
46386
+ *
46387
+ * Configuration options - {@link ClipsPluginSettings}
46388
+ */
46285
46389
  class ClipsPlugin extends UICorePlugin {
46286
46390
  clips = new Map();
46287
46391
  duration = 0;
46288
46392
  durationGetting = false;
46289
46393
  _oldContainer;
46290
46394
  svgMask = null;
46395
+ /**
46396
+ * @internal
46397
+ */
46291
46398
  get name() {
46292
- return 'media_control_clips';
46399
+ return 'clips';
46293
46400
  }
46401
+ /**
46402
+ * @internal
46403
+ */
46294
46404
  get attributes() {
46295
46405
  return {
46296
- 'class': this.name
46406
+ class: this.name,
46297
46407
  };
46298
46408
  }
46409
+ /**
46410
+ * @internal
46411
+ */
46299
46412
  bindEvents() {
46413
+ const mediaControl = this.core.getPlugin('media_control');
46414
+ assert(mediaControl, 'media_control plugin is required');
46300
46415
  this.listenToOnce(this.core, Events$1.CORE_READY, this._onCoreReady);
46301
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
46416
+ // TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
46417
+ this.listenTo(mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
46302
46418
  this.listenTo(this.core, Events$1.CORE_RESIZE, this.playerResize);
46303
46419
  }
46304
46420
  _onCoreReady() {
@@ -46308,12 +46424,6 @@ class ClipsPlugin extends UICorePlugin {
46308
46424
  }
46309
46425
  this.parseClips();
46310
46426
  }
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
46427
  _onMediaControlContainerChanged() {
46318
46428
  this._bindContainerEvents();
46319
46429
  }
@@ -46327,9 +46437,10 @@ class ClipsPlugin extends UICorePlugin {
46327
46437
  if (this._oldContainer) {
46328
46438
  this.stopListening(this._oldContainer, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
46329
46439
  }
46330
- this._oldContainer = this.core.mediaControl.container;
46440
+ const mediaControl = this.core.getPlugin('media_control');
46441
+ this._oldContainer = mediaControl.container;
46331
46442
  this.durationGetting = false;
46332
- this.listenTo(this.core.mediaControl.container, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
46443
+ this.listenTo(mediaControl.container, Events$1.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
46333
46444
  }
46334
46445
  onTimeUpdate(event) {
46335
46446
  if (!this.durationGetting) {
@@ -46346,13 +46457,17 @@ class ClipsPlugin extends UICorePlugin {
46346
46457
  }
46347
46458
  parseClips() {
46348
46459
  const textArr = this.options.clips.text.split('\n');
46349
- const clipsArr = textArr.map((val) => {
46460
+ const clipsArr = textArr
46461
+ .map((val) => {
46350
46462
  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);
46463
+ return matchRes
46464
+ ? {
46465
+ start: strtimeToMiliseconds(matchRes[1]),
46466
+ text: matchRes[2],
46467
+ }
46468
+ : null;
46469
+ })
46470
+ .filter((clip) => clip !== null);
46356
46471
  clipsArr.sort((a, b) => a.start - b.start);
46357
46472
  clipsArr.forEach((clip, index) => {
46358
46473
  this.clips.set(clip.start, {
@@ -46363,6 +46478,11 @@ class ClipsPlugin extends UICorePlugin {
46363
46478
  });
46364
46479
  });
46365
46480
  }
46481
+ /**
46482
+ * Returns the text of the current clip.
46483
+ * @param time - The current time of the player.
46484
+ * @returns The text of the current clip.
46485
+ */
46366
46486
  getText(time) {
46367
46487
  for (const [key, value] of this.clips.entries()) {
46368
46488
  if (time >= value.start && time < value.end) {
@@ -46373,14 +46493,14 @@ class ClipsPlugin extends UICorePlugin {
46373
46493
  }
46374
46494
  makeSvg(duration) {
46375
46495
  let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
46376
- const widthOfSeek = this.core.mediaControl.container.$el.width();
46496
+ const widthOfSeek = this.core.activeContainer.$el.width();
46377
46497
  let finishValue = 0;
46378
- this.clips.forEach(val => {
46498
+ this.clips.forEach((val) => {
46379
46499
  let end = val.end;
46380
46500
  if (!end) {
46381
46501
  end = val.end = duration;
46382
46502
  }
46383
- const widthChunk = (end - val.start) * widthOfSeek / duration;
46503
+ const widthChunk = ((end - val.start) * widthOfSeek) / duration;
46384
46504
  svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
46385
46505
  finishValue += widthChunk;
46386
46506
  });
@@ -46393,7 +46513,8 @@ class ClipsPlugin extends UICorePlugin {
46393
46513
  if (this.svgMask) {
46394
46514
  this.svgMask.remove();
46395
46515
  }
46396
- const $seekBarContainer = this.core.mediaControl.getElement('seekBarContainer');
46516
+ const mediaControl = this.core.getPlugin('media_control');
46517
+ const $seekBarContainer = mediaControl.getElement('seekBarContainer');
46397
46518
  if ($seekBarContainer?.get(0)) {
46398
46519
  $seekBarContainer.addClass('clips');
46399
46520
  }
@@ -46401,7 +46522,8 @@ class ClipsPlugin extends UICorePlugin {
46401
46522
  $seekBarContainer?.append(this.svgMask);
46402
46523
  }
46403
46524
  setClipText(text) {
46404
- const $clipText = this.core.mediaControl.getElement('clipText');
46525
+ const mediaControl = this.core.getPlugin('media_control');
46526
+ const $clipText = mediaControl.getElement('clipText');
46405
46527
  if ($clipText && text) {
46406
46528
  $clipText.show();
46407
46529
  $clipText.text(`${text}`);
@@ -46411,28 +46533,37 @@ class ClipsPlugin extends UICorePlugin {
46411
46533
 
46412
46534
  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
46535
 
46414
- class ContextMenu extends UICorePlugin {
46536
+ /**
46537
+ * Displays a small context menu when clicked on the player container.
46538
+ * @beta
46539
+ * @remarks
46540
+ * Configuration options - {@link ContextMenuPluginSettings}
46541
+ */
46542
+ class ContextMenu extends UIContainerPlugin {
46415
46543
  _label = '';
46416
46544
  _url = '';
46417
- container = null;
46418
46545
  menuOptions = [];
46546
+ /**
46547
+ * @internal
46548
+ */
46419
46549
  get name() {
46420
46550
  return 'context_menu';
46421
46551
  }
46552
+ /**
46553
+ * @internal
46554
+ */
46422
46555
  get supportedVersion() {
46423
46556
  return { min: CLAPPR_VERSION };
46424
46557
  }
46558
+ /**
46559
+ * @internal
46560
+ */
46425
46561
  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);
46562
+ return { class: 'context-menu' };
46433
46563
  }
46564
+ static template = tmpl(templateHtml$1);
46434
46565
  get label() {
46435
- return this._label || 'Gcore player ver. ' + process.env.VERSION;
46566
+ return this._label || 'Gcore player ver. ' + version().gplayer;
46436
46567
  }
46437
46568
  get url() {
46438
46569
  return this._url || 'https://gcore.com/';
@@ -46440,16 +46571,19 @@ class ContextMenu extends UICorePlugin {
46440
46571
  get exposeVersion() {
46441
46572
  return {
46442
46573
  label: this.label,
46443
- name: 'version'
46574
+ name: 'version',
46444
46575
  };
46445
46576
  }
46577
+ /**
46578
+ * @internal
46579
+ */
46446
46580
  get events() {
46447
46581
  return {
46448
- 'click [data-version]': 'onOpenMainPage'
46582
+ 'click [data-version]': 'onOpenMainPage',
46449
46583
  };
46450
46584
  }
46451
- constructor(core) {
46452
- super(core);
46585
+ constructor(container) {
46586
+ super(container);
46453
46587
  if (this.options.contextMenu && this.options.contextMenu.label) {
46454
46588
  this._label = this.options.contextMenu.label;
46455
46589
  }
@@ -46459,28 +46593,21 @@ class ContextMenu extends UICorePlugin {
46459
46593
  this.render();
46460
46594
  this.bindEvents();
46461
46595
  }
46596
+ /**
46597
+ * @internal
46598
+ */
46462
46599
  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));
46600
+ this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
46601
+ this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.hide);
46602
+ $('body').on('click', this.hideOnBodyClick);
46471
46603
  }
46604
+ /**
46605
+ * @internal
46606
+ */
46472
46607
  destroy() {
46473
- $('body').off('click', this.hide.bind(this));
46474
- // @ts-ignore
46475
- this.stopListening();
46608
+ $('body').off('click', this.hideOnBodyClick);
46476
46609
  return super.destroy();
46477
46610
  }
46478
- containerChanged() {
46479
- this.container = this.core.activeContainer;
46480
- // @ts-ignore
46481
- this.stopListening();
46482
- this.bindEvents();
46483
- }
46484
46611
  toggleContextMenu(event) {
46485
46612
  event.preventDefault();
46486
46613
  const offset = this.container?.$el.offset();
@@ -46488,7 +46615,8 @@ class ContextMenu extends UICorePlugin {
46488
46615
  }
46489
46616
  show(top, left) {
46490
46617
  this.hide();
46491
- if (this.options.contextMenu && this.options.contextMenu.preventShowContextMenu) {
46618
+ if (this.options.contextMenu &&
46619
+ this.options.contextMenu.preventShowContextMenu) {
46492
46620
  return;
46493
46621
  }
46494
46622
  this.$el.css({ top, left });
@@ -46500,80 +46628,19 @@ class ContextMenu extends UICorePlugin {
46500
46628
  onOpenMainPage() {
46501
46629
  window.open(this.url, '_blank');
46502
46630
  }
46631
+ /**
46632
+ * @internal
46633
+ */
46503
46634
  render() {
46504
46635
  this.menuOptions = [this.exposeVersion];
46505
- this.$el.html(this.template({ options: this.menuOptions }));
46506
- this.core.$el.append(this.$el);
46636
+ this.$el.html(ContextMenu.template({ options: this.menuOptions }));
46637
+ this.container.$el.append(this.$el); // TODO append to the container, turn into a container plugin
46507
46638
  this.hide();
46508
- this.disable();
46509
46639
  return this;
46510
46640
  }
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
- }
46641
+ hideOnBodyClick = () => {
46642
+ this.hide();
46643
+ };
46577
46644
  }
46578
46645
 
46579
46646
  const dvrHTML = "<div class=\"live-info\"><%= live %></div>\n<button type=\"button\" class=\"live-button\" aria-label=\"<%= backToLive %>\"><%= backToLive %></button>\n";
@@ -46585,7 +46652,7 @@ const dvrHTML = "<div class=\"live-info\"><%= live %></div>\n<button type=\"butt
46585
46652
  * @remarks
46586
46653
  * Depends on:
46587
46654
  *
46588
- * - {@link MediaControl | media_control}
46655
+ * - {@link MediaControl}
46589
46656
  *
46590
46657
  * The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
46591
46658
  */
@@ -46595,7 +46662,7 @@ class DvrControls extends UICorePlugin {
46595
46662
  * @internal
46596
46663
  */
46597
46664
  get name() {
46598
- return 'media_control_dvr';
46665
+ return 'dvr_controls';
46599
46666
  }
46600
46667
  /**
46601
46668
  * @internal
@@ -46628,32 +46695,15 @@ class DvrControls extends UICorePlugin {
46628
46695
  * @internal
46629
46696
  */
46630
46697
  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
- }
46698
+ const mediaControl = this.core.getPlugin('media_control');
46699
+ assert(mediaControl, 'media_control plugin is required');
46700
+ this.listenTo(mediaControl, Events$1.MEDIACONTROL_RENDERED, this.settingsUpdate);
46701
+ this.listenTo(this.core, Events$1.CORE_OPTIONS_CHANGE, this.render);
46702
+ this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.bindContainerEvents);
46646
46703
  }
46647
46704
  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();
46705
+ this.listenToOnce(this.core.activeContainer, Events$1.CONTAINER_TIMEUPDATE, this.render);
46706
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.dvrChanged);
46657
46707
  }
46658
46708
  dvrChanged(dvrEnabled) {
46659
46709
  if (this.core.getPlaybackType() !== Playback.LIVE) {
@@ -46686,7 +46736,7 @@ class DvrControls extends UICorePlugin {
46686
46736
  settingsUpdate() {
46687
46737
  // @ts-ignore
46688
46738
  this.stopListening(); // TODO sort out
46689
- this.core.mediaControl.$el.removeClass('live');
46739
+ this.core.getPlugin('media_control').$el.removeClass('live'); // TODO don't access directly
46690
46740
  if (this.shouldRender()) {
46691
46741
  this.render();
46692
46742
  this.$el.click(() => this.click());
@@ -46706,7 +46756,7 @@ class DvrControls extends UICorePlugin {
46706
46756
  backToLive: this.core.i18n.t('back_to_live')
46707
46757
  }));
46708
46758
  if (this.shouldRender()) {
46709
- const mediaControl = this.core.mediaControl;
46759
+ const mediaControl = this.core.getPlugin('media_control');
46710
46760
  assert(mediaControl, 'media_control plugin is required');
46711
46761
  // TODO don't tap into the $el directly
46712
46762
  mediaControl.$el.addClass('live');
@@ -46726,7 +46776,6 @@ const T$9 = 'plugins.error_screen';
46726
46776
  /**
46727
46777
  * Displays a descriptive error in the overlay on top of the player.
46728
46778
  * @beta
46729
- * TODO
46730
46779
  */
46731
46780
  class ErrorScreen extends UICorePlugin {
46732
46781
  _retry = 0;
@@ -46909,6 +46958,10 @@ const stopIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\
46909
46958
  const FAVICON_COLOR = '#567';
46910
46959
  const FAVICON_SELECTOR = 'link[rel="shortcut icon"]';
46911
46960
  // const oldIcon = $(FAVICON_SELECTOR);
46961
+ /**
46962
+ * The plugin adds custom favicon to the player's tab.
46963
+ * @beta
46964
+ */
46912
46965
  class Favicon extends CorePlugin {
46913
46966
  _container = null;
46914
46967
  oldIcon;
@@ -47010,7 +47063,11 @@ class Favicon extends CorePlugin {
47010
47063
 
47011
47064
  // Copyright 2014 Globo.com Player authors. All rights reserved.
47012
47065
  // Use of this source code is governed by a BSD-style
47013
- // license that can be found in the LICENSE file.
47066
+ // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE
47067
+ /**
47068
+ * An example Google Analytics integration plugin
47069
+ * @beta
47070
+ */
47014
47071
  class GoogleAnalytics extends ContainerPlugin {
47015
47072
  account = '';
47016
47073
  trackerName = '';
@@ -47660,6 +47717,10 @@ function calculateSize(original) {
47660
47717
 
47661
47718
  const logoHTML = "<div class=\"clappr-logo control-need-disable\">\n <img class=\"clappr-logo-img\"/>\n</div>\n";
47662
47719
 
47720
+ /**
47721
+ * The plugin adds custom logo to the player.
47722
+ * @beta
47723
+ */
47663
47724
  class Logo extends UIContainerPlugin {
47664
47725
  hasStartedPlaying = false;
47665
47726
  $logoContainer = null;
@@ -47937,7 +47998,7 @@ class MediaControl extends UICorePlugin {
47937
47998
  return { min: CLAPPR_VERSION };
47938
47999
  }
47939
48000
  get disabled() {
47940
- const playbackIsNOOP = this.container && this.container.getPlaybackType() === Playback.NO_OP;
48001
+ const playbackIsNOOP = this.core.activeContainer && this.core.activeContainer.getPlaybackType() === Playback.NO_OP;
47941
48002
  return this.userDisabled || playbackIsNOOP;
47942
48003
  }
47943
48004
  /**
@@ -48618,6 +48679,8 @@ class MediaControl extends UICorePlugin {
48618
48679
  */
48619
48680
  getElement(name) {
48620
48681
  switch (name) {
48682
+ case 'audioTracksSelector':
48683
+ return this.$audioTracksSelector;
48621
48684
  case 'clipText':
48622
48685
  return this.$clipText;
48623
48686
  case 'bottomGear':
@@ -48922,7 +48985,11 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
48922
48985
  const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"50\" height=\"50\" viewBox=\"0 0 50 50\">\n <defs>\n <clipPath id=\"clip-Icon\">\n <rect width=\"50\" height=\"50\"/>\n </clipPath>\n </defs>\n <g id=\"Icon\" clip-path=\"url(#clip-Icon)\">\n <g id=\"icon2\" transform=\"translate(-0.041 0)\">\n <path id=\"Контур_77\" data-name=\"Контур 77\" d=\"M6.493,13v8.266h6.275V19.74H8.31V17.714h4.006V16.3H8.31V14.53h4.365V13Zm7.5,0v8.266h1.7V15.732h.023l3.438,5.534h1.818V13h-1.7v5.545h-.023L15.8,13Z\" fill=\"#fff\"/>\n <path id=\"Контур_76\" data-name=\"Контур 76\" d=\"M29.949,29.1V26.774H31.94a1.4,1.4,0,0,1,.938.272,1.1,1.1,0,0,1,.313.874,1.155,1.155,0,0,1-.313.9,1.375,1.375,0,0,1-.938.278ZM28.132,25.36v8.266h1.817V30.4h1.818a1.353,1.353,0,0,1,.984.3,1.637,1.637,0,0,1,.394.949c.046.333.079.681.1,1.042a3.2,3.2,0,0,0,.185.938h1.819a1.218,1.218,0,0,1-.191-.423,3.611,3.611,0,0,1-.093-.527c-.019-.185-.033-.367-.041-.544s-.016-.332-.023-.463a5.052,5.052,0,0,0-.087-.625,2.109,2.109,0,0,0-.2-.573,1.586,1.586,0,0,0-.359-.451,1.414,1.414,0,0,0-.556-.284v-.023a1.926,1.926,0,0,0,1-.81,2.494,2.494,0,0,0,.307-1.262,2.308,2.308,0,0,0-.165-.88,2.128,2.128,0,0,0-.486-.724,2.3,2.3,0,0,0-.764-.492,2.67,2.67,0,0,0-1-.179ZM43.506,30.5V25.36H41.689V30.5a2.065,2.065,0,0,1-.37,1.36,1.7,1.7,0,0,1-1.343.434,2.086,2.086,0,0,1-.886-.156,1.283,1.283,0,0,1-.758-.978,3.748,3.748,0,0,1-.058-.66V25.36H36.456V30.5a3.16,3.16,0,0,0,.92,2.5,3.807,3.807,0,0,0,2.6.81,3.82,3.82,0,0,0,2.593-.816,3.132,3.132,0,0,0,.937-2.492Z\" fill=\"#fff\"/>\n <path id=\"Контур_80\" data-name=\"Контур 80\" d=\"M22.646,31.2H4.689a4.505,4.505,0,0,1-4.5-4.5V8.5A4.505,4.505,0,0,1,4.689,4h18.2a4.505,4.505,0,0,1,4.5,4.5v8.445l-.893.1a3.184,3.184,0,0,0-2.846,3.177V30.5l-.465.7ZM4.689,6a2.5,2.5,0,0,0-2.5,2.5V26.7a2.5,2.5,0,0,0,2.5,2.5H21.65V20.22a5.18,5.18,0,0,1,3.739-4.992V8.5a2.5,2.5,0,0,0-2.5-2.5Z\" fill=\"#fff\"/>\n <path id=\"Контур_81\" data-name=\"Контур 81\" d=\"M30.127,47.884a1,1,0,0,1-1-1V43.267H26.846a5.206,5.206,0,0,1-5.2-5.2V20.222a5.206,5.206,0,0,1,5.2-5.2H44.692a5.206,5.206,0,0,1,5.2,5.2V38.068a5.206,5.206,0,0,1-5.2,5.2H35.058l-4.216,4.316A1,1,0,0,1,30.127,47.884ZM26.846,17.022a3.2,3.2,0,0,0-3.2,3.2V38.067a3.2,3.2,0,0,0,3.2,3.2h3.281a1,1,0,0,1,1,1v2.162l2.8-2.86a1,1,0,0,1,.715-.3H44.692a3.2,3.2,0,0,0,3.2-3.2V20.222a3.2,3.2,0,0,0-3.2-3.2Z\" fill=\"#fff\"/>\n </g>\n </g>\n</svg>\n";
48923
48986
 
48924
48987
  const VERSION$3 = '0.0.1';
48925
- const T$7 = 'plugins.media_control_multicamera';
48988
+ const T$7 = 'plugins.multicamera';
48989
+ /**
48990
+ * The plugin adds support for loading multiple streams and switching between them using the media control UI.
48991
+ * @beta
48992
+ */
48926
48993
  class MultiCamera extends UICorePlugin {
48927
48994
  currentCamera = null;
48928
48995
  currentTime = 0;
@@ -48930,7 +48997,7 @@ class MultiCamera extends UICorePlugin {
48930
48997
  multicamera = [];
48931
48998
  noActiveStreams = false;
48932
48999
  get name() {
48933
- return 'media_control_multicamera';
49000
+ return 'multicamera';
48934
49001
  }
48935
49002
  get supportedVersion() {
48936
49003
  return { min: CLAPPR_VERSION };
@@ -49877,11 +49944,15 @@ const seekTimeHTML = "<span data-seek-time></span>\n<span data-duration></span>\
49877
49944
 
49878
49945
  // Copyright 2014 Globo.com Player authors. All rights reserved.
49879
49946
  // Use of this source code is governed by a BSD-style
49880
- // license that can be found in the LICENSE file.
49947
+ // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE
49881
49948
  const { formatTime } = Utils;
49949
+ /**
49950
+ * The plugin adds a seek time indicator to the media control UI.
49951
+ * @beta
49952
+ */
49882
49953
  class SeekTime extends UICorePlugin {
49883
49954
  get name() {
49884
- return 'media_control_seek_time';
49955
+ return 'seek_time';
49885
49956
  }
49886
49957
  get supportedVersion() {
49887
49958
  return { min: CLAPPR_VERSION };
@@ -50035,11 +50106,14 @@ const fbIcon = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"32px\"
50035
50106
 
50036
50107
  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
50108
 
50109
+ /**
50110
+ * The plugin adds a share button to the media control UI.
50111
+ */
50038
50112
  class Share extends UICorePlugin {
50039
50113
  hide = false;
50040
50114
  container = null;
50041
50115
  get name() {
50042
- return 'media_control_share';
50116
+ return 'share';
50043
50117
  }
50044
50118
  get supportedVersion() {
50045
50119
  return { min: CLAPPR_VERSION };
@@ -50152,6 +50226,9 @@ class Share extends UICorePlugin {
50152
50226
 
50153
50227
  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
50228
 
50229
+ /**
50230
+ * The plugin adds skip controls to the media control UI.
50231
+ */
50155
50232
  class SkipTime extends UICorePlugin {
50156
50233
  get name() {
50157
50234
  return 'skip_time';
@@ -50949,6 +51026,7 @@ const STALL_MEASURE_PERIOD = 10;
50949
51026
  const T$1 = 'plugins.telemetry';
50950
51027
  /**
50951
51028
  * Telemetry event type
51029
+ * @beta
50952
51030
  */
50953
51031
  var TelemetryEvent;
50954
51032
  (function (TelemetryEvent) {
@@ -51236,7 +51314,29 @@ const parseSRT = /*@__PURE__*/getDefaultExportFromCjs$1(parseSrtExports);
51236
51314
 
51237
51315
  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
51316
 
51239
- const T = 'plugins.media_control_thumbnails';
51317
+ const T = 'plugins.thumbnails';
51318
+ /**
51319
+ * Displays the thumbnails of the video when available.
51320
+ * @beta
51321
+ * @example
51322
+ * ```ts
51323
+ * import { Thumbnails } from '@gcorevideo/player'
51324
+ *
51325
+ * Player.registerPlugin(Thumbnails)
51326
+ *
51327
+ * new Player({
51328
+ * thumbnails: {
51329
+ * backdropHeight: 200,
51330
+ * backdropMinOpacity: 0.9,
51331
+ * backdropMaxOpacity: 0.99,
51332
+ * spotlightHeight: 100,
51333
+ * 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',
51334
+ * sprite:
51335
+ * 'https://static.gvideo.co/videoplatform/sprites/2675/2452164_3dk4NsRt6vWsffEr.mp4_sprite.jpg',
51336
+ * },
51337
+ * })
51338
+ * ```
51339
+ */
51240
51340
  class Thumbnails extends UICorePlugin {
51241
51341
  _$spotlight = null;
51242
51342
  _$backdrop = null;
@@ -51251,20 +51351,27 @@ class Thumbnails extends UICorePlugin {
51251
51351
  _thumbsLoaded = false;
51252
51352
  _oldContainer = null;
51253
51353
  _thumbs = [];
51354
+ /**
51355
+ * @internal
51356
+ */
51254
51357
  get name() {
51255
- return 'media_control_thumbnails';
51358
+ return 'thumbnails';
51256
51359
  }
51360
+ /**
51361
+ * @internal
51362
+ */
51257
51363
  get supportedVersion() {
51258
51364
  return { min: CLAPPR_VERSION };
51259
51365
  }
51366
+ /**
51367
+ * @internal
51368
+ */
51260
51369
  get attributes() {
51261
51370
  return {
51262
- 'class': this.name
51371
+ class: this.name,
51263
51372
  };
51264
51373
  }
51265
- get template() {
51266
- return tmpl(pluginHtml);
51267
- }
51374
+ static template = tmpl(pluginHtml);
51268
51375
  /*
51269
51376
  * Helper to build the "thumbs" property for a sprite sheet.
51270
51377
  *
@@ -51308,6 +51415,9 @@ class Thumbnails extends UICorePlugin {
51308
51415
  return thumbs;
51309
51416
  }
51310
51417
  // TODO check if seek enabled
51418
+ /**
51419
+ * @internal
51420
+ */
51311
51421
  bindEvents() {
51312
51422
  this.listenToOnce(this.core, Events$1.CORE_READY, this._onCoreReady);
51313
51423
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_MOUSEMOVE_SEEKBAR, this._onMouseMove);
@@ -51324,7 +51434,9 @@ class Thumbnails extends UICorePlugin {
51324
51434
  }
51325
51435
  _onCoreReady() {
51326
51436
  try {
51327
- if (!this.options.thumbnails || !this.options.thumbnails.sprite || !this.options.thumbnails.vtt) {
51437
+ if (!this.options.thumbnails ||
51438
+ !this.options.thumbnails.sprite ||
51439
+ !this.options.thumbnails.vtt) {
51328
51440
  this.destroy();
51329
51441
  return;
51330
51442
  }
@@ -51375,7 +51487,7 @@ class Thumbnails extends UICorePlugin {
51375
51487
  }
51376
51488
  _getOptions() {
51377
51489
  if (!('thumbnails' in this.core.options)) {
51378
- throw '\'thumbnail property missing from options object.';
51490
+ throw "'thumbnail property missing from options object.";
51379
51491
  }
51380
51492
  return this.core.options.thumbnails;
51381
51493
  }
@@ -51476,7 +51588,7 @@ class Thumbnails extends UICorePlugin {
51476
51588
  this.$img.css({
51477
51589
  height: this.spriteSheetHeight * scaleFactor,
51478
51590
  left: -1 * thumb.x * scaleFactor,
51479
- top: -1 * thumb.y * scaleFactor
51591
+ top: -1 * thumb.y * scaleFactor,
51480
51592
  });
51481
51593
  if (this.$container.find(this.$img).length === 0) {
51482
51594
  this.$container.append(this.$img);
@@ -51518,7 +51630,7 @@ class Thumbnails extends UICorePlugin {
51518
51630
  const videoDuration = this.core.mediaControl.container.getDuration();
51519
51631
  const startTimeOffset = this.core.mediaControl.container.getStartTimeOffset();
51520
51632
  // the time into the video at the current hover position
51521
- const hoverTime = startTimeOffset + (videoDuration * hoverPosition);
51633
+ const hoverTime = startTimeOffset + videoDuration * hoverPosition;
51522
51634
  const backdropWidth = this._$backdrop.width();
51523
51635
  const $carousel = this._$carousel;
51524
51636
  const carouselWidth = $carousel.width();
@@ -51543,9 +51655,9 @@ class Thumbnails extends UICorePlugin {
51543
51655
  const positionInThumb = timeIntoThumb / thumbDuration;
51544
51656
  const xCoordInThumb = thumbWidth * positionInThumb;
51545
51657
  // now calculate the position along carousel that we want to be above the hover position
51546
- const xCoordInCarousel = (thumbIndex * thumbWidth) + xCoordInThumb;
51658
+ const xCoordInCarousel = thumbIndex * thumbWidth + xCoordInThumb;
51547
51659
  // and finally the position of the carousel when the hover position is taken in to consideration
51548
- const carouselXCoord = xCoordInCarousel - (hoverPosition * backdropWidth);
51660
+ const carouselXCoord = xCoordInCarousel - hoverPosition * backdropWidth;
51549
51661
  $carousel.css('left', -carouselXCoord);
51550
51662
  const maxOpacity = this._getOptions().backdropMaxOpacity || 0.6;
51551
51663
  const minOpacity = this._getOptions().backdropMinOpacity || 0.08;
@@ -51561,7 +51673,7 @@ class Thumbnails extends UICorePlugin {
51561
51673
  distance = Math.min(0, distance + thumbWidth);
51562
51674
  }
51563
51675
  // fade over the width of 2 thumbnails
51564
- const opacity = Math.max(maxOpacity - (Math.abs(distance) / (2 * thumbWidth)), minOpacity);
51676
+ const opacity = Math.max(maxOpacity - Math.abs(distance) / (2 * thumbWidth), minOpacity);
51565
51677
  this._$backdropCarouselImgs[i].css('opacity', opacity);
51566
51678
  }
51567
51679
  }
@@ -51577,7 +51689,7 @@ class Thumbnails extends UICorePlugin {
51577
51689
  const videoDuration = this.core.mediaControl.container.getDuration();
51578
51690
  // the time into the video at the current hover position
51579
51691
  const startTimeOffset = this.core.mediaControl.container.getStartTimeOffset();
51580
- const hoverTime = startTimeOffset + (videoDuration * hoverPosition);
51692
+ const hoverTime = startTimeOffset + videoDuration * hoverPosition;
51581
51693
  this.setText(hoverTime);
51582
51694
  // determine which thumbnail applies to the current time
51583
51695
  const thumbIndex = this._getThumbIndexForTime(hoverTime);
@@ -51589,7 +51701,7 @@ class Thumbnails extends UICorePlugin {
51589
51701
  const elWidth = this.$el.width();
51590
51702
  const thumbWidth = $spotlight.width();
51591
51703
  const thumbHeight = $spotlight.height();
51592
- let spotlightXPos = (elWidth * hoverPosition) - (thumbWidth / 2);
51704
+ let spotlightXPos = elWidth * hoverPosition - thumbWidth / 2;
51593
51705
  // adjust so the entire thumbnail is always visible
51594
51706
  spotlightXPos = Math.max(Math.min(spotlightXPos, elWidth - thumbWidth), 0);
51595
51707
  $spotlight.css('left', spotlightXPos);
@@ -51630,9 +51742,9 @@ class Thumbnails extends UICorePlugin {
51630
51742
  }
51631
51743
  _createElements() {
51632
51744
  trace(`${T} _createElements`);
51633
- this.$el.html(this.template({
51634
- 'backdropHeight': this._getOptions().backdropHeight,
51635
- 'spotlightHeight': this._getOptions().spotlightHeight
51745
+ this.$el.html(Thumbnails.template({
51746
+ backdropHeight: this._getOptions().backdropHeight,
51747
+ spotlightHeight: this._getOptions().spotlightHeight,
51636
51748
  }));
51637
51749
  // cache dom references
51638
51750
  this._$spotlight = this.$el.find('.spotlight');
@@ -51644,11 +51756,16 @@ class Thumbnails extends UICorePlugin {
51644
51756
  }
51645
51757
  }
51646
51758
 
51759
+ /**
51760
+ * Events emitted by the VolumeFade plugin.
51761
+ * @beta
51762
+ */
51647
51763
  var VolumeFadeEvents;
51648
51764
  (function (VolumeFadeEvents) {
51649
51765
  VolumeFadeEvents["FADE"] = "core:volume:fade";
51650
51766
  })(VolumeFadeEvents || (VolumeFadeEvents = {}));
51651
51767
  /**
51768
+ * Applies fade effect to the player's volume change.
51652
51769
  * @beta
51653
51770
  */
51654
51771
  class VolumeFade extends UICorePlugin {
@@ -51743,4 +51860,4 @@ class VolumeFade extends UICorePlugin {
51743
51860
  }
51744
51861
  }
51745
51862
 
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 };
51863
+ 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 };