@gcorevideo/player 2.18.3 → 2.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/assets/audio-selector/style.scss +156 -0
  2. package/assets/audio-selector/track-selector.ejs +12 -0
  3. package/assets/big-mute-button/big-mute-button.ejs +3 -0
  4. package/assets/big-mute-button/big-mute-button.scss +57 -0
  5. package/assets/bottom-gear/bottomgear.ejs +12 -0
  6. package/assets/bottom-gear/gear-sub-menu.scss +95 -0
  7. package/assets/bottom-gear/gear.scss +79 -0
  8. package/assets/clappr-nerd-stats/button.ejs +4 -0
  9. package/assets/clappr-nerd-stats/clappr-nerd-stats.ejs +212 -0
  10. package/assets/clappr-nerd-stats/clappr-nerd-stats.scss +488 -0
  11. package/assets/clappr-nerd-stats/options-list.ejs +9 -0
  12. package/assets/clappr-nerd-stats/settings.ejs +12 -0
  13. package/assets/clappr-nerd-stats/speedtest/speedtest.worker.js +775 -0
  14. package/assets/clips/clips.scss +3 -0
  15. package/assets/context-menu/context_menu.ejs +8 -0
  16. package/assets/context-menu/context_menu.scss +31 -0
  17. package/assets/dvr-controls/dvr_controls.scss +136 -0
  18. package/assets/dvr-controls/index.ejs +2 -0
  19. package/assets/error-screen/error_screen.ejs +13 -0
  20. package/assets/error-screen/error_screen.scss +40 -0
  21. package/assets/icons/new/arrow-left.svg +5 -0
  22. package/assets/icons/new/arrow-right.svg +5 -0
  23. package/assets/icons/new/check.svg +5 -0
  24. package/assets/icons/new/close.svg +12 -0
  25. package/assets/icons/new/full.svg +8 -0
  26. package/assets/icons/new/fullscreen-off.svg +14 -0
  27. package/assets/icons/new/fullscreen-on.svg +14 -0
  28. package/assets/icons/new/gear-hd.svg +16 -0
  29. package/assets/icons/new/gear.svg +12 -0
  30. package/assets/icons/new/hd.svg +8 -0
  31. package/assets/icons/new/pause.svg +5 -0
  32. package/assets/icons/new/pip.svg +5 -0
  33. package/assets/icons/new/play.svg +10 -0
  34. package/assets/icons/new/replayleft.svg +5 -0
  35. package/assets/icons/new/replayright.svg +5 -0
  36. package/assets/icons/new/speed.svg +5 -0
  37. package/assets/icons/new/stats.svg +3 -0
  38. package/assets/icons/new/stop.svg +3 -0
  39. package/assets/icons/new/subtitles-off.svg +5 -0
  40. package/assets/icons/new/subtitles-on.svg +6 -0
  41. package/assets/icons/new/volume-max.svg +5 -0
  42. package/assets/icons/new/volume-min.svg +5 -0
  43. package/assets/icons/new/volume-off.svg +5 -0
  44. package/assets/icons/old/cardboard.svg +4 -0
  45. package/assets/icons/old/close-share.svg +13 -0
  46. package/assets/icons/old/close.svg +13 -0
  47. package/assets/icons/old/fb.svg +13 -0
  48. package/assets/icons/old/fullscreen.svg +12 -0
  49. package/assets/icons/old/language.svg +1 -0
  50. package/assets/icons/old/pause.svg +12 -0
  51. package/assets/icons/old/play.svg +12 -0
  52. package/assets/icons/old/quality-arrow.svg +13 -0
  53. package/assets/icons/old/reload.svg +4 -0
  54. package/assets/icons/old/share.svg +13 -0
  55. package/assets/icons/old/sound-off.svg +15 -0
  56. package/assets/icons/old/sound-on.svg +15 -0
  57. package/assets/icons/old/streams.svg +3 -0
  58. package/assets/icons/old/twitter.svg +13 -0
  59. package/assets/icons/old/wn.svg +15 -0
  60. package/assets/icons/standard/01-play.svg +3 -0
  61. package/assets/icons/standard/02-pause.svg +3 -0
  62. package/assets/icons/standard/03-stop.svg +3 -0
  63. package/assets/icons/standard/04-volume.svg +3 -0
  64. package/assets/icons/standard/05-mute.svg +3 -0
  65. package/assets/icons/standard/06-expand.svg +3 -0
  66. package/assets/icons/standard/07-shrink.svg +3 -0
  67. package/assets/icons/standard/08-hd.svg +3 -0
  68. package/assets/icons/standard/09-cc.svg +8 -0
  69. package/assets/icons/standard/10-reload.svg +4 -0
  70. package/assets/level-selector/button.ejs +8 -0
  71. package/assets/level-selector/list.ejs +22 -0
  72. package/assets/level-selector/style.scss +4 -0
  73. package/assets/logo/styles/logo.scss +10 -0
  74. package/assets/logo/templates/logo.ejs +3 -0
  75. package/assets/media-control/closed-hand.cur +0 -0
  76. package/assets/media-control/container.scss +57 -0
  77. package/assets/media-control/media-control.ejs +133 -0
  78. package/assets/media-control/media-control.scss +390 -0
  79. package/assets/media-control/plugins.scss +94 -0
  80. package/assets/media-control/width270.scss +50 -0
  81. package/assets/media-control/width370.scss +263 -0
  82. package/assets/multi-camera/multicamera.ejs +29 -0
  83. package/assets/multi-camera/style.scss +176 -0
  84. package/assets/picture-in-picture/button.ejs +3 -0
  85. package/assets/picture-in-picture/button.scss +11 -0
  86. package/assets/playback-rate/button.ejs +6 -0
  87. package/assets/playback-rate/list.ejs +14 -0
  88. package/assets/playback-rate/playback-rate-selector.ejs +9 -0
  89. package/assets/poster/poster.ejs +1 -0
  90. package/assets/poster/poster.scss +32 -0
  91. package/assets/seek-time/seek-time.html +2 -0
  92. package/assets/seek-time/seek-time.scss +38 -0
  93. package/assets/share/share.ejs +37 -0
  94. package/assets/share/style.scss +104 -0
  95. package/assets/skip-time/skip-time.ejs +8 -0
  96. package/assets/skip-time/style.scss +24 -0
  97. package/assets/spinner-three-bounce/spinner.ejs +3 -0
  98. package/assets/spinner-three-bounce/spinner.scss +44 -0
  99. package/assets/style/main.scss +50 -0
  100. package/assets/style/theme.scss +42 -0
  101. package/assets/style/variables.scss +7 -0
  102. package/assets/subtitles/combobox copy.ejs +16 -0
  103. package/assets/subtitles/combobox.ejs +16 -0
  104. package/assets/subtitles/string.ejs +3 -0
  105. package/assets/subtitles/style.scss +99 -0
  106. package/assets/thumbnails/scrub-thumbnails.ejs +10 -0
  107. package/assets/thumbnails/style.scss +75 -0
  108. package/assets/vast-ads/style.scss +112 -0
  109. package/assets/video360/button.ejs +1 -0
  110. package/assets/video360/style.scss +8 -0
  111. package/build/vite-raw-plugin.js +18 -0
  112. package/dist/index.js +1 -1
  113. package/dist/plugins/index.css +2164 -0
  114. package/dist/{index-C02TmVOf.js → plugins/index.js/index.plugins.js} +29283 -29567
  115. package/lib/index.core.d.ts +15 -0
  116. package/lib/index.core.d.ts.map +1 -0
  117. package/lib/index.core.js +14 -0
  118. package/lib/index.d.ts +2 -14
  119. package/lib/index.d.ts.map +1 -1
  120. package/lib/index.js +2 -14
  121. package/lib/index.plugins.d.ts +37 -0
  122. package/lib/index.plugins.d.ts.map +1 -0
  123. package/lib/index.plugins.js +39 -0
  124. package/lib/plugins/audio-selector/AudioSelector.d.ts +3 -3
  125. package/lib/plugins/audio-selector/AudioSelector.d.ts.map +1 -1
  126. package/lib/plugins/audio-selector/AudioSelector.js +6 -12
  127. package/lib/plugins/big-mute-button/BigMuteButton.d.ts +2 -2
  128. package/lib/plugins/big-mute-button/BigMuteButton.d.ts.map +1 -1
  129. package/lib/plugins/big-mute-button/BigMuteButton.js +7 -12
  130. package/lib/plugins/bottom-gear/BottomGear.d.ts +4 -3
  131. package/lib/plugins/bottom-gear/BottomGear.d.ts.map +1 -1
  132. package/lib/plugins/bottom-gear/BottomGear.js +11 -16
  133. package/lib/plugins/build.d.ts +2 -0
  134. package/lib/plugins/build.d.ts.map +1 -0
  135. package/lib/plugins/build.js +1 -0
  136. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +44 -0
  137. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -0
  138. package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +294 -0
  139. package/lib/plugins/clappr-nerd-stats/formatter.d.ts +8 -0
  140. package/lib/plugins/clappr-nerd-stats/formatter.d.ts.map +1 -0
  141. package/lib/plugins/clappr-nerd-stats/formatter.js +91 -0
  142. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts +54 -0
  143. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.d.ts.map +1 -0
  144. package/lib/plugins/clappr-nerd-stats/speedtest/Speedtest.js +335 -0
  145. package/lib/plugins/clappr-nerd-stats/speedtest/index.d.ts +9 -0
  146. package/lib/plugins/clappr-nerd-stats/speedtest/index.d.ts.map +1 -0
  147. package/lib/plugins/clappr-nerd-stats/speedtest/index.js +154 -0
  148. package/lib/plugins/clappr-nerd-stats/speedtest/types.d.ts +6 -0
  149. package/lib/plugins/clappr-nerd-stats/speedtest/types.d.ts.map +1 -0
  150. package/lib/plugins/clappr-nerd-stats/types.d.ts +4 -0
  151. package/lib/plugins/clappr-nerd-stats/types.d.ts.map +1 -0
  152. package/lib/plugins/clappr-stats/ClapprStats.d.ts +56 -0
  153. package/lib/plugins/clappr-stats/ClapprStats.d.ts.map +1 -0
  154. package/lib/plugins/clappr-stats/ClapprStats.js +332 -0
  155. package/lib/plugins/clappr-stats/types.d.ts +50 -0
  156. package/lib/plugins/clappr-stats/types.d.ts.map +1 -0
  157. package/lib/plugins/clappr-stats/types.js +5 -0
  158. package/lib/plugins/clappr-stats/utils.d.ts +3 -0
  159. package/lib/plugins/clappr-stats/utils.d.ts.map +1 -0
  160. package/lib/plugins/clappr-stats/utils.js +40 -0
  161. package/lib/plugins/click-to-pause/ClickToPause.d.ts +2 -2
  162. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  163. package/lib/plugins/click-to-pause/ClickToPause.js +4 -6
  164. package/lib/plugins/clips/Clips.d.ts +23 -0
  165. package/lib/plugins/clips/Clips.d.ts.map +1 -0
  166. package/lib/plugins/clips/Clips.js +109 -0
  167. package/lib/plugins/context-menu/ContextMenu.d.ts +36 -0
  168. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -0
  169. package/lib/plugins/context-menu/ContextMenu.js +102 -0
  170. package/lib/plugins/disable-controls/DisableControls.d.ts +1 -1
  171. package/lib/plugins/disable-controls/DisableControls.d.ts.map +1 -1
  172. package/lib/plugins/disable-controls/DisableControls.js +3 -5
  173. package/lib/plugins/dvr-controls/{DVRControls.d.ts → DvrControls.d.ts} +4 -4
  174. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -0
  175. package/lib/plugins/dvr-controls/{DVRControls.js → DvrControls.js} +5 -4
  176. package/lib/plugins/error-screen/ErrorScreen.d.ts +44 -0
  177. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -0
  178. package/lib/plugins/error-screen/ErrorScreen.js +179 -0
  179. package/lib/plugins/favicon/Favicon.d.ts +24 -0
  180. package/lib/plugins/favicon/Favicon.d.ts.map +1 -0
  181. package/lib/plugins/favicon/Favicon.js +106 -0
  182. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts +30 -0
  183. package/lib/plugins/google-analytics/GoogleAnalytics.d.ts.map +1 -0
  184. package/lib/plugins/google-analytics/GoogleAnalytics.js +114 -0
  185. package/lib/plugins/index.d.ts +38 -0
  186. package/lib/plugins/index.d.ts.map +1 -0
  187. package/lib/plugins/index.js +40 -0
  188. package/lib/plugins/kibo/index.d.ts +23 -0
  189. package/lib/plugins/kibo/index.d.ts.map +1 -0
  190. package/lib/plugins/kibo/index.js +199 -0
  191. package/lib/plugins/level-selector/LevelSelector.d.ts +48 -17
  192. package/lib/plugins/level-selector/LevelSelector.d.ts.map +1 -1
  193. package/lib/plugins/level-selector/LevelSelector.js +169 -155
  194. package/lib/plugins/logo/Logo.d.ts +29 -0
  195. package/lib/plugins/logo/Logo.d.ts.map +1 -0
  196. package/lib/plugins/logo/Logo.js +181 -0
  197. package/lib/plugins/logo/utils/index.d.ts +22 -0
  198. package/lib/plugins/logo/utils/index.d.ts.map +1 -0
  199. package/lib/plugins/logo/utils/index.js +32 -0
  200. package/lib/plugins/media-control/MediaControl.d.ts +20 -25
  201. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  202. package/lib/plugins/media-control/MediaControl.js +136 -106
  203. package/lib/plugins/multi-camera/MultiCamera.d.ts +59 -0
  204. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -0
  205. package/lib/plugins/multi-camera/MultiCamera.js +353 -0
  206. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +20 -0
  207. package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -0
  208. package/lib/plugins/picture-in-picture/PictureInPicture.js +68 -0
  209. package/lib/plugins/playback-rate/PlaybackRate.d.ts +42 -0
  210. package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -0
  211. package/lib/plugins/playback-rate/PlaybackRate.js +205 -0
  212. package/lib/plugins/poster/Poster.d.ts +18 -17
  213. package/lib/plugins/poster/Poster.d.ts.map +1 -1
  214. package/lib/plugins/poster/Poster.js +83 -37
  215. package/lib/plugins/seek-time/SeekTime.d.ts +38 -0
  216. package/lib/plugins/seek-time/SeekTime.d.ts.map +1 -0
  217. package/lib/plugins/seek-time/SeekTime.js +153 -0
  218. package/lib/plugins/share/Share.d.ts +38 -0
  219. package/lib/plugins/share/Share.d.ts.map +1 -0
  220. package/lib/plugins/share/Share.js +122 -0
  221. package/lib/plugins/skip-time/SkipTime.d.ts +28 -0
  222. package/lib/plugins/skip-time/SkipTime.d.ts.map +1 -0
  223. package/lib/plugins/skip-time/SkipTime.js +86 -0
  224. package/lib/plugins/source-controller/SourceController.d.ts +41 -0
  225. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -0
  226. package/lib/plugins/source-controller/SourceController.js +199 -0
  227. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +26 -0
  228. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -0
  229. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +117 -0
  230. package/lib/plugins/statistics/Statistics.d.ts +52 -0
  231. package/lib/plugins/statistics/Statistics.d.ts.map +1 -0
  232. package/lib/plugins/statistics/Statistics.js +130 -0
  233. package/lib/plugins/subtitles/Subtitles.d.ts +61 -0
  234. package/lib/plugins/subtitles/Subtitles.d.ts.map +1 -0
  235. package/lib/plugins/subtitles/Subtitles.js +354 -0
  236. package/lib/plugins/thumbnails/Thumbnails.d.ts +47 -0
  237. package/lib/plugins/thumbnails/Thumbnails.d.ts.map +1 -0
  238. package/lib/plugins/thumbnails/Thumbnails.js +414 -0
  239. package/lib/plugins/types.d.ts +8 -0
  240. package/lib/plugins/types.d.ts.map +1 -0
  241. package/lib/plugins/types.js +1 -0
  242. package/lib/plugins/utils.d.ts +5 -0
  243. package/lib/plugins/utils.d.ts.map +1 -0
  244. package/lib/plugins/utils.js +68 -0
  245. package/lib/plugins/vast-ads/VastAds.d.ts +72 -0
  246. package/lib/plugins/vast-ads/VastAds.d.ts.map +1 -0
  247. package/lib/plugins/vast-ads/VastAds.js +686 -0
  248. package/lib/plugins/vast-ads/loaderxml.d.ts +32 -0
  249. package/lib/plugins/vast-ads/loaderxml.d.ts.map +1 -0
  250. package/lib/plugins/vast-ads/loaderxml.js +226 -0
  251. package/lib/plugins/vast-ads/roll.d.ts +60 -0
  252. package/lib/plugins/vast-ads/roll.d.ts.map +1 -0
  253. package/lib/plugins/vast-ads/roll.js +415 -0
  254. package/lib/plugins/vast-ads/rollmanager.d.ts +62 -0
  255. package/lib/plugins/vast-ads/rollmanager.d.ts.map +1 -0
  256. package/lib/plugins/vast-ads/rollmanager.js +347 -0
  257. package/lib/plugins/vast-ads/sctemanager.d.ts +18 -0
  258. package/lib/plugins/vast-ads/sctemanager.d.ts.map +1 -0
  259. package/lib/plugins/vast-ads/sctemanager.js +116 -0
  260. package/lib/plugins/vast-ads/types.d.ts +12 -0
  261. package/lib/plugins/vast-ads/types.d.ts.map +1 -0
  262. package/lib/plugins/vast-ads/types.js +1 -0
  263. package/lib/plugins/vast-ads/urlhandler.d.ts +4 -0
  264. package/lib/plugins/vast-ads/urlhandler.d.ts.map +1 -0
  265. package/lib/plugins/vast-ads/urlhandler.js +30 -0
  266. package/lib/plugins/vast-ads/xmlhttprequest.d.ts +6 -0
  267. package/lib/plugins/vast-ads/xmlhttprequest.d.ts.map +1 -0
  268. package/lib/plugins/vast-ads/xmlhttprequest.js +39 -0
  269. package/lib/plugins/vast-ads/xmlmerge.d.ts +12 -0
  270. package/lib/plugins/vast-ads/xmlmerge.d.ts.map +1 -0
  271. package/lib/plugins/vast-ads/xmlmerge.js +82 -0
  272. package/lib/plugins/volume-fade/VolumeFade.d.ts +21 -0
  273. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -0
  274. package/lib/plugins/volume-fade/VolumeFade.js +90 -0
  275. package/package.json +10 -2
  276. package/rollup.config.js +32 -2
  277. package/src/index.core.ts +15 -0
  278. package/src/index.plugins.ts +41 -0
  279. package/src/index.ts +2 -15
  280. package/src/plugins/audio-selector/AudioSelector.ts +370 -0
  281. package/src/plugins/big-mute-button/BigMuteButton.ts +187 -0
  282. package/src/plugins/bottom-gear/BottomGear.ts +122 -0
  283. package/src/plugins/build.ts +1 -0
  284. package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +369 -0
  285. package/src/plugins/clappr-nerd-stats/formatter.ts +109 -0
  286. package/src/plugins/clappr-nerd-stats/speedtest/Speedtest.ts +414 -0
  287. package/src/plugins/clappr-nerd-stats/speedtest/index.ts +183 -0
  288. package/src/plugins/clappr-nerd-stats/speedtest/types.ts +5 -0
  289. package/src/plugins/clappr-nerd-stats/types.ts +3 -0
  290. package/src/plugins/clappr-stats/ClapprStats.ts +441 -0
  291. package/src/plugins/clappr-stats/types.ts +52 -0
  292. package/src/plugins/clappr-stats/utils.ts +42 -0
  293. package/src/plugins/click-to-pause/ClickToPause.ts +93 -0
  294. package/src/plugins/clips/Clips.ts +152 -0
  295. package/src/plugins/context-menu/ContextMenu.ts +134 -0
  296. package/src/plugins/disable-controls/DisableControls.ts +81 -0
  297. package/src/plugins/dvr-controls/DvrControls.ts +131 -0
  298. package/src/plugins/error-screen/ErrorScreen.ts +241 -0
  299. package/src/plugins/favicon/Favicon.ts +137 -0
  300. package/src/plugins/ga-events/GaEvents.js +395 -0
  301. package/src/plugins/ga-events/ga-tracking.js +46 -0
  302. package/src/plugins/google-analytics/GoogleAnalytics.ts +147 -0
  303. package/src/plugins/index.ts +42 -0
  304. package/src/plugins/kibo/index.ts +244 -0
  305. package/src/plugins/level-selector/LevelSelector.ts +400 -0
  306. package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +72 -0
  307. package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +11 -0
  308. package/src/plugins/logo/Logo.ts +233 -0
  309. package/src/plugins/logo/utils/index.ts +46 -0
  310. package/src/plugins/media-control/MediaControl.ts +1383 -0
  311. package/src/plugins/multi-camera/MultiCamera copy.xts +414 -0
  312. package/src/plugins/multi-camera/MultiCamera.ts +426 -0
  313. package/src/plugins/picture-in-picture/PictureInPicture.ts +87 -0
  314. package/src/plugins/playback-rate/PlaybackRate.ts +269 -0
  315. package/src/plugins/poster/Poster.ts +298 -0
  316. package/src/plugins/seek-time/SeekTime.ts +191 -0
  317. package/src/plugins/share/Share.ts +148 -0
  318. package/src/plugins/skip-time/SkipTime.ts +109 -0
  319. package/src/plugins/source-controller/SourceController.ts +239 -0
  320. package/src/plugins/source-controller/__tests__/SourceController.test.ts +230 -0
  321. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +135 -0
  322. package/src/plugins/statistics/Statistics copy.xts +296 -0
  323. package/src/plugins/statistics/Statistics.ts +207 -0
  324. package/src/plugins/subtitles/Subtitles.ts +505 -0
  325. package/src/plugins/thumbnails/Thumbnails.ts +530 -0
  326. package/src/plugins/types.ts +7 -0
  327. package/src/plugins/typings/globals.d.ts +10 -0
  328. package/src/plugins/typings/parse-srt.d.ts +14 -0
  329. package/src/plugins/typings/workers.d.ts +3 -0
  330. package/src/plugins/utils.ts +77 -0
  331. package/src/plugins/vast-ads/VastAds.ts +915 -0
  332. package/src/plugins/vast-ads/loaderxml.ts +260 -0
  333. package/src/plugins/vast-ads/roll.ts +492 -0
  334. package/src/plugins/vast-ads/rollmanager.ts +403 -0
  335. package/src/plugins/vast-ads/sctemanager.ts +134 -0
  336. package/src/plugins/vast-ads/types.ts +14 -0
  337. package/src/plugins/vast-ads/urlhandler.ts +37 -0
  338. package/src/plugins/vast-ads/xmlhttprequest.ts +44 -0
  339. package/src/plugins/vast-ads/xmlmerge.ts +96 -0
  340. package/src/plugins/video360/VRControls.js +104 -0
  341. package/src/plugins/video360/VREffect.js +422 -0
  342. package/src/plugins/video360/Video360.js +979 -0
  343. package/src/plugins/video360/orbit-oriention-controls.js +1002 -0
  344. package/src/plugins/video360/utils.js +49 -0
  345. package/src/plugins/volume-fade/VolumeFade.ts +109 -0
  346. package/tsconfig.tsbuildinfo +1 -1
  347. package/dist/HlsPlayback-D9EmONbV.js +0 -747
  348. package/dist/player.d.ts +0 -646
  349. package/lib/backend.d.ts +0 -3
  350. package/lib/backend.d.ts.map +0 -1
  351. package/lib/backend.js +0 -10
  352. package/lib/constants.d.ts +0 -1
  353. package/lib/constants.d.ts.map +0 -1
  354. package/lib/constants.js +0 -1
  355. package/lib/gcore.types.d.ts +0 -84
  356. package/lib/gcore.types.d.ts.map +0 -1
  357. package/lib/gcore.types.js +0 -9
  358. package/lib/plugins/dash-playback/DashPlayback.d.ts +0 -73
  359. package/lib/plugins/dash-playback/DashPlayback.d.ts.map +0 -1
  360. package/lib/plugins/dash-playback/DashPlayback.js +0 -455
  361. package/lib/plugins/dash-playback/types.d.ts +0 -6
  362. package/lib/plugins/dash-playback/types.d.ts.map +0 -1
  363. package/lib/plugins/dash-plugin/DashPlayback.d.ts +0 -86
  364. package/lib/plugins/dash-plugin/DashPlayback.d.ts.map +0 -1
  365. package/lib/plugins/dash-plugin/DashPlayback.js +0 -659
  366. package/lib/plugins/dvr-controls/DVRControls.d.ts.map +0 -1
  367. package/lib/plugins/hls-playback/HlsPlayback.d.ts +0 -102
  368. package/lib/plugins/hls-playback/HlsPlayback.d.ts.map +0 -1
  369. package/lib/plugins/hls-playback/HlsPlayback.js +0 -815
  370. package/lib/trace/LogTracer.d.ts +0 -12
  371. package/lib/trace/LogTracer.d.ts.map +0 -1
  372. package/lib/trace/LogTracer.js +0 -17
  373. package/lib/trace/SentryTracer.d.ts +0 -12
  374. package/lib/trace/SentryTracer.d.ts.map +0 -1
  375. package/lib/trace/SentryTracer.js +0 -23
  376. package/lib/trace/Tracer.d.ts +0 -13
  377. package/lib/trace/Tracer.d.ts.map +0 -1
  378. package/lib/trace/Tracer.js +0 -15
  379. package/lib/trace/index.d.ts +0 -18
  380. package/lib/trace/index.d.ts.map +0 -1
  381. package/lib/trace/index.js +0 -27
  382. package/lib/trace/types.d.ts +0 -8
  383. package/lib/trace/types.d.ts.map +0 -1
  384. package/lib/tsdoc-metadata.json +0 -11
  385. package/lib/utils/Logger.d.ts +0 -23
  386. package/lib/utils/Logger.d.ts.map +0 -1
  387. package/lib/utils/Logger.js +0 -81
  388. package/lib/utils/canAutoplay.d.ts +0 -6
  389. package/lib/utils/canAutoplay.d.ts.map +0 -1
  390. package/lib/utils/canAutoplay.js +0 -30
  391. package/lib/utils/queryParams.d.ts +0 -2
  392. package/lib/utils/queryParams.d.ts.map +0 -1
  393. package/lib/utils/queryParams.js +0 -4
  394. package/lib/utils/scripts-load.d.ts +0 -2
  395. package/lib/utils/scripts-load.d.ts.map +0 -1
  396. package/lib/utils/scripts-load.js +0 -20
  397. package/lib/utils/testUtils.d.ts +0 -3
  398. package/lib/utils/testUtils.d.ts.map +0 -1
  399. package/lib/utils/testUtils.js +0 -12
  400. package/lib/utils/utils.d.ts +0 -3
  401. package/lib/utils/utils.d.ts.map +0 -1
  402. package/lib/utils/utils.js +0 -31
  403. /package/lib/plugins/{dash-playback → clappr-nerd-stats/speedtest}/types.js +0 -0
  404. /package/lib/{trace → plugins/clappr-nerd-stats}/types.js +0 -0
@@ -0,0 +1,426 @@
1
+ import { Browser, Core, Events, Playback, template, UICorePlugin } from '@clappr/core';
2
+ import { reportError, trace } from '@gcorevideo/utils';
3
+
4
+ import { CLAPPR_VERSION } from '../build.js';
5
+
6
+ import pluginHtml from '../../../assets/multi-camera/multicamera.ejs';
7
+ import '../../../assets/multi-camera/style.scss';
8
+
9
+ import streamsIcon from '../../../assets/icons/old/streams.svg';
10
+ import streamsMomentoIcon from '../../../assets/icons/old/language.svg';
11
+ import streamsWhiteNightsIcon from '../../../assets/icons/old/wn.svg';
12
+ import { ZeptoResult } from '../types.js';
13
+
14
+ type MultisourcesMode = 'one_first' | 'only_live' | 'show_all';
15
+
16
+ type MediaSourceInfo = {
17
+ live: boolean;
18
+ source: string;
19
+ id: number;
20
+ dvr: boolean;
21
+ projection: string | null;
22
+ }
23
+
24
+ const VERSION = '0.0.1';
25
+
26
+ const T = 'plugins.multicamera';
27
+
28
+ export class MultiCamera extends UICorePlugin {
29
+ private currentCamera: MediaSourceInfo | null = null;
30
+
31
+ private currentTime: number = 0;
32
+
33
+ private playing = false;
34
+
35
+ private multicamera: MediaSourceInfo[] = [];
36
+
37
+ private noActiveStreams = false;
38
+
39
+ get name() {
40
+ return 'multicamera';
41
+ }
42
+
43
+ get supportedVersion() {
44
+ return { min: CLAPPR_VERSION };
45
+ }
46
+
47
+ static get version() {
48
+ return VERSION;
49
+ }
50
+
51
+ get template() {
52
+ return template(pluginHtml);
53
+ }
54
+
55
+ override get attributes() {
56
+ return {
57
+ 'class': this.name,
58
+ 'data-multicamera': ''
59
+ };
60
+ }
61
+
62
+ override get events() {
63
+ return {
64
+ 'click [data-multicamera-selector-select]': 'onCameraSelect',
65
+ 'click [data-multicamera-button]': 'onShowLevelSelectMenu'
66
+ };
67
+ }
68
+
69
+ constructor(core: Core) {
70
+ super(core);
71
+ if (!this.options.multisources || !Array.isArray(this.options.multisources)) {
72
+ this.destroy();
73
+ return;
74
+ }
75
+ this.playing = this.options.multicameraPlay;
76
+ // Don't mutate the options, TODO check if some plugin observes the options.multicamera
77
+ this.multicamera = this.options.multisources.map((item: MediaSourceInfo) => ({ ...item }));
78
+ this.noActiveStreams = this.multicamera.every((item) => !item.live);
79
+ }
80
+
81
+ override bindEvents() {
82
+ this.listenTo(this.core, Events.CORE_READY, this.bindPlaybackEvents);
83
+ this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED, this.reload);
84
+ this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render);
85
+ this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_HIDE, this.hideSelectLevelMenu);
86
+ }
87
+
88
+ unBindEvents() {
89
+ // @ts-ignore
90
+ this.stopListening(this.core, Events.CORE_READY);
91
+ // @ts-ignore
92
+ this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_CONTAINERCHANGED);
93
+ // @ts-ignore
94
+ this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_RENDERED);
95
+ // @ts-ignore
96
+ this.stopListening(this.core.mediaControl, Events.MEDIACONTROL_HIDE);
97
+ // @ts-ignore
98
+ this.stopListening(this.core.activePlayback, Events.PLAYBACK_PLAY, this.onPlay);
99
+ }
100
+
101
+ private onPlay() {
102
+ this.playing = true;
103
+ }
104
+
105
+ private bindPlaybackEvents() {
106
+ const currentPlayback = this.core.activePlayback;
107
+
108
+ this.listenToOnce(currentPlayback, Events.PLAYBACK_PLAY, this.onPlay);
109
+ }
110
+
111
+ private reload() {
112
+ this.unBindEvents();
113
+ this.bindEvents();
114
+ this.bindPlaybackEvents();
115
+ }
116
+
117
+ private shouldRender() {
118
+ if (!this.core.activeContainer || this.noActiveStreams) {
119
+ return false;
120
+ }
121
+
122
+ if (!this.core.activePlayback) {
123
+ return false;
124
+ }
125
+
126
+ return this.multicamera.length >= 2;
127
+ }
128
+
129
+ override render() {
130
+ if (this.shouldRender()) {
131
+ let numActiveSources = 0;
132
+ // const currentSource = this.core.options.source
133
+ const currentSource = this.core.activePlayback?.sourceMedia
134
+
135
+ for (const item of this.multicamera) {
136
+ if (item.live) {
137
+ numActiveSources++;
138
+ }
139
+ if (!this.currentCamera && item.source === currentSource) {
140
+ this.currentCamera = item;
141
+ }
142
+ }
143
+
144
+ // const mediaControl = this.core.getPlugin('media_control')
145
+ if (
146
+ this.currentTime &&
147
+ // TODO check the last active playback type instead
148
+ // !mediaControl.$el.hasClass('live') &&
149
+ this.core.getPlaybackType() !== Playback.LIVE
150
+ ) {
151
+ if (this.currentTime < this.core.activePlayback.getDuration()) {
152
+ this.core.activePlayback.seek(this.currentTime);
153
+ }
154
+
155
+ this.currentTime = 0;
156
+
157
+ // if (mediaControl.$el.hasClass('dvr')) {
158
+ // this.core.activeContainer.dvrInUse = true;
159
+ // }
160
+ }
161
+
162
+ // TODO current source
163
+ this.$el
164
+ .html(this.template({ 'streams': this.multicamera, 'multisources_mode': this.options.multisourcesMode }));
165
+
166
+ if (
167
+ (numActiveSources <= 1 && this.options.multisourcesMode !== "show_all") ||
168
+ this.options.multisourcesMode === "one_first"
169
+ ) {
170
+ this.$el.hide();
171
+ } else {
172
+ this.$el.show();
173
+ }
174
+
175
+ if (
176
+ this.core.mediaControl.$multiCameraSelector &&
177
+ this.core.mediaControl.$multiCameraSelector.length > 0
178
+ ) {
179
+ this.core.mediaControl.$multiCameraSelector.append(this.el);
180
+ } else {
181
+ this.core.mediaControl.$('.media-control-right-panel').append(this.el);
182
+ }
183
+ if (
184
+ Object.prototype.hasOwnProperty.call(this.core.mediaControl, '$multiCameraSelector') &&
185
+ this.core.mediaControl.$multiCameraSelector.find('span.multicamera-icon').length > 0
186
+ ) {
187
+ if (~window.location.href.indexOf('whitenights.gcdn.co')) {
188
+ this.core.mediaControl.$multiCameraSelector.find('span.multicamera-icon').append(streamsWhiteNightsIcon);
189
+ } else if (~window.location.href.indexOf('momentosolutions.gcdn.co')) {
190
+ this.core.mediaControl.$multiCameraSelector.find('span.multicamera-icon').append(streamsMomentoIcon);
191
+ } else {
192
+ this.core.mediaControl.$multiCameraSelector.find('span.multicamera-icon').append(streamsIcon);
193
+ }
194
+ }
195
+ this.highlightCurrentLevel();
196
+ }
197
+
198
+ return this;
199
+ }
200
+
201
+ private onCameraSelect(event: MouseEvent) {
202
+ const value = (event.currentTarget as HTMLElement).dataset.multicameraSelectorSelect;
203
+ trace(`${T} onCameraSelect`, { value });
204
+ if (value !== undefined) {
205
+ this.changeById(parseInt(value, 10));
206
+ }
207
+ event.stopPropagation();
208
+ return false;
209
+ }
210
+
211
+ activeById(id: number, active: boolean) {
212
+ this.setLiveStatus(id, active);
213
+
214
+ if (!this.currentCamera && !this.noActiveStreams) {
215
+ return;
216
+ }
217
+ if (this.noActiveStreams && !active) {
218
+ return;
219
+ }
220
+
221
+ if (this.currentCamera) {
222
+ if (this.options.multisourcesMode === "only_live") {
223
+ this.behaviorLive(id, active);
224
+ }
225
+ if (this.options.multisourcesMode === "one_first") {
226
+ this.behaviorOne(id, active);
227
+ }
228
+ if (this.options.multisourcesMode === "show_all") {
229
+ this.behaviorAll(id, active);
230
+ }
231
+ } else {
232
+ if (this.noActiveStreams && active) {
233
+ this.changeById(id);
234
+ this.noActiveStreams = false;
235
+ }
236
+ }
237
+
238
+ this.render();
239
+ }
240
+
241
+ private setLiveStatus(id: number, active: boolean) {
242
+ try {
243
+ const index = this.findIndexById(id);
244
+ if (index < 0) {
245
+ return;
246
+ }
247
+ this.multicamera[index].live = active;
248
+ if (this.levelElement(id).length) {
249
+ this.levelElement(id)[0].dataset.multicameraSelectorLive = active;
250
+ }
251
+ } catch (error) {
252
+ reportError(error);
253
+ }
254
+ }
255
+
256
+ private behaviorLive(id: number, active: boolean) {
257
+ try {
258
+ if (active) {
259
+ this.levelElement(id).parent().show();
260
+ } else {
261
+ this.levelElement(id).parent().hide();
262
+ }
263
+ } catch (error) {
264
+ reportError(error);
265
+ return;
266
+ }
267
+
268
+ this.findAndInitNextStream(id, active);
269
+ }
270
+
271
+ private behaviorOne(id: number, active: boolean) {
272
+ this.$el.hide();
273
+ this.findAndInitNextStream(id, active);
274
+ }
275
+
276
+ private behaviorAll(id: number, active: boolean) {
277
+ if (this.currentCamera?.id === id) {
278
+ if (active) {
279
+ this.hideError();
280
+ this.changeById(id);
281
+ } else {
282
+ this.showError();
283
+ }
284
+ }
285
+ }
286
+
287
+ private findAndInitNextStream(id: number, active: boolean) {
288
+ if (active || this.currentCamera?.id !== id) {
289
+ return;
290
+ }
291
+
292
+ const current = this.findIndexById(id);
293
+ let counter = 1;
294
+
295
+ while (counter < this.multicamera.length) {
296
+ const changeIndex = (counter + current) % this.multicamera.length;
297
+ if (this.multicamera[changeIndex].live) {
298
+ this.changeById(this.multicamera[changeIndex].id);
299
+ return;
300
+ }
301
+ counter++;
302
+ }
303
+ this.currentCamera = null;
304
+ this.noActiveStreams = true;
305
+ this.core.trigger('core:multicamera:no_active_translation');
306
+ // this.changeById(this.multicamera[nextIndex].id);
307
+ }
308
+
309
+ private showError() {
310
+ this.core.activePlayback.pause();
311
+ setTimeout(() => {
312
+ this.core.activePlayback.destroy();
313
+ }, 0);
314
+ try {
315
+ this.core.mediaControl.disabledControlButton();
316
+ } catch (error) {
317
+ reportError(error);
318
+ }
319
+ // TODO figure out
320
+ this.core.getPlugin('error_gplayer')?.show({
321
+ title: this.core.i18n.t('source_offline'),
322
+ message: '',
323
+ code: '',
324
+ icon: '',
325
+ reloadIcon: '',
326
+ });
327
+ }
328
+
329
+ private hideError() {
330
+ try {
331
+ this.core.mediaControl.enableControlButton();
332
+ } catch (error) {
333
+ reportError(error);
334
+ }
335
+ }
336
+
337
+ private changeById(id: number) {
338
+ trace(`${T} changeById`, { id });
339
+ queueMicrotask(() => {
340
+ const playbackOptions = this.core.options.playback || {};
341
+
342
+ // TODO figure out what this does
343
+ playbackOptions.recycleVideo = Browser.isMobile;
344
+ this.currentCamera = this.findElementById(id) ?? null;
345
+ trace(`${T} changeById`, { id, currentCamera: this.currentCamera, multicamera: this.multicamera });
346
+
347
+ if (!this.currentCamera) {
348
+ return;
349
+ }
350
+ this.currentTime = 0;
351
+ try {
352
+ this.currentTime = this.core.activePlayback.getCurrentTime();
353
+ this.highlightCurrentLevel();
354
+ this.core.activePlayback.destroy();
355
+ } catch (error) {
356
+ reportError(error);
357
+ }
358
+ const fullscreenDisable = !!(Browser.isiOS && this.currentCamera.projection);
359
+
360
+ // TODO remove?
361
+ // for html5 playback:
362
+ this.options.dvrEnabled = this.currentCamera.dvr;
363
+
364
+ trace(`${T} changeById`, { currentCamera: this.currentCamera });
365
+ // TODO
366
+ this.core.configure({
367
+ playback: playbackOptions,
368
+ source: this.currentCamera.source, // TODO ensure that the preferred transport is used
369
+ video360: { // TODO
370
+ projection: this.currentCamera.projection,
371
+ },
372
+ fullscreenDisable,
373
+ autoPlay: this.playing,
374
+ disableCanAutoPlay: true
375
+ });
376
+ this.core.activeContainer.mediaControlDisabled = false;
377
+ });
378
+ this.toggleContextMenu();
379
+ }
380
+
381
+ getCamerasList() {
382
+ return this.multicamera;
383
+ }
384
+
385
+ getCurrentCamera() {
386
+ return this.currentCamera;
387
+ }
388
+
389
+ private findElementById(id: number): MediaSourceInfo | undefined {
390
+ return this.multicamera.find((element) => element.id === id);
391
+ }
392
+
393
+ private findIndexById(id: number): number {
394
+ return this.multicamera.findIndex((element) => element.id === id);
395
+ }
396
+
397
+ private onShowLevelSelectMenu() {
398
+ this.toggleContextMenu();
399
+ }
400
+
401
+ private hideSelectLevelMenu() {
402
+ (this.$('.multicamera ul') as ZeptoResult).hide();
403
+ }
404
+
405
+ private toggleContextMenu() {
406
+ (this.$('.multicamera ul') as ZeptoResult).toggle();
407
+ }
408
+
409
+ // private buttonElement(): ZeptoResult {
410
+ // return this.$('.multicamera button');
411
+ // }
412
+
413
+ // private buttonElementText(): ZeptoResult {
414
+ // return this.$('.multicamera button .quality-text');
415
+ // }
416
+
417
+ private levelElement(id?: number): ZeptoResult {
418
+ return this.$('.multicamera ul li > div' + (id !== undefined ? '[data-multicamera-selector-select="' + id + '"]' : ''));
419
+ }
420
+
421
+ private highlightCurrentLevel() {
422
+ this.levelElement().removeClass('current');
423
+ this.levelElement().removeClass('multicamera-active');
424
+ this.currentCamera && this.levelElement(this.currentCamera.id).addClass('multicamera-active');
425
+ }
426
+ }
@@ -0,0 +1,87 @@
1
+ import { UICorePlugin, template, Events } from '@clappr/core';
2
+ import { trace } from '@gcorevideo/utils';
3
+
4
+ import { CLAPPR_VERSION } from '../build.js';
5
+
6
+ import pipIcon from '../../../assets/icons/new/pip.svg';
7
+ import buttonHtml from '../../../assets/picture-in-picture/button.ejs';
8
+ import '../../../assets/picture-in-picture/button.scss';
9
+
10
+ const VERSION = '0.0.1';
11
+
12
+ const T = `plugins.picture_in_picture`;
13
+
14
+ export class PictureInPicture extends UICorePlugin {
15
+ get name() {
16
+ return 'picture_in_picture';
17
+ }
18
+
19
+ get supportedVersion() {
20
+ return { min: CLAPPR_VERSION };
21
+ }
22
+
23
+ static get version() {
24
+ return VERSION;
25
+ }
26
+
27
+ override get events() {
28
+ return {
29
+ 'click button': 'togglePictureInPicture',
30
+ };
31
+ }
32
+
33
+ get videoElement() {
34
+ return this.core.activePlayback.el;
35
+ }
36
+
37
+ override bindEvents() {
38
+ this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render);
39
+ }
40
+
41
+ private isPiPSupported() {
42
+ trace(`${T} isPiPSupported`, {
43
+ pictureInPictureEnabled: document.pictureInPictureEnabled,
44
+ requestPictureInPicture: HTMLVideoElement.prototype.requestPictureInPicture,
45
+ });
46
+
47
+ return document.pictureInPictureEnabled && !!HTMLVideoElement.prototype.requestPictureInPicture;
48
+ }
49
+
50
+ override render() {
51
+ if (!this.isPiPSupported()) {
52
+ return this;
53
+ }
54
+
55
+ const t = template(buttonHtml);
56
+
57
+ this.$el.html(t({ pipIcon }));
58
+
59
+ const mediaControl = this.core.getPlugin('media_control');
60
+ if (mediaControl) {
61
+ mediaControl.getElement('pip')?.html(this.el);
62
+ }
63
+
64
+ return this;
65
+ }
66
+
67
+ togglePictureInPicture() {
68
+ trace(`${T} togglePictureInPicture`);
69
+ if (this.videoElement !== document.pictureInPictureElement) {
70
+ this.requestPictureInPicture();
71
+ } else {
72
+ this.exitPictureInPicture();
73
+ }
74
+ }
75
+
76
+ requestPictureInPicture() {
77
+ trace(`${T} requestPictureInPicture`, {
78
+ videoElement: !!this.videoElement,
79
+ });
80
+ this.videoElement.requestPictureInPicture();
81
+ }
82
+
83
+ exitPictureInPicture() {
84
+ trace(`${T} exitPictureInPicture`);
85
+ document.exitPictureInPicture();
86
+ }
87
+ }