@gcorevideo/player 2.19.15 → 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 (338) hide show
  1. package/assets/level-selector/list.ejs +1 -1
  2. package/dist/core.js +2 -2
  3. package/dist/index.css +966 -966
  4. package/dist/index.js +884 -627
  5. package/dist/player.d.ts +536 -122
  6. package/dist/plugins/index.css +1160 -1160
  7. package/dist/plugins/index.js +2006 -1725
  8. package/docs/api/player.audioselector.md +1 -251
  9. package/docs/api/player.bigmutebutton.md +1 -156
  10. package/docs/api/player.clapprnerdstats.md +12 -259
  11. package/docs/api/player.clapprstats.exportmetrics.md +4 -0
  12. package/docs/api/player.clapprstats.md +7 -223
  13. package/docs/api/player.clapprstats.setupdatemetrics.md +2 -0
  14. package/docs/api/player.clicktopause.md +5 -113
  15. package/docs/api/player.clipsplugin.gettext.md +9 -0
  16. package/docs/api/player.clipsplugin.md +10 -94
  17. package/docs/api/{player.playbackrate.setselectedrate.md → player.clipspluginsettings.md} +18 -10
  18. package/docs/api/player.clipspluginsettings.text.md +13 -0
  19. package/docs/api/player.contextmenu._constructor_.md +6 -3
  20. package/docs/api/player.contextmenu.md +13 -256
  21. package/docs/api/player.contextmenupluginsettings.label.md +11 -0
  22. package/docs/api/player.contextmenupluginsettings.md +93 -0
  23. package/docs/api/player.contextmenupluginsettings.preventshowcontextmenu.md +11 -0
  24. package/docs/api/player.contextmenupluginsettings.url.md +11 -0
  25. package/docs/api/player.dvrcontrols.md +5 -1
  26. package/docs/api/player.errorscreen.attributes.md +3 -0
  27. package/docs/api/player.errorscreen.bindevents.md +3 -0
  28. package/docs/api/player.errorscreen.container.md +3 -0
  29. package/docs/api/player.errorscreen.hide.md +3 -0
  30. package/docs/api/player.errorscreen.md +25 -0
  31. package/docs/api/player.errorscreen.name.md +3 -0
  32. package/docs/api/player.errorscreen.render.md +3 -0
  33. package/docs/api/player.errorscreen.show.md +3 -0
  34. package/docs/api/player.errorscreen.supportedversion.md +3 -0
  35. package/docs/api/player.errorscreen.template.md +3 -0
  36. package/docs/api/player.errorscreen.unbindevents.md +3 -0
  37. package/docs/api/player.favicon._constructor_.md +3 -0
  38. package/docs/api/player.favicon.bindevents.md +3 -0
  39. package/docs/api/player.favicon.configure.md +3 -0
  40. package/docs/api/player.favicon.destroy.md +3 -0
  41. package/docs/api/player.favicon.disable.md +3 -0
  42. package/docs/api/player.favicon.md +18 -1
  43. package/docs/api/player.favicon.name.md +3 -0
  44. package/docs/api/player.favicon.supportedversion.md +3 -0
  45. package/docs/api/player.gearevents.md +4 -1
  46. package/docs/api/player.googleanalytics._constructor_.md +3 -0
  47. package/docs/api/player.googleanalytics.addeventlisteners.md +3 -0
  48. package/docs/api/player.googleanalytics.embedscript.md +3 -0
  49. package/docs/api/player.googleanalytics.md +42 -1
  50. package/docs/api/player.googleanalytics.name.md +3 -0
  51. package/docs/api/player.googleanalytics.onbufferfull.md +3 -0
  52. package/docs/api/player.googleanalytics.onbuffering.md +3 -0
  53. package/docs/api/player.googleanalytics.ondvr.md +3 -0
  54. package/docs/api/player.googleanalytics.onended.md +3 -0
  55. package/docs/api/player.googleanalytics.onerror.md +3 -0
  56. package/docs/api/player.googleanalytics.onfullscreen.md +3 -0
  57. package/docs/api/player.googleanalytics.onhd.md +3 -0
  58. package/docs/api/player.googleanalytics.onpause.md +3 -0
  59. package/docs/api/player.googleanalytics.onplay.md +3 -0
  60. package/docs/api/player.googleanalytics.onready.md +3 -0
  61. package/docs/api/player.googleanalytics.onseek.md +3 -0
  62. package/docs/api/player.googleanalytics.onstop.md +3 -0
  63. package/docs/api/player.googleanalytics.onvolumechanged.md +3 -0
  64. package/docs/api/player.googleanalytics.push.md +3 -0
  65. package/docs/api/player.googleanalytics.supportedversion.md +3 -0
  66. package/docs/api/{player.clapprstats.name.md → player.initeventdata.event.md} +3 -3
  67. package/docs/api/player.initeventdata.md +60 -0
  68. package/docs/api/player.logo._constructor_.md +3 -0
  69. package/docs/api/player.logo.attributes.md +3 -0
  70. package/docs/api/player.logo.bindevents.md +3 -0
  71. package/docs/api/player.logo.md +20 -1
  72. package/docs/api/player.logo.name.md +3 -0
  73. package/docs/api/player.logo.render.md +3 -0
  74. package/docs/api/player.logo.stoplistening.md +3 -0
  75. package/docs/api/player.logo.supportedversion.md +3 -0
  76. package/docs/api/player.logo.template.md +3 -0
  77. package/docs/api/player.md +149 -18
  78. package/docs/api/player.mediacontrolelement.md +1 -1
  79. package/docs/api/player.multicamera.md +2 -0
  80. package/docs/api/player.pictureinpicture.md +9 -197
  81. package/docs/api/player.playbackrate.md +10 -314
  82. package/docs/api/player.seektime.attributes.md +3 -0
  83. package/docs/api/player.seektime.bindevents.md +3 -0
  84. package/docs/api/player.seektime.durationshown.md +3 -0
  85. package/docs/api/player.seektime.getseektime.md +3 -0
  86. package/docs/api/player.seektime.islivestreamwithdvr.md +3 -0
  87. package/docs/api/player.seektime.md +31 -0
  88. package/docs/api/player.seektime.mediacontrol.md +3 -0
  89. package/docs/api/player.seektime.mediacontrolcontainer.md +3 -0
  90. package/docs/api/player.seektime.name.md +3 -0
  91. package/docs/api/player.seektime.render.md +3 -0
  92. package/docs/api/player.seektime.shouldbevisible.md +3 -0
  93. package/docs/api/player.seektime.supportedversion.md +3 -0
  94. package/docs/api/player.seektime.template.md +3 -0
  95. package/docs/api/player.seektime.update.md +3 -0
  96. package/docs/api/player.share.md +2 -0
  97. package/docs/api/player.skiptime.md +2 -0
  98. package/docs/api/{player.clapprstats.destroy.md → player.stalleventdata.count.md} +5 -7
  99. package/docs/api/{player.bigmutebutton.template.md → player.stalleventdata.event.md} +3 -3
  100. package/docs/api/player.stalleventdata.md +117 -0
  101. package/docs/api/{player.audioselector.onshowlevelselectmenu.md → player.stalleventdata.time.md} +5 -7
  102. package/docs/api/{player.clapprstats.starttimers.md → player.stalleventdata.total_ms.md} +5 -7
  103. package/docs/api/{player.audioselector.template.md → player.starteventdata.event.md} +3 -3
  104. package/docs/api/player.starteventdata.md +60 -0
  105. package/docs/api/{player.clapprstats._defaultreport.md → player.telemetry._constructor_.md} +7 -9
  106. package/docs/api/player.telemetry.md +146 -0
  107. package/docs/api/{player.clapprnerdstats.name.md → player.telemetry.name.md} +4 -2
  108. package/docs/api/{player.clapprstats.supportedversion.md → player.telemetry.supportedversion.md} +4 -2
  109. package/docs/api/player.telemetryevent.md +100 -0
  110. package/docs/api/player.telemetryeventdata.md +18 -0
  111. package/docs/api/player.telemetrypluginsettings.md +60 -0
  112. package/docs/api/{player.audioselector.bindevents.md → player.telemetrypluginsettings.send.md} +5 -7
  113. package/docs/api/{player.audioselector.reload.md → player.telemetryrecord.md} +8 -6
  114. package/docs/api/player.thumbnails.md +21 -139
  115. package/docs/api/player.thumbnailspluginsettings.md +23 -0
  116. package/docs/api/player.volumefade.md +1 -93
  117. package/docs/api/{player.audioselector.name.md → player.watcheventdata.event.md} +3 -3
  118. package/docs/api/player.watcheventdata.md +60 -0
  119. package/lib/index.plugins.d.ts +2 -3
  120. package/lib/index.plugins.d.ts.map +1 -1
  121. package/lib/index.plugins.js +2 -3
  122. package/lib/playback/hls-playback/HlsPlayback.js +1 -1
  123. package/lib/plugins/audio-selector/AudioSelector.d.ts +28 -6
  124. package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
  125. package/lib/plugins/audio-selector/AudioSelector.js +52 -22
  126. package/lib/plugins/big-mute-button/BigMuteButton.d.ts +18 -2
  127. package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
  128. package/lib/plugins/big-mute-button/BigMuteButton.js +21 -16
  129. package/lib/plugins/bottom-gear/BottomGear.d.ts +1 -0
  130. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  131. package/lib/plugins/bottom-gear/BottomGear.js +1 -0
  132. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +38 -5
  133. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
  134. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +63 -17
  135. package/lib/plugins/clappr-stats/ClapprStats.d.ts +31 -8
  136. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -1
  137. package/lib/plugins/clappr-stats/ClapprStats.js +24 -0
  138. package/lib/plugins/clappr-stats/types.d.ts +12 -0
  139. package/lib/plugins/clappr-stats/types.d.ts.map +1 -1
  140. package/lib/plugins/clappr-stats/types.js +3 -0
  141. package/lib/plugins/click-to-pause/ClickToPause.d.ts +13 -1
  142. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  143. package/lib/plugins/click-to-pause/ClickToPause.js +14 -4
  144. package/lib/plugins/clips/Clips.d.ts +34 -2
  145. package/lib/plugins/clips/Clips.d.ts.map +1 -1
  146. package/lib/plugins/clips/Clips.js +51 -22
  147. package/lib/plugins/context-menu/ContextMenu.d.ts +40 -13
  148. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
  149. package/lib/plugins/context-menu/ContextMenu.js +48 -36
  150. package/lib/plugins/dvr-controls/DvrControls.d.ts +5 -4
  151. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  152. package/lib/plugins/dvr-controls/DvrControls.js +15 -29
  153. package/lib/plugins/error-screen/ErrorScreen.d.ts +4 -0
  154. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  155. package/lib/plugins/error-screen/ErrorScreen.js +4 -0
  156. package/lib/plugins/favicon/Favicon.d.ts +4 -0
  157. package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
  158. package/lib/plugins/favicon/Favicon.js +4 -0
  159. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +4 -0
  160. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -1
  161. package/lib/plugins/google-analytics/GoogleAnalytics.js +5 -1
  162. package/lib/plugins/index.d.ts +2 -4
  163. package/lib/plugins/index.d.ts.map +1 -1
  164. package/lib/plugins/index.js +2 -4
  165. package/lib/plugins/logo/Logo.d.ts +4 -0
  166. package/lib/plugins/logo/Logo.d.ts.map +1 -1
  167. package/lib/plugins/logo/Logo.js +4 -0
  168. package/lib/plugins/media-control/MediaControl.d.ts +1 -1
  169. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  170. package/lib/plugins/media-control/MediaControl.js +3 -1
  171. package/lib/plugins/multi-camera/MultiCamera.d.ts +3 -0
  172. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
  173. package/lib/plugins/multi-camera/MultiCamera.js +3 -0
  174. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +32 -4
  175. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
  176. package/lib/plugins/picture-in-picture/PictureInPicture.js +30 -2
  177. package/lib/plugins/playback-rate/PlaybackRate.d.ts +47 -14
  178. package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
  179. package/lib/plugins/playback-rate/PlaybackRate.js +38 -9
  180. package/lib/plugins/seek-time/SeekTime.d.ts +4 -0
  181. package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -1
  182. package/lib/plugins/seek-time/SeekTime.js +5 -1
  183. package/lib/plugins/share/Share.d.ts +3 -0
  184. package/lib/plugins/share/Share.d.ts.map +1 -1
  185. package/lib/plugins/share/Share.js +3 -0
  186. package/lib/plugins/skip-time/SkipTime.d.ts +3 -0
  187. package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -1
  188. package/lib/plugins/skip-time/SkipTime.js +3 -0
  189. package/lib/plugins/statistics/Statistics.d.ts +38 -3
  190. package/lib/plugins/statistics/Statistics.d.ts.map +1 -1
  191. package/lib/plugins/statistics/Statistics.js +51 -9
  192. package/lib/plugins/telemetry/Telemetry.d.ts +153 -0
  193. package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -0
  194. package/lib/plugins/telemetry/Telemetry.js +181 -0
  195. package/lib/plugins/thumbnails/Thumbnails.d.ts +48 -3
  196. package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -1
  197. package/lib/plugins/thumbnails/Thumbnails.js +52 -18
  198. package/lib/plugins/volume-fade/VolumeFade.d.ts +8 -1
  199. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  200. package/lib/plugins/volume-fade/VolumeFade.js +9 -1
  201. package/package.json +1 -1
  202. package/src/index.plugins.ts +2 -3
  203. package/src/playback/hls-playback/HlsPlayback.ts +1 -1
  204. package/src/plugins/audio-selector/AudioSelector.ts +227 -154
  205. package/src/plugins/big-mute-button/BigMuteButton.ts +100 -79
  206. package/src/plugins/bottom-gear/BottomGear.ts +1 -0
  207. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +240 -173
  208. package/src/plugins/clappr-stats/ClapprStats.ts +32 -8
  209. package/src/plugins/clappr-stats/types.ts +13 -0
  210. package/src/plugins/click-to-pause/ClickToPause.ts +47 -36
  211. package/src/plugins/clips/Clips.ts +127 -71
  212. package/src/plugins/context-menu/ContextMenu.ts +105 -76
  213. package/src/plugins/dvr-controls/DvrControls.ts +15 -31
  214. package/src/plugins/error-screen/ErrorScreen.ts +4 -0
  215. package/src/plugins/favicon/Favicon.ts +4 -0
  216. package/src/plugins/google-analytics/GoogleAnalytics.ts +5 -1
  217. package/src/plugins/index.ts +2 -4
  218. package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +47 -26
  219. package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +18 -18
  220. package/src/plugins/logo/Logo.ts +4 -0
  221. package/src/plugins/media-control/MediaControl.ts +4 -1
  222. package/src/plugins/multi-camera/MultiCamera.ts +3 -0
  223. package/src/plugins/picture-in-picture/PictureInPicture.ts +35 -7
  224. package/src/plugins/playback-rate/PlaybackRate.ts +53 -24
  225. package/src/plugins/seek-time/SeekTime.ts +5 -1
  226. package/src/plugins/share/Share.ts +3 -0
  227. package/src/plugins/skip-time/SkipTime.ts +3 -0
  228. package/src/plugins/telemetry/Telemetry.ts +317 -0
  229. package/src/plugins/thumbnails/Thumbnails.ts +268 -194
  230. package/src/plugins/volume-fade/VolumeFade.ts +10 -2
  231. package/temp/player.api.json +2457 -5257
  232. package/tsconfig.tsbuildinfo +1 -1
  233. package/docs/api/player.audioselector.attributes.md +0 -17
  234. package/docs/api/player.audioselector.events.md +0 -17
  235. package/docs/api/player.audioselector.hideselecttrackmenu.md +0 -18
  236. package/docs/api/player.audioselector.render.md +0 -18
  237. package/docs/api/player.audioselector.supportedversion.md +0 -16
  238. package/docs/api/player.audioselector.togglecontextmenu.md +0 -18
  239. package/docs/api/player.audioselector.unbindevents.md +0 -18
  240. package/docs/api/player.audioselector.version.md +0 -14
  241. package/docs/api/player.bigmutebutton.bindevents.md +0 -18
  242. package/docs/api/player.bigmutebutton.events.md +0 -17
  243. package/docs/api/player.bigmutebutton.name.md +0 -14
  244. package/docs/api/player.bigmutebutton.render.md +0 -18
  245. package/docs/api/player.bigmutebutton.supportedversion.md +0 -16
  246. package/docs/api/player.clapprnerdstats.attributes.md +0 -17
  247. package/docs/api/player.clapprnerdstats.bindevents.md +0 -18
  248. package/docs/api/player.clapprnerdstats.events.md +0 -18
  249. package/docs/api/player.clapprnerdstats.playerheight.md +0 -14
  250. package/docs/api/player.clapprnerdstats.playerwidth.md +0 -14
  251. package/docs/api/player.clapprnerdstats.render.md +0 -18
  252. package/docs/api/player.clapprnerdstats.statsboxelem.md +0 -14
  253. package/docs/api/player.clapprnerdstats.statsboxwidththreshold.md +0 -14
  254. package/docs/api/player.clapprnerdstats.supportedversion.md +0 -16
  255. package/docs/api/player.clapprnerdstats.template.md +0 -14
  256. package/docs/api/player.clapprstats._buildreport.md +0 -18
  257. package/docs/api/player.clapprstats._playbackname.md +0 -14
  258. package/docs/api/player.clapprstats._playbacktype.md +0 -14
  259. package/docs/api/player.clapprstats.bindevents.md +0 -18
  260. package/docs/api/player.clapprstats.onfirstplaying.md +0 -18
  261. package/docs/api/player.clapprstats.playafterpause.md +0 -18
  262. package/docs/api/player.clapprstats.stopreporting.md +0 -18
  263. package/docs/api/player.clicktopause.bindevents.md +0 -15
  264. package/docs/api/player.clicktopause.config.md +0 -11
  265. package/docs/api/player.clicktopause.name.md +0 -11
  266. package/docs/api/player.clicktopause.supportedversion.md +0 -13
  267. package/docs/api/player.clipsplugin.attributes.md +0 -13
  268. package/docs/api/player.clipsplugin.bindevents.md +0 -15
  269. package/docs/api/player.clipsplugin.makesvg.md +0 -49
  270. package/docs/api/player.clipsplugin.name.md +0 -11
  271. package/docs/api/player.clipsplugin.unbindevents.md +0 -15
  272. package/docs/api/player.contextmenu.attributes.md +0 -13
  273. package/docs/api/player.contextmenu.bindevents.md +0 -15
  274. package/docs/api/player.contextmenu.destroy.md +0 -15
  275. package/docs/api/player.contextmenu.events.md +0 -13
  276. package/docs/api/player.contextmenu.exposeversion.md +0 -14
  277. package/docs/api/player.contextmenu.label.md +0 -11
  278. package/docs/api/player.contextmenu.mediacontrol.md +0 -11
  279. package/docs/api/player.contextmenu.name.md +0 -11
  280. package/docs/api/player.contextmenu.render.md +0 -15
  281. package/docs/api/player.contextmenu.supportedversion.md +0 -13
  282. package/docs/api/player.contextmenu.template.md +0 -11
  283. package/docs/api/player.contextmenu.url.md +0 -11
  284. package/docs/api/player.disablecontrols.bindevents.md +0 -15
  285. package/docs/api/player.disablecontrols.container.md +0 -11
  286. package/docs/api/player.disablecontrols.md +0 -138
  287. package/docs/api/player.disablecontrols.name.md +0 -11
  288. package/docs/api/player.disablecontrols.supportedversion.md +0 -13
  289. package/docs/api/player.disablecontrols.unbindevents.md +0 -15
  290. package/docs/api/player.pictureinpicture.bindevents.md +0 -15
  291. package/docs/api/player.pictureinpicture.events.md +0 -13
  292. package/docs/api/player.pictureinpicture.exitpictureinpicture.md +0 -15
  293. package/docs/api/player.pictureinpicture.name.md +0 -11
  294. package/docs/api/player.pictureinpicture.render.md +0 -15
  295. package/docs/api/player.pictureinpicture.requestpictureinpicture.md +0 -15
  296. package/docs/api/player.pictureinpicture.supportedversion.md +0 -13
  297. package/docs/api/player.pictureinpicture.togglepictureinpicture.md +0 -15
  298. package/docs/api/player.pictureinpicture.version.md +0 -11
  299. package/docs/api/player.pictureinpicture.videoelement.md +0 -11
  300. package/docs/api/player.playbackrate.attributes.md +0 -14
  301. package/docs/api/player.playbackrate.bindevents.md +0 -15
  302. package/docs/api/player.playbackrate.events.md +0 -15
  303. package/docs/api/player.playbackrate.gettitle.md +0 -15
  304. package/docs/api/player.playbackrate.goback.md +0 -15
  305. package/docs/api/player.playbackrate.highlightcurrentrate.md +0 -15
  306. package/docs/api/player.playbackrate.name.md +0 -11
  307. package/docs/api/player.playbackrate.onfinishad.md +0 -15
  308. package/docs/api/player.playbackrate.onplay.md +0 -15
  309. package/docs/api/player.playbackrate.onrateselect.md +0 -49
  310. package/docs/api/player.playbackrate.onshowmenu.md +0 -15
  311. package/docs/api/player.playbackrate.onstartad.md +0 -15
  312. package/docs/api/player.playbackrate.onstop.md +0 -15
  313. package/docs/api/player.playbackrate.reload.md +0 -15
  314. package/docs/api/player.playbackrate.render.md +0 -15
  315. package/docs/api/player.playbackrate.supportedversion.md +0 -13
  316. package/docs/api/player.playbackrate.template.md +0 -11
  317. package/docs/api/player.playbackrate.unbindevents.md +0 -15
  318. package/docs/api/player.playbackrate.updateplaybackrate.md +0 -49
  319. package/docs/api/player.pluginsettings.md +0 -13
  320. package/docs/api/player.statistics._constructor_.md +0 -47
  321. package/docs/api/player.statistics.bindevents.md +0 -15
  322. package/docs/api/player.statistics.md +0 -141
  323. package/docs/api/player.statistics.name.md +0 -11
  324. package/docs/api/player.statistics.supportedversion.md +0 -13
  325. package/docs/api/player.thumbnails.attributes.md +0 -13
  326. package/docs/api/player.thumbnails.bindevents.md +0 -15
  327. package/docs/api/player.thumbnails.name.md +0 -11
  328. package/docs/api/player.thumbnails.settext.md +0 -49
  329. package/docs/api/player.thumbnails.supportedversion.md +0 -13
  330. package/docs/api/player.thumbnails.template.md +0 -11
  331. package/docs/api/player.volumefade.bindevents.md +0 -18
  332. package/docs/api/player.volumefade.name.md +0 -14
  333. package/docs/api/player.volumefade.unbindevents.md +0 -18
  334. package/src/plugins/disable-controls/DisableControls.ts +0 -81
  335. package/src/plugins/ga-events/GaEvents.js +0 -395
  336. package/src/plugins/ga-events/ga-tracking.js +0 -46
  337. package/src/plugins/statistics/Statistics.ts +0 -207
  338. /package/src/plugins/{statistics → telemetry}/Statistics copy.xts +0 -0
@@ -23,7 +23,10 @@ type UriToMeasureBandwidth = {
23
23
  const updateMetrics = () => {};
24
24
 
25
25
  /**
26
+ * Collects useful statistics about playback performance.
26
27
  * @beta
28
+ * @remarks
29
+ * This plugin does not render anything and is supposed to be extended or used together with other plugins that actually render something.
27
30
  */
28
31
  export class ClapprStats extends ContainerPlugin {
29
32
  private bwMeasureCount = 0;
@@ -60,19 +63,25 @@ export class ClapprStats extends ContainerPlugin {
60
63
 
61
64
  private uriToMeasureLatency: string | undefined;
62
65
 
66
+ /**
67
+ * @internal
68
+ */
63
69
  get name() {
64
70
  return 'clappr_stats';
65
71
  }
66
72
 
73
+ /**
74
+ * @internal
75
+ */
67
76
  get supportedVersion() {
68
77
  return { min: CLAPPR_VERSION };
69
78
  }
70
79
 
71
- get _playbackName() {
80
+ private get _playbackName() {
72
81
  return String(this.container.playback.name || '');
73
82
  }
74
83
 
75
- get _playbackType() {
84
+ private get _playbackType() {
76
85
  return this.container.getPlaybackType();
77
86
  }
78
87
 
@@ -100,11 +109,15 @@ export class ClapprStats extends ContainerPlugin {
100
109
  this.metrics.timers[timer] += this._now() - this.timers[timer];
101
110
  }
102
111
 
112
+ /**
113
+ * Registers a callback to receive the metrics.
114
+ * @param updateMetricsFn
115
+ */
103
116
  setUpdateMetrics(updateMetricsFn: MetricsUpdateFn) {
104
117
  this.updateFn = updateMetricsFn;
105
118
  }
106
119
 
107
- _defaultReport(metrics: Metrics) {
120
+ private _defaultReport(metrics: Metrics) {
108
121
  this.updateFn(metrics);
109
122
  }
110
123
 
@@ -122,6 +135,9 @@ export class ClapprStats extends ContainerPlugin {
122
135
  };
123
136
  }
124
137
 
138
+ /**
139
+ * @internal
140
+ */
125
141
  override bindEvents() {
126
142
  this.listenTo(this.container, CoreEvents.CONTAINER_BITRATE, this.onBitrate);
127
143
  this.listenTo(this.container, CoreEvents.CONTAINER_STOP, this.stopReporting);
@@ -141,11 +157,18 @@ export class ClapprStats extends ContainerPlugin {
141
157
  this.listenTo(this.container.playback, CoreEvents.PLAYBACK_TIMEUPDATE, this.onTimeUpdate);
142
158
  }
143
159
 
160
+ /**
161
+ * @internal
162
+ */
144
163
  override destroy() {
145
164
  this.stopReporting();
146
165
  super.destroy();
147
166
  }
148
167
 
168
+ /**
169
+ * Returns the collected metrics.
170
+ * @returns The collected metrics
171
+ */
149
172
  exportMetrics() {
150
173
  return structuredClone(this.metrics);
151
174
  }
@@ -166,7 +189,7 @@ export class ClapprStats extends ContainerPlugin {
166
189
  this._inc('changeLevel');
167
190
  }
168
191
 
169
- stopReporting() {
192
+ private stopReporting() {
170
193
  this._buildReport();
171
194
 
172
195
  if (this.intervalId !== null) {
@@ -175,25 +198,26 @@ export class ClapprStats extends ContainerPlugin {
175
198
  }
176
199
  this._newMetrics();
177
200
 
201
+ // TODO
178
202
  // @ts-ignore
179
203
  this.stopListening();
180
204
  this.bindEvents();
181
205
  }
182
206
 
183
- startTimers() {
207
+ private startTimers() {
184
208
  this.intervalId = setInterval(this._buildReport.bind(this), this.runEach);
185
209
  this.start('session');
186
210
  this.start('startup');
187
211
  }
188
212
 
189
- onFirstPlaying() {
213
+ private onFirstPlaying() {
190
214
  this.listenTo(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
191
215
 
192
216
  this.start('watch');
193
217
  this._stop('startup');
194
218
  }
195
219
 
196
- playAfterPause() {
220
+ private playAfterPause() {
197
221
  this.listenTo(this.container, CoreEvents.CONTAINER_TIMEUPDATE, this.onContainerUpdateWhilePlaying);
198
222
  this._stop('pause');
199
223
  this.start('watch');
@@ -280,7 +304,7 @@ export class ClapprStats extends ContainerPlugin {
280
304
  }
281
305
  }
282
306
 
283
- _buildReport() {
307
+ private _buildReport() {
284
308
  this._stop('session');
285
309
  this.start('session');
286
310
 
@@ -1,3 +1,7 @@
1
+
2
+ /**
3
+ * @beta
4
+ */
1
5
  export type Metrics = {
2
6
  counters: {
3
7
  play: number;
@@ -37,6 +41,9 @@ export type Metrics = {
37
41
  custom: Record<string, unknown>;
38
42
  };
39
43
 
44
+ /**
45
+ * @beta
46
+ */
40
47
  export type BitrateTrackRecord = {
41
48
  start: number;
42
49
  end?: number;
@@ -44,8 +51,14 @@ export type BitrateTrackRecord = {
44
51
  bitrate: number;
45
52
  }
46
53
 
54
+ /**
55
+ * @beta
56
+ */
47
57
  export type MetricsUpdateFn = (metrics: Metrics) => void;
48
58
 
59
+ /**
60
+ * @beta
61
+ */
49
62
  export enum ClapprStatsEvents {
50
63
  REPORT_EVENT = 'clappr:stats:report',
51
64
  PERCENTAGE_EVENT = 'clappr:stats:percentage',
@@ -1,63 +1,74 @@
1
1
  //Copyright 2014 Globo.com Player authors. All rights reserved.
2
2
  // Use of this source code is governed by a BSD-style
3
- // license that can be found in the LICENSE file.
3
+ // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
4
4
 
5
- import { ContainerPlugin, Events, Playback } from '@clappr/core';
6
- import { trace } from '@gcorevideo/utils';
5
+ import { ContainerPlugin, Events, Playback } from '@clappr/core'
6
+ import { trace } from '@gcorevideo/utils'
7
7
 
8
- import { CLAPPR_VERSION } from '../../build.js';
8
+ import { CLAPPR_VERSION } from '../../build.js'
9
9
 
10
- // const VERSION = '0.0.1';
10
+ type Timer = ReturnType<typeof setTimeout>
11
11
 
12
- type Timer = ReturnType<typeof setTimeout>;
13
-
14
- const T = 'plugins.click_to_pause_custom';
12
+ const T = 'plugins.click_to_pause_custom'
15
13
 
14
+ /**
15
+ * Adds a behavior of toggling the playback state on click over the container
16
+ * @beta
17
+ */
16
18
  export class ClickToPause extends ContainerPlugin {
17
- private pointerEnabled = false;
19
+ private pointerEnabled = false
18
20
 
19
- private timer: Timer | null = null;
21
+ private timer: Timer | null = null
20
22
 
23
+ /**
24
+ * @internal
25
+ */
21
26
  get name() {
22
- return 'click_to_pause_custom';
27
+ return 'click_to_pause_custom'
23
28
  }
24
29
 
30
+ /**
31
+ * @internal
32
+ */
25
33
  get supportedVersion() {
26
- return { min: CLAPPR_VERSION };
27
- }
28
-
29
- get config() {
30
- return this.container.options.clickToPauseConfig || {};
34
+ return { min: CLAPPR_VERSION }
31
35
  }
32
36
 
37
+ /**
38
+ * @internal
39
+ */
33
40
  override bindEvents() {
34
- this.listenTo(this.container, Events.CONTAINER_CLICK, this.click);
35
- this.listenTo(this.container, Events.CONTAINER_SETTINGSUPDATE, this.settingsUpdate);
41
+ this.listenTo(this.container, Events.CONTAINER_CLICK, this.click)
42
+ this.listenTo(
43
+ this.container,
44
+ Events.CONTAINER_SETTINGSUPDATE,
45
+ this.settingsUpdate,
46
+ )
36
47
  }
37
48
 
38
49
  private click() {
39
- const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
40
- const isDvrEnabled = this.container.isDvrEnabled();
50
+ const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE
51
+ const isDvrEnabled = this.container.isDvrEnabled()
41
52
 
42
53
  trace(`${T} click`, {
43
54
  isLivePlayback,
44
55
  isDvrEnabled,
45
- });
56
+ })
46
57
 
47
58
  if (isLivePlayback && !isDvrEnabled) {
48
- this.togglePlay(true);
59
+ this.togglePlay(true)
49
60
  } else if (!isLivePlayback || isDvrEnabled) {
50
- this.clearTimer();
61
+ this.clearTimer()
51
62
  this.timer = setTimeout(() => {
52
63
  this.timer = null
53
- this.togglePlay(false);
54
- }, 300);
64
+ this.togglePlay(false)
65
+ }, 300)
55
66
  }
56
67
  }
57
68
 
58
69
  private settingsUpdate() {
59
- const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
60
- const pointerEnabled = !isLivePlayback || this.container.isDvrEnabled();
70
+ const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE
71
+ const pointerEnabled = !isLivePlayback || this.container.isDvrEnabled()
61
72
 
62
73
  trace(`${T} settingsUpdate`, {
63
74
  isLivePlayback,
@@ -65,29 +76,29 @@ export class ClickToPause extends ContainerPlugin {
65
76
  })
66
77
 
67
78
  if (pointerEnabled === this.pointerEnabled) {
68
- return;
79
+ return
69
80
  }
70
81
 
71
- const method = pointerEnabled ? 'addClass' : 'removeClass';
82
+ const method = pointerEnabled ? 'addClass' : 'removeClass'
72
83
 
73
- this.container.$el[method]('pointer-enabled');
74
- this.pointerEnabled = pointerEnabled;
84
+ this.container.$el[method]('pointer-enabled')
85
+ this.pointerEnabled = pointerEnabled
75
86
  }
76
87
 
77
88
  private togglePlay(useStop: boolean) {
78
- const isPlaying = this.container && this.container.isPlaying();
89
+ const isPlaying = this.container && this.container.isPlaying()
79
90
 
80
91
  if (isPlaying) {
81
- useStop ? this.container.stop() : this.container.pause();
92
+ useStop ? this.container.stop() : this.container.pause()
82
93
  } else {
83
- this.container.play();
94
+ this.container.play()
84
95
  }
85
96
  }
86
97
 
87
98
  private clearTimer() {
88
99
  if (this.timer) {
89
- clearTimeout(this.timer);
90
- this.timer = null;
100
+ clearTimeout(this.timer)
101
+ this.timer = null
91
102
  }
92
103
  }
93
104
  }
@@ -1,115 +1,158 @@
1
- import { Container, Events, UICorePlugin, $ } from '@clappr/core';
1
+ import { Container, Events, UICorePlugin, $ } from '@clappr/core'
2
2
 
3
- import { TimeProgress } from '../../playback.types.js';
4
- import type { ZeptoResult } from '../../utils/types.js';
5
- import { strtimeToMiliseconds } from '../utils.js';
6
- import '../../../assets/clips/clips.scss';
3
+ import { TimeProgress } from '../../playback.types.js'
4
+ import type { ZeptoResult } from '../../utils/types.js'
5
+ import { strtimeToMiliseconds } from '../utils.js'
6
+ import '../../../assets/clips/clips.scss'
7
+ import assert from 'assert'
7
8
 
8
9
  type ClipDesc = {
9
- start: number;
10
- text: string;
11
- end: number;
12
- index: number;
10
+ start: number
11
+ text: string
12
+ end: number
13
+ index: number
13
14
  }
14
15
 
15
16
  type ClipItem = {
16
- start: number;
17
- text: string;
17
+ start: number
18
+ text: string
18
19
  }
19
20
 
21
+ /**
22
+ * Configuration options
23
+ */
24
+ export interface ClipsPluginSettings {
25
+ /**
26
+ * The text to display over the seekbar.
27
+ */
28
+ text: string
29
+ }
30
+
31
+ /**
32
+ * Adds a behavior of showing a text over the seekbar to indicate the current clip.
33
+ * @beta
34
+ * @remarks
35
+ * Depends on:
36
+ *
37
+ * - {@link MediaControl}
38
+ *
39
+ * Configuration options - {@link ClipsPluginSettings}
40
+ */
20
41
  export class ClipsPlugin extends UICorePlugin {
21
42
  private clips: Map<number, ClipDesc> = new Map()
22
43
 
23
- private duration: number = 0;
44
+ private duration: number = 0
24
45
 
25
- private durationGetting = false;
46
+ private durationGetting = false
26
47
 
27
- private _oldContainer: Container | undefined;
48
+ private _oldContainer: Container | undefined
28
49
 
29
- private svgMask: ZeptoResult | null = null;
50
+ private svgMask: ZeptoResult | null = null
30
51
 
52
+ /**
53
+ * @internal
54
+ */
31
55
  get name() {
32
- return 'media_control_clips';
56
+ return 'clips'
33
57
  }
34
58
 
59
+ /**
60
+ * @internal
61
+ */
35
62
  override get attributes() {
36
63
  return {
37
- 'class': this.name
38
- };
64
+ class: this.name,
65
+ }
39
66
  }
40
67
 
68
+ /**
69
+ * @internal
70
+ */
41
71
  override bindEvents() {
42
- this.listenToOnce(this.core, Events.CORE_READY, this._onCoreReady);
43
- this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this._onMediaControlContainerChanged);
44
- this.listenTo(this.core, Events.CORE_RESIZE, this.playerResize);
72
+ const mediaControl = this.core.getPlugin('media_control')
73
+ assert(mediaControl, 'media_control plugin is required')
74
+ this.listenToOnce(this.core, Events.CORE_READY, this._onCoreReady)
75
+ // TODO listen to CORE_ACTIVE_CONTAINER_CHANGED
76
+ this.listenTo(
77
+ mediaControl,
78
+ Events.MEDIACONTROL_CONTAINERCHANGED,
79
+ this._onMediaControlContainerChanged,
80
+ )
81
+ this.listenTo(this.core, Events.CORE_RESIZE, this.playerResize)
45
82
  }
46
83
 
47
84
  private _onCoreReady() {
48
85
  if (!this.options.clips) {
49
- this.destroy();
86
+ this.destroy()
50
87
 
51
- return;
88
+ return
52
89
  }
53
90
 
54
- this.parseClips();
55
- }
56
-
57
- unbindEvents() {
58
- // @ts-ignore
59
- this.stopListening(this.core, Events.CORE_READY);
60
- // @ts-ignore
61
- this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED);
91
+ this.parseClips()
62
92
  }
63
93
 
64
94
  private _onMediaControlContainerChanged() {
65
- this._bindContainerEvents();
95
+ this._bindContainerEvents()
66
96
  }
67
97
 
68
98
  private playerResize() {
69
- this.durationGetting = false;
99
+ this.durationGetting = false
70
100
  if (this.durationGetting) {
71
- this.makeSvg(this.duration);
101
+ this.makeSvg(this.duration)
72
102
  }
73
103
  }
74
104
 
75
105
  private _bindContainerEvents() {
76
106
  if (this._oldContainer) {
77
- this.stopListening(this._oldContainer, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
107
+ this.stopListening(
108
+ this._oldContainer,
109
+ Events.CONTAINER_TIMEUPDATE,
110
+ this.onTimeUpdate,
111
+ )
78
112
  }
79
113
 
80
- this._oldContainer = this.core.mediaControl.container;
81
- this.durationGetting = false;
82
- this.listenTo(this.core.mediaControl.container, Events.CONTAINER_TIMEUPDATE, this.onTimeUpdate);
114
+ const mediaControl = this.core.getPlugin('media_control')
115
+ this._oldContainer = mediaControl.container
116
+ this.durationGetting = false
117
+ this.listenTo(
118
+ mediaControl.container,
119
+ Events.CONTAINER_TIMEUPDATE,
120
+ this.onTimeUpdate,
121
+ )
83
122
  }
84
123
 
85
124
  private onTimeUpdate(event: TimeProgress) {
86
125
  if (!this.durationGetting) {
87
- this.duration = event.total;
88
- this.makeSvg(event.total);
89
- this.durationGetting = true;
126
+ this.duration = event.total
127
+ this.makeSvg(event.total)
128
+ this.durationGetting = true
90
129
  }
91
130
 
92
131
  for (const value of this.clips.values()) {
93
132
  if (event.current >= value.start && event.current < value.end) {
94
- this.setClipText(value.text);
95
- break;
133
+ this.setClipText(value.text)
134
+ break
96
135
  }
97
136
  }
98
137
  }
99
138
 
100
139
  private parseClips() {
101
- const textArr = this.options.clips.text.split('\n');
140
+ const textArr = this.options.clips.text.split('\n')
102
141
 
103
- const clipsArr = textArr.map((val: string) => {
104
- const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i);
142
+ const clipsArr = textArr
143
+ .map((val: string) => {
144
+ const matchRes = val.match(/(\d+:\d+|:\d+) (.+)/i)
105
145
 
106
- return matchRes ? {
107
- start: strtimeToMiliseconds(matchRes[1]),
108
- text: matchRes[2],
109
- } : null;
110
- }).filter((clip: ClipItem | null) => clip !== null);
146
+ return matchRes
147
+ ? {
148
+ start: strtimeToMiliseconds(matchRes[1]),
149
+ text: matchRes[2],
150
+ }
151
+ : null
152
+ })
153
+ .filter((clip: ClipItem | null) => clip !== null)
111
154
 
112
- clipsArr.sort((a: ClipDesc, b: ClipDesc) => a.start - b.start);
155
+ clipsArr.sort((a: ClipDesc, b: ClipDesc) => a.start - b.start)
113
156
 
114
157
  clipsArr.forEach((clip: ClipDesc, index: number) => {
115
158
  this.clips.set(clip.start, {
@@ -117,39 +160,49 @@ export class ClipsPlugin extends UICorePlugin {
117
160
  start: clip.start,
118
161
  text: clip.text,
119
162
  end: clipsArr[index + 1] ? clipsArr[index + 1].start : null,
120
- });
121
- });
163
+ })
164
+ })
122
165
  }
123
166
 
167
+ /**
168
+ * Returns the text of the current clip.
169
+ * @param time - The current time of the player.
170
+ * @returns The text of the current clip.
171
+ */
124
172
  getText(time: number) {
125
173
  for (const [key, value] of this.clips.entries()) {
126
174
  if (time >= value.start && time < value.end) {
127
- return value.text;
175
+ return value.text
128
176
  }
129
177
  }
130
- return '';
178
+ return ''
131
179
  }
132
180
 
133
- makeSvg(duration: number) {
134
- let svg = '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n';
135
- const widthOfSeek = this.core.mediaControl.container.$el.width();
136
- let finishValue = 0;
181
+ private makeSvg(duration: number) {
182
+ let svg =
183
+ '<svg width="0" height="0">\n' + '<defs>\n' + '<clipPath id="myClip">\n'
184
+ const widthOfSeek = this.core.activeContainer.$el.width()
185
+ let finishValue = 0
137
186
 
138
- this.clips.forEach(val => {
139
- let end = val.end;
187
+ this.clips.forEach((val) => {
188
+ let end = val.end
140
189
 
141
190
  if (!end) {
142
- end = val.end = duration;
191
+ end = val.end = duration
143
192
  }
144
193
 
145
- const widthChunk = (end - val.start) * widthOfSeek / duration;
194
+ const widthChunk = ((end - val.start) * widthOfSeek) / duration
146
195
 
147
- svg += `<rect x="${finishValue}" y="0" width="${widthChunk - 2}" height="30"/>\n`;
148
- finishValue += widthChunk;
149
- });
196
+ svg += `<rect x="${finishValue}" y="0" width="${
197
+ widthChunk - 2
198
+ }" height="30"/>\n`
199
+ finishValue += widthChunk
200
+ })
150
201
 
151
- svg += `<rect x="${finishValue}" y="0" width="${widthOfSeek - finishValue}" height="30"/>\n`;
152
- svg += '</clipPath>' + '</defs>' + '</svg>';
202
+ svg += `<rect x="${finishValue}" y="0" width="${
203
+ widthOfSeek - finishValue
204
+ }" height="30"/>\n`
205
+ svg += '</clipPath>' + '</defs>' + '</svg>'
153
206
  this.setSVGMask(svg)
154
207
  }
155
208
 
@@ -159,7 +212,9 @@ export class ClipsPlugin extends UICorePlugin {
159
212
  this.svgMask.remove()
160
213
  }
161
214
 
162
- const $seekBarContainer = this.core.mediaControl.getElement('seekBarContainer')
215
+ const mediaControl = this.core.getPlugin('media_control')
216
+ const $seekBarContainer =
217
+ mediaControl.getElement('seekBarContainer')
163
218
  if ($seekBarContainer?.get(0)) {
164
219
  $seekBarContainer.addClass('clips')
165
220
  }
@@ -169,7 +224,8 @@ export class ClipsPlugin extends UICorePlugin {
169
224
  }
170
225
 
171
226
  private setClipText(text: string) {
172
- const $clipText = this.core.mediaControl.getElement('clipText')
227
+ const mediaControl = this.core.getPlugin('media_control')
228
+ const $clipText = mediaControl.getElement('clipText')
173
229
  if ($clipText && text) {
174
230
  $clipText.show()
175
231
  $clipText.text(`${text}`)