@nomercy-entertainment/nomercy-video-player 2.6.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/adapters/video-backend/IVideoBackend.d.ts +24 -2
  3. package/dist/adapters/video-backend/hls-caption-drain.d.ts +6 -0
  4. package/dist/adapters/video-backend/hls-caption-drain.js +40 -0
  5. package/dist/adapters/video-backend/html5.d.ts +14 -1
  6. package/dist/adapters/video-backend/html5.js +109 -23
  7. package/dist/adapters/video-backend/source-outage.d.ts +8 -0
  8. package/dist/adapters/video-backend/source-outage.js +20 -1
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.js +11 -0
  11. package/dist/nomercy-video-player.iife.js +3 -1
  12. package/dist/plugins/desktop-ui/data/buttons.d.ts +1 -1
  13. package/dist/plugins/desktop-ui/data/buttons.js +3 -3
  14. package/dist/plugins/desktop-ui/i18n/af.d.ts +1 -0
  15. package/dist/plugins/desktop-ui/i18n/af.js +1 -0
  16. package/dist/plugins/desktop-ui/i18n/ar.d.ts +1 -0
  17. package/dist/plugins/desktop-ui/i18n/ar.js +1 -0
  18. package/dist/plugins/desktop-ui/i18n/bg.d.ts +1 -0
  19. package/dist/plugins/desktop-ui/i18n/bg.js +1 -0
  20. package/dist/plugins/desktop-ui/i18n/bn.d.ts +1 -0
  21. package/dist/plugins/desktop-ui/i18n/bn.js +1 -0
  22. package/dist/plugins/desktop-ui/i18n/ca.d.ts +1 -0
  23. package/dist/plugins/desktop-ui/i18n/ca.js +1 -0
  24. package/dist/plugins/desktop-ui/i18n/cs.d.ts +1 -0
  25. package/dist/plugins/desktop-ui/i18n/cs.js +1 -0
  26. package/dist/plugins/desktop-ui/i18n/cy.d.ts +1 -0
  27. package/dist/plugins/desktop-ui/i18n/cy.js +1 -0
  28. package/dist/plugins/desktop-ui/i18n/da.d.ts +1 -0
  29. package/dist/plugins/desktop-ui/i18n/da.js +1 -0
  30. package/dist/plugins/desktop-ui/i18n/de.d.ts +1 -0
  31. package/dist/plugins/desktop-ui/i18n/de.js +1 -0
  32. package/dist/plugins/desktop-ui/i18n/el.d.ts +1 -0
  33. package/dist/plugins/desktop-ui/i18n/el.js +1 -0
  34. package/dist/plugins/desktop-ui/i18n/en.d.ts +1 -0
  35. package/dist/plugins/desktop-ui/i18n/en.js +1 -0
  36. package/dist/plugins/desktop-ui/i18n/es.d.ts +1 -0
  37. package/dist/plugins/desktop-ui/i18n/es.js +1 -0
  38. package/dist/plugins/desktop-ui/i18n/et.d.ts +1 -0
  39. package/dist/plugins/desktop-ui/i18n/et.js +1 -0
  40. package/dist/plugins/desktop-ui/i18n/eu.d.ts +1 -0
  41. package/dist/plugins/desktop-ui/i18n/eu.js +1 -0
  42. package/dist/plugins/desktop-ui/i18n/fa.d.ts +1 -0
  43. package/dist/plugins/desktop-ui/i18n/fa.js +1 -0
  44. package/dist/plugins/desktop-ui/i18n/fi.d.ts +1 -0
  45. package/dist/plugins/desktop-ui/i18n/fi.js +1 -0
  46. package/dist/plugins/desktop-ui/i18n/fr.d.ts +1 -0
  47. package/dist/plugins/desktop-ui/i18n/fr.js +1 -0
  48. package/dist/plugins/desktop-ui/i18n/ga.d.ts +1 -0
  49. package/dist/plugins/desktop-ui/i18n/ga.js +1 -0
  50. package/dist/plugins/desktop-ui/i18n/gl.d.ts +1 -0
  51. package/dist/plugins/desktop-ui/i18n/gl.js +1 -0
  52. package/dist/plugins/desktop-ui/i18n/gu.d.ts +1 -0
  53. package/dist/plugins/desktop-ui/i18n/gu.js +1 -0
  54. package/dist/plugins/desktop-ui/i18n/he.d.ts +1 -0
  55. package/dist/plugins/desktop-ui/i18n/he.js +1 -0
  56. package/dist/plugins/desktop-ui/i18n/hi.d.ts +1 -0
  57. package/dist/plugins/desktop-ui/i18n/hi.js +1 -0
  58. package/dist/plugins/desktop-ui/i18n/hr.d.ts +1 -0
  59. package/dist/plugins/desktop-ui/i18n/hr.js +1 -0
  60. package/dist/plugins/desktop-ui/i18n/hu.d.ts +1 -0
  61. package/dist/plugins/desktop-ui/i18n/hu.js +1 -0
  62. package/dist/plugins/desktop-ui/i18n/hy.d.ts +1 -0
  63. package/dist/plugins/desktop-ui/i18n/hy.js +1 -0
  64. package/dist/plugins/desktop-ui/i18n/id.d.ts +1 -0
  65. package/dist/plugins/desktop-ui/i18n/id.js +1 -0
  66. package/dist/plugins/desktop-ui/i18n/is.d.ts +1 -0
  67. package/dist/plugins/desktop-ui/i18n/is.js +1 -0
  68. package/dist/plugins/desktop-ui/i18n/it.d.ts +1 -0
  69. package/dist/plugins/desktop-ui/i18n/it.js +1 -0
  70. package/dist/plugins/desktop-ui/i18n/ja.d.ts +1 -0
  71. package/dist/plugins/desktop-ui/i18n/ja.js +1 -0
  72. package/dist/plugins/desktop-ui/i18n/ka.d.ts +1 -0
  73. package/dist/plugins/desktop-ui/i18n/ka.js +1 -0
  74. package/dist/plugins/desktop-ui/i18n/kk.d.ts +1 -0
  75. package/dist/plugins/desktop-ui/i18n/kk.js +1 -0
  76. package/dist/plugins/desktop-ui/i18n/km.d.ts +1 -0
  77. package/dist/plugins/desktop-ui/i18n/km.js +1 -0
  78. package/dist/plugins/desktop-ui/i18n/kn.d.ts +1 -0
  79. package/dist/plugins/desktop-ui/i18n/kn.js +1 -0
  80. package/dist/plugins/desktop-ui/i18n/ko.d.ts +1 -0
  81. package/dist/plugins/desktop-ui/i18n/ko.js +1 -0
  82. package/dist/plugins/desktop-ui/i18n/ku.d.ts +1 -0
  83. package/dist/plugins/desktop-ui/i18n/ku.js +1 -0
  84. package/dist/plugins/desktop-ui/i18n/ky.d.ts +1 -0
  85. package/dist/plugins/desktop-ui/i18n/ky.js +1 -0
  86. package/dist/plugins/desktop-ui/i18n/lo.d.ts +1 -0
  87. package/dist/plugins/desktop-ui/i18n/lo.js +1 -0
  88. package/dist/plugins/desktop-ui/i18n/lt.d.ts +1 -0
  89. package/dist/plugins/desktop-ui/i18n/lt.js +1 -0
  90. package/dist/plugins/desktop-ui/i18n/lv.d.ts +1 -0
  91. package/dist/plugins/desktop-ui/i18n/lv.js +1 -0
  92. package/dist/plugins/desktop-ui/i18n/mk.d.ts +1 -0
  93. package/dist/plugins/desktop-ui/i18n/mk.js +1 -0
  94. package/dist/plugins/desktop-ui/i18n/ml.d.ts +1 -0
  95. package/dist/plugins/desktop-ui/i18n/ml.js +1 -0
  96. package/dist/plugins/desktop-ui/i18n/mn.d.ts +1 -0
  97. package/dist/plugins/desktop-ui/i18n/mn.js +1 -0
  98. package/dist/plugins/desktop-ui/i18n/mr.d.ts +1 -0
  99. package/dist/plugins/desktop-ui/i18n/mr.js +1 -0
  100. package/dist/plugins/desktop-ui/i18n/ms.d.ts +1 -0
  101. package/dist/plugins/desktop-ui/i18n/ms.js +1 -0
  102. package/dist/plugins/desktop-ui/i18n/my.d.ts +1 -0
  103. package/dist/plugins/desktop-ui/i18n/my.js +1 -0
  104. package/dist/plugins/desktop-ui/i18n/nb.d.ts +1 -0
  105. package/dist/plugins/desktop-ui/i18n/nb.js +1 -0
  106. package/dist/plugins/desktop-ui/i18n/ne.d.ts +1 -0
  107. package/dist/plugins/desktop-ui/i18n/ne.js +1 -0
  108. package/dist/plugins/desktop-ui/i18n/nl.d.ts +1 -0
  109. package/dist/plugins/desktop-ui/i18n/nl.js +1 -0
  110. package/dist/plugins/desktop-ui/i18n/nn.d.ts +1 -0
  111. package/dist/plugins/desktop-ui/i18n/nn.js +1 -0
  112. package/dist/plugins/desktop-ui/i18n/no.d.ts +1 -0
  113. package/dist/plugins/desktop-ui/i18n/no.js +1 -0
  114. package/dist/plugins/desktop-ui/i18n/oc.d.ts +1 -0
  115. package/dist/plugins/desktop-ui/i18n/oc.js +1 -0
  116. package/dist/plugins/desktop-ui/i18n/pa.d.ts +1 -0
  117. package/dist/plugins/desktop-ui/i18n/pa.js +1 -0
  118. package/dist/plugins/desktop-ui/i18n/pl.d.ts +1 -0
  119. package/dist/plugins/desktop-ui/i18n/pl.js +1 -0
  120. package/dist/plugins/desktop-ui/i18n/pt-BR.d.ts +1 -0
  121. package/dist/plugins/desktop-ui/i18n/pt-BR.js +1 -0
  122. package/dist/plugins/desktop-ui/i18n/pt.d.ts +1 -0
  123. package/dist/plugins/desktop-ui/i18n/pt.js +1 -0
  124. package/dist/plugins/desktop-ui/i18n/ro.d.ts +1 -0
  125. package/dist/plugins/desktop-ui/i18n/ro.js +1 -0
  126. package/dist/plugins/desktop-ui/i18n/ru.d.ts +1 -0
  127. package/dist/plugins/desktop-ui/i18n/ru.js +1 -0
  128. package/dist/plugins/desktop-ui/i18n/si.d.ts +1 -0
  129. package/dist/plugins/desktop-ui/i18n/si.js +1 -0
  130. package/dist/plugins/desktop-ui/i18n/sk.d.ts +1 -0
  131. package/dist/plugins/desktop-ui/i18n/sk.js +1 -0
  132. package/dist/plugins/desktop-ui/i18n/sl.d.ts +1 -0
  133. package/dist/plugins/desktop-ui/i18n/sl.js +1 -0
  134. package/dist/plugins/desktop-ui/i18n/sq.d.ts +1 -0
  135. package/dist/plugins/desktop-ui/i18n/sq.js +1 -0
  136. package/dist/plugins/desktop-ui/i18n/sr.d.ts +1 -0
  137. package/dist/plugins/desktop-ui/i18n/sr.js +1 -0
  138. package/dist/plugins/desktop-ui/i18n/sv.d.ts +1 -0
  139. package/dist/plugins/desktop-ui/i18n/sv.js +1 -0
  140. package/dist/plugins/desktop-ui/i18n/sw.d.ts +1 -0
  141. package/dist/plugins/desktop-ui/i18n/sw.js +1 -0
  142. package/dist/plugins/desktop-ui/i18n/ta.d.ts +1 -0
  143. package/dist/plugins/desktop-ui/i18n/ta.js +1 -0
  144. package/dist/plugins/desktop-ui/i18n/te.d.ts +1 -0
  145. package/dist/plugins/desktop-ui/i18n/te.js +1 -0
  146. package/dist/plugins/desktop-ui/i18n/tg.d.ts +1 -0
  147. package/dist/plugins/desktop-ui/i18n/tg.js +1 -0
  148. package/dist/plugins/desktop-ui/i18n/th.d.ts +1 -0
  149. package/dist/plugins/desktop-ui/i18n/th.js +1 -0
  150. package/dist/plugins/desktop-ui/i18n/tl.d.ts +1 -0
  151. package/dist/plugins/desktop-ui/i18n/tl.js +1 -0
  152. package/dist/plugins/desktop-ui/i18n/tr.d.ts +1 -0
  153. package/dist/plugins/desktop-ui/i18n/tr.js +1 -0
  154. package/dist/plugins/desktop-ui/i18n/uk.d.ts +1 -0
  155. package/dist/plugins/desktop-ui/i18n/uk.js +1 -0
  156. package/dist/plugins/desktop-ui/i18n/ur.d.ts +1 -0
  157. package/dist/plugins/desktop-ui/i18n/ur.js +1 -0
  158. package/dist/plugins/desktop-ui/i18n/uz.d.ts +1 -0
  159. package/dist/plugins/desktop-ui/i18n/uz.js +1 -0
  160. package/dist/plugins/desktop-ui/i18n/vi.d.ts +1 -0
  161. package/dist/plugins/desktop-ui/i18n/vi.js +1 -0
  162. package/dist/plugins/desktop-ui/i18n/xh.d.ts +1 -0
  163. package/dist/plugins/desktop-ui/i18n/xh.js +1 -0
  164. package/dist/plugins/desktop-ui/i18n/yo.d.ts +1 -0
  165. package/dist/plugins/desktop-ui/i18n/yo.js +1 -0
  166. package/dist/plugins/desktop-ui/i18n/zh-TW.d.ts +1 -0
  167. package/dist/plugins/desktop-ui/i18n/zh-TW.js +1 -0
  168. package/dist/plugins/desktop-ui/i18n/zh.d.ts +1 -0
  169. package/dist/plugins/desktop-ui/i18n/zh.js +1 -0
  170. package/dist/plugins/desktop-ui/i18n/zu.d.ts +1 -0
  171. package/dist/plugins/desktop-ui/i18n/zu.js +1 -0
  172. package/dist/plugins/desktop-ui/index.d.ts +6 -0
  173. package/dist/plugins/desktop-ui/index.js +1 -1
  174. package/dist/plugins/desktop-ui/internals.d.ts +6 -0
  175. package/dist/plugins/desktop-ui/mixins/domMethods.js +10 -0
  176. package/dist/plugins/desktop-ui/mixins/spriteMethods.js +3 -1
  177. package/dist/plugins/desktop-ui/mixins/transportStateMethods.d.ts +7 -0
  178. package/dist/plugins/desktop-ui/mixins/transportStateMethods.js +26 -3
  179. package/dist/plugins/desktop-ui/styles.css +12 -0
  180. package/dist/plugins/index.d.ts +2 -0
  181. package/dist/plugins/index.js +1 -0
  182. package/dist/plugins/twitch/TwitchEmbedBackend.d.ts +149 -0
  183. package/dist/plugins/twitch/TwitchEmbedBackend.js +319 -0
  184. package/dist/plugins/twitch/TwitchPlugin.d.ts +66 -0
  185. package/dist/plugins/twitch/TwitchPlugin.js +250 -0
  186. package/dist/plugins/twitch/clip.d.ts +13 -0
  187. package/dist/plugins/twitch/clip.js +87 -0
  188. package/dist/plugins/twitch/gql.d.ts +5 -0
  189. package/dist/plugins/twitch/gql.js +23 -0
  190. package/dist/plugins/twitch/i18n/af.d.ts +8 -0
  191. package/dist/plugins/twitch/i18n/af.js +15 -0
  192. package/dist/plugins/twitch/i18n/ar.d.ts +8 -0
  193. package/dist/plugins/twitch/i18n/ar.js +15 -0
  194. package/dist/plugins/twitch/i18n/bg.d.ts +8 -0
  195. package/dist/plugins/twitch/i18n/bg.js +15 -0
  196. package/dist/plugins/twitch/i18n/bn.d.ts +8 -0
  197. package/dist/plugins/twitch/i18n/bn.js +15 -0
  198. package/dist/plugins/twitch/i18n/ca.d.ts +8 -0
  199. package/dist/plugins/twitch/i18n/ca.js +15 -0
  200. package/dist/plugins/twitch/i18n/cs.d.ts +8 -0
  201. package/dist/plugins/twitch/i18n/cs.js +15 -0
  202. package/dist/plugins/twitch/i18n/cy.d.ts +8 -0
  203. package/dist/plugins/twitch/i18n/cy.js +15 -0
  204. package/dist/plugins/twitch/i18n/da.d.ts +8 -0
  205. package/dist/plugins/twitch/i18n/da.js +15 -0
  206. package/dist/plugins/twitch/i18n/de.d.ts +8 -0
  207. package/dist/plugins/twitch/i18n/de.js +15 -0
  208. package/dist/plugins/twitch/i18n/el.d.ts +8 -0
  209. package/dist/plugins/twitch/i18n/el.js +15 -0
  210. package/dist/plugins/twitch/i18n/en.d.ts +10 -0
  211. package/dist/plugins/twitch/i18n/en.js +15 -0
  212. package/dist/plugins/twitch/i18n/es.d.ts +8 -0
  213. package/dist/plugins/twitch/i18n/es.js +15 -0
  214. package/dist/plugins/twitch/i18n/et.d.ts +8 -0
  215. package/dist/plugins/twitch/i18n/et.js +15 -0
  216. package/dist/plugins/twitch/i18n/eu.d.ts +8 -0
  217. package/dist/plugins/twitch/i18n/eu.js +15 -0
  218. package/dist/plugins/twitch/i18n/fa.d.ts +8 -0
  219. package/dist/plugins/twitch/i18n/fa.js +15 -0
  220. package/dist/plugins/twitch/i18n/fi.d.ts +8 -0
  221. package/dist/plugins/twitch/i18n/fi.js +15 -0
  222. package/dist/plugins/twitch/i18n/fr.d.ts +8 -0
  223. package/dist/plugins/twitch/i18n/fr.js +15 -0
  224. package/dist/plugins/twitch/i18n/ga.d.ts +8 -0
  225. package/dist/plugins/twitch/i18n/ga.js +15 -0
  226. package/dist/plugins/twitch/i18n/gl.d.ts +8 -0
  227. package/dist/plugins/twitch/i18n/gl.js +15 -0
  228. package/dist/plugins/twitch/i18n/gu.d.ts +8 -0
  229. package/dist/plugins/twitch/i18n/gu.js +15 -0
  230. package/dist/plugins/twitch/i18n/he.d.ts +8 -0
  231. package/dist/plugins/twitch/i18n/he.js +15 -0
  232. package/dist/plugins/twitch/i18n/hi.d.ts +8 -0
  233. package/dist/plugins/twitch/i18n/hi.js +15 -0
  234. package/dist/plugins/twitch/i18n/hr.d.ts +8 -0
  235. package/dist/plugins/twitch/i18n/hr.js +15 -0
  236. package/dist/plugins/twitch/i18n/hu.d.ts +8 -0
  237. package/dist/plugins/twitch/i18n/hu.js +15 -0
  238. package/dist/plugins/twitch/i18n/hy.d.ts +8 -0
  239. package/dist/plugins/twitch/i18n/hy.js +15 -0
  240. package/dist/plugins/twitch/i18n/id.d.ts +8 -0
  241. package/dist/plugins/twitch/i18n/id.js +15 -0
  242. package/dist/plugins/twitch/i18n/is.d.ts +8 -0
  243. package/dist/plugins/twitch/i18n/is.js +15 -0
  244. package/dist/plugins/twitch/i18n/it.d.ts +8 -0
  245. package/dist/plugins/twitch/i18n/it.js +15 -0
  246. package/dist/plugins/twitch/i18n/ja.d.ts +8 -0
  247. package/dist/plugins/twitch/i18n/ja.js +15 -0
  248. package/dist/plugins/twitch/i18n/ka.d.ts +8 -0
  249. package/dist/plugins/twitch/i18n/ka.js +15 -0
  250. package/dist/plugins/twitch/i18n/kk.d.ts +8 -0
  251. package/dist/plugins/twitch/i18n/kk.js +15 -0
  252. package/dist/plugins/twitch/i18n/km.d.ts +8 -0
  253. package/dist/plugins/twitch/i18n/km.js +15 -0
  254. package/dist/plugins/twitch/i18n/kn.d.ts +8 -0
  255. package/dist/plugins/twitch/i18n/kn.js +15 -0
  256. package/dist/plugins/twitch/i18n/ko.d.ts +8 -0
  257. package/dist/plugins/twitch/i18n/ko.js +15 -0
  258. package/dist/plugins/twitch/i18n/ku.d.ts +8 -0
  259. package/dist/plugins/twitch/i18n/ku.js +15 -0
  260. package/dist/plugins/twitch/i18n/ky.d.ts +8 -0
  261. package/dist/plugins/twitch/i18n/ky.js +15 -0
  262. package/dist/plugins/twitch/i18n/lo.d.ts +8 -0
  263. package/dist/plugins/twitch/i18n/lo.js +15 -0
  264. package/dist/plugins/twitch/i18n/lt.d.ts +8 -0
  265. package/dist/plugins/twitch/i18n/lt.js +15 -0
  266. package/dist/plugins/twitch/i18n/lv.d.ts +8 -0
  267. package/dist/plugins/twitch/i18n/lv.js +15 -0
  268. package/dist/plugins/twitch/i18n/mk.d.ts +8 -0
  269. package/dist/plugins/twitch/i18n/mk.js +15 -0
  270. package/dist/plugins/twitch/i18n/ml.d.ts +8 -0
  271. package/dist/plugins/twitch/i18n/ml.js +15 -0
  272. package/dist/plugins/twitch/i18n/mn.d.ts +8 -0
  273. package/dist/plugins/twitch/i18n/mn.js +15 -0
  274. package/dist/plugins/twitch/i18n/mr.d.ts +8 -0
  275. package/dist/plugins/twitch/i18n/mr.js +15 -0
  276. package/dist/plugins/twitch/i18n/ms.d.ts +8 -0
  277. package/dist/plugins/twitch/i18n/ms.js +15 -0
  278. package/dist/plugins/twitch/i18n/my.d.ts +8 -0
  279. package/dist/plugins/twitch/i18n/my.js +15 -0
  280. package/dist/plugins/twitch/i18n/nb.d.ts +8 -0
  281. package/dist/plugins/twitch/i18n/nb.js +15 -0
  282. package/dist/plugins/twitch/i18n/ne.d.ts +8 -0
  283. package/dist/plugins/twitch/i18n/ne.js +15 -0
  284. package/dist/plugins/twitch/i18n/nl.d.ts +8 -0
  285. package/dist/plugins/twitch/i18n/nl.js +15 -0
  286. package/dist/plugins/twitch/i18n/nn.d.ts +8 -0
  287. package/dist/plugins/twitch/i18n/nn.js +15 -0
  288. package/dist/plugins/twitch/i18n/no.d.ts +8 -0
  289. package/dist/plugins/twitch/i18n/no.js +15 -0
  290. package/dist/plugins/twitch/i18n/oc.d.ts +8 -0
  291. package/dist/plugins/twitch/i18n/oc.js +15 -0
  292. package/dist/plugins/twitch/i18n/pa.d.ts +8 -0
  293. package/dist/plugins/twitch/i18n/pa.js +15 -0
  294. package/dist/plugins/twitch/i18n/pl.d.ts +8 -0
  295. package/dist/plugins/twitch/i18n/pl.js +15 -0
  296. package/dist/plugins/twitch/i18n/pt-BR.d.ts +8 -0
  297. package/dist/plugins/twitch/i18n/pt-BR.js +15 -0
  298. package/dist/plugins/twitch/i18n/pt.d.ts +8 -0
  299. package/dist/plugins/twitch/i18n/pt.js +15 -0
  300. package/dist/plugins/twitch/i18n/ro.d.ts +8 -0
  301. package/dist/plugins/twitch/i18n/ro.js +15 -0
  302. package/dist/plugins/twitch/i18n/ru.d.ts +8 -0
  303. package/dist/plugins/twitch/i18n/ru.js +15 -0
  304. package/dist/plugins/twitch/i18n/si.d.ts +8 -0
  305. package/dist/plugins/twitch/i18n/si.js +15 -0
  306. package/dist/plugins/twitch/i18n/sk.d.ts +8 -0
  307. package/dist/plugins/twitch/i18n/sk.js +15 -0
  308. package/dist/plugins/twitch/i18n/sl.d.ts +8 -0
  309. package/dist/plugins/twitch/i18n/sl.js +15 -0
  310. package/dist/plugins/twitch/i18n/sq.d.ts +8 -0
  311. package/dist/plugins/twitch/i18n/sq.js +15 -0
  312. package/dist/plugins/twitch/i18n/sr.d.ts +8 -0
  313. package/dist/plugins/twitch/i18n/sr.js +15 -0
  314. package/dist/plugins/twitch/i18n/sv.d.ts +8 -0
  315. package/dist/plugins/twitch/i18n/sv.js +15 -0
  316. package/dist/plugins/twitch/i18n/sw.d.ts +8 -0
  317. package/dist/plugins/twitch/i18n/sw.js +15 -0
  318. package/dist/plugins/twitch/i18n/ta.d.ts +8 -0
  319. package/dist/plugins/twitch/i18n/ta.js +15 -0
  320. package/dist/plugins/twitch/i18n/te.d.ts +8 -0
  321. package/dist/plugins/twitch/i18n/te.js +15 -0
  322. package/dist/plugins/twitch/i18n/tg.d.ts +8 -0
  323. package/dist/plugins/twitch/i18n/tg.js +15 -0
  324. package/dist/plugins/twitch/i18n/th.d.ts +8 -0
  325. package/dist/plugins/twitch/i18n/th.js +15 -0
  326. package/dist/plugins/twitch/i18n/tl.d.ts +8 -0
  327. package/dist/plugins/twitch/i18n/tl.js +15 -0
  328. package/dist/plugins/twitch/i18n/tr.d.ts +8 -0
  329. package/dist/plugins/twitch/i18n/tr.js +15 -0
  330. package/dist/plugins/twitch/i18n/uk.d.ts +8 -0
  331. package/dist/plugins/twitch/i18n/uk.js +15 -0
  332. package/dist/plugins/twitch/i18n/ur.d.ts +8 -0
  333. package/dist/plugins/twitch/i18n/ur.js +15 -0
  334. package/dist/plugins/twitch/i18n/uz.d.ts +8 -0
  335. package/dist/plugins/twitch/i18n/uz.js +15 -0
  336. package/dist/plugins/twitch/i18n/vi.d.ts +8 -0
  337. package/dist/plugins/twitch/i18n/vi.js +15 -0
  338. package/dist/plugins/twitch/i18n/xh.d.ts +8 -0
  339. package/dist/plugins/twitch/i18n/xh.js +15 -0
  340. package/dist/plugins/twitch/i18n/yo.d.ts +8 -0
  341. package/dist/plugins/twitch/i18n/yo.js +15 -0
  342. package/dist/plugins/twitch/i18n/zh-TW.d.ts +8 -0
  343. package/dist/plugins/twitch/i18n/zh-TW.js +15 -0
  344. package/dist/plugins/twitch/i18n/zh.d.ts +8 -0
  345. package/dist/plugins/twitch/i18n/zh.js +15 -0
  346. package/dist/plugins/twitch/i18n/zu.d.ts +8 -0
  347. package/dist/plugins/twitch/i18n/zu.js +15 -0
  348. package/dist/plugins/twitch/index.d.ts +2 -0
  349. package/dist/plugins/twitch/index.js +8 -0
  350. package/dist/plugins/twitch/metadata.d.ts +3 -0
  351. package/dist/plugins/twitch/metadata.js +20 -0
  352. package/dist/plugins/twitch/stream.d.ts +4 -0
  353. package/dist/plugins/twitch/stream.js +27 -0
  354. package/dist/plugins/twitch/url.d.ts +15 -0
  355. package/dist/plugins/twitch/url.js +69 -0
  356. package/dist/types.d.ts +9 -1
  357. package/package.json +6 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.8.0] — 2026-11-08
6
+
7
+ ### Added
8
+
9
+ - `./plugins/twitch`: `TwitchPlugin` plays a Twitch channel, VOD or clip. Options: `clientId` (clip look-up) and `proxyUrl` (a live playlist proxy you run; without it live uses Twitch's embed). Events: `clip:resolved`, `channel:offline`, `channel:ended`. The plugin ships its own translations.
10
+ - `liveSync` option (`targetLatency`, `maxCatchUpRate`, `forwardBuffer`) keeps live HLS near the live edge. `live()` and the `live` event report a live stream explicitly; desktop-ui shows LIVE.
11
+ - The video backend emits `subtitleTracks`, so caption tracks that arrive late reach the `subtitles` event.
12
+
13
+ ### Fixed
14
+
15
+ - The subtitles button shows the filled icon while a track is on, including when the track list changes after load.
16
+ - Closed-caption rows show as one bottom-center block.
17
+
18
+ ## [2.7.0] — 2026-11-01
19
+
20
+ ### Changed
21
+
22
+ - A failed load carries the HTTP status of the failed request, so `next()` can skip a missing item (404, 410), refresh once on 401 and raise `fatal` on 5xx.
23
+ - The fixed 10 s `waitForLoadedMetadata` limit is gone for every load; the media pipeline's own retry and error events decide.
24
+ - Needs `@nomercy-entertainment/nomercy-player-core` 2.6.0.
25
+
5
26
  ## [2.6.0] — 2026-11-01
6
27
 
7
28
  ### Added
@@ -26,6 +26,14 @@ export interface BackendEventPayload extends MinimalBackendEventPayload {
26
26
  kind: string;
27
27
  duration: number;
28
28
  };
29
+ /** The subtitle track list changed after load, for example hls.js added an embedded caption track on its first cue. */
30
+ 'subtitleTracks': {
31
+ tracks: SubtitleTrack[];
32
+ };
33
+ /** The source turned live or stopped being live. Emit it on every change, never twice in a row for the same value. */
34
+ 'live': {
35
+ live: boolean;
36
+ };
29
37
  'loadeddata': Event;
30
38
  'canplay': Event;
31
39
  'play': Event;
@@ -66,6 +74,7 @@ export interface BackendEventPayload extends MinimalBackendEventPayload {
66
74
  fatal: boolean;
67
75
  message?: string;
68
76
  rawCodec?: string;
77
+ status?: number;
69
78
  };
70
79
  /**
71
80
  * The backend is about to retry after a fatal HLS error. Consumers can
@@ -112,8 +121,17 @@ export declare const VIDEO_BACKEND_KIND: {
112
121
  readonly MSE: "mse";
113
122
  readonly WEBCODECS: "webcodecs";
114
123
  };
115
- /** Video backend kind. */
116
- export type VideoBackendKind = typeof VIDEO_BACKEND_KIND[keyof typeof VIDEO_BACKEND_KIND];
124
+ /** How a live stream stays near the live edge. Every field is optional; the backend's defaults apply to the rest. */
125
+ export interface LiveSyncOptions {
126
+ /** Seconds behind the live edge the player aims for. A VOD ignores it. */
127
+ targetLatency?: number;
128
+ /** Highest playback rate used to catch up to the target; 1 turns catch-up off. The pitch is kept. */
129
+ maxCatchUpRate?: number;
130
+ /** Seconds of media kept buffered ahead of the playhead on a live stream. */
131
+ forwardBuffer?: number;
132
+ }
133
+ /** Video backend kind: built-in names stay suggested; any other string names a `backendFactory` backend. */
134
+ export type VideoBackendKind = typeof VIDEO_BACKEND_KIND[keyof typeof VIDEO_BACKEND_KIND] | (string & {});
117
135
  /**
118
136
  * Contract every video backend implements. Parallels the audio backend
119
137
  * contract so cross-cutting orchestration plugins (transcoding, cast handoff,
@@ -157,6 +175,8 @@ export interface IVideoBackend {
157
175
  * here once, at backend construction; unset means the backend's own default.
158
176
  */
159
177
  setHdrOnSdrFallback?(fallback: HdrOnSdrFallback): void;
178
+ /** How a live stream stays near the live edge. `NMVideoPlayer` pushes `options.liveSync` here before the first load; backends with no live catch-up omit it. */
179
+ setLiveSync?(options: LiveSyncOptions): void;
160
180
  /** Fetch the manifests and first `segments` segments of `url` into memory for the next `load(url)`. Optional; a repeat call for the same URL is a no-op. */
161
181
  warm?(url: string, opts?: {
162
182
  segments?: number;
@@ -169,6 +189,8 @@ export interface IVideoBackend {
169
189
  currentTime(): number;
170
190
  currentTime(seconds: number): void;
171
191
  duration(): number;
192
+ /** `true` while the source is a live stream. A custom backend that plays live implements this and emits `live` when it changes. Omit for recorded-only backends. */
193
+ isLive?(): boolean;
172
194
  /**
173
195
  * The absolute timeline position, in seconds, that buffered data reaches.
174
196
  * Not a duration ahead of the playhead, and not a fraction: a scrubber
@@ -0,0 +1,6 @@
1
+ /**
2
+ * hls.js drains its cached CEA-608/708 cues onto their caption track only when a `video` buffer is
3
+ * appended (timeline-controller onBufferAppended, still so in 1.7.4). A muxed stream appends
4
+ * `audiovideo`, so the cache never drains and no caption shows. This does the same drain.
5
+ */
6
+ export declare function drainCaptionCache(hls: object): void;
@@ -0,0 +1,40 @@
1
+ // -----------------------------------------------------------------------------
2
+ // Copyright (c) NoMercy Entertainment
3
+ //
4
+ // Licensed under the Apache License, Version 2.0. See LICENSE for details.
5
+ //
6
+ // SPDX-License-Identifier: Apache-2.0
7
+ // -----------------------------------------------------------------------------
8
+ function isTimelineController(value) {
9
+ return typeof value === 'object' && value !== null && 'cueCache' in value && 'captionsTracks' in value;
10
+ }
11
+ /**
12
+ * hls.js drains its cached CEA-608/708 cues onto their caption track only when a `video` buffer is
13
+ * appended (timeline-controller onBufferAppended, still so in 1.7.4). A muxed stream appends
14
+ * `audiovideo`, so the cache never drains and no caption shows. This does the same drain.
15
+ */
16
+ export function drainCaptionCache(hls) {
17
+ const components = hls.coreComponents;
18
+ const timeline = components?.find(isTimelineController);
19
+ if (!timeline)
20
+ return;
21
+ for (const channel of Object.keys(timeline.cueCache)) {
22
+ const track = timeline.captionsTracks[channel]?.track;
23
+ if (track) {
24
+ const mode = track.mode;
25
+ if (mode === 'disabled')
26
+ track.mode = 'hidden';
27
+ for (const cue of timeline.cueCache[channel]) {
28
+ if (track.cues && !track.cues.getCueById(cue.id)) {
29
+ try {
30
+ track.addCue(cue);
31
+ }
32
+ catch { /* a cue the engine refuses is dropped, as hls.js drops it */ }
33
+ }
34
+ }
35
+ if (mode === 'disabled')
36
+ track.mode = mode;
37
+ }
38
+ delete timeline.cueCache[channel];
39
+ }
40
+ }
@@ -1,6 +1,6 @@
1
1
  import type { AudioTrack, HdrOnSdrFallback, QualityLevel, SubtitleTrack } from '@nomercy-entertainment/nomercy-player-core';
2
2
  import type { HtmlPreloadMode } from '../../types.js';
3
- import type { BackendEventPayload, BackendState, IVideoBackend, StreamResolver } from './IVideoBackend.js';
3
+ import type { BackendEventPayload, BackendState, IVideoBackend, LiveSyncOptions, StreamResolver } from './IVideoBackend.js';
4
4
  import { MediaElementBackend } from '@nomercy-entertainment/nomercy-player-core';
5
5
  /**
6
6
  * Default video backend. Wraps an `<HTMLVideoElement>` for transport.
@@ -137,6 +137,19 @@ export declare class Html5VideoBackend extends MediaElementBackend<HTMLVideoElem
137
137
  preload?: HtmlPreloadMode;
138
138
  startTime?: number;
139
139
  }): Promise<void>;
140
+ private _textTrackWatch;
141
+ /** Report a track the element gains or loses after load; the list is read once at load otherwise. */
142
+ private _watchTextTracks;
143
+ private _liveSync;
144
+ /** The speed the viewer chose; hls.js catch-up may move the element's own rate off it while live. */
145
+ private _viewerRate;
146
+ setLiveSync(options: LiveSyncOptions): void;
147
+ private _maxCatchUpRate;
148
+ playbackRate(): number;
149
+ playbackRate(rate: number): void;
150
+ private _live;
151
+ isLive(): boolean;
152
+ private _setLive;
140
153
  private readonly _warmCache;
141
154
  warm(url: string, opts?: {
142
155
  segments?: number;
@@ -5,11 +5,16 @@
5
5
  //
6
6
  // SPDX-License-Identifier: Apache-2.0
7
7
  // -----------------------------------------------------------------------------
8
- import { abrCeiling, appendAuthTokenParam, createAuthorizationXhrSetup, destroyHlsInstance, detectDisplayHdr, hdrDecision, isHls, MediaElementBackend, MediaFormatError, mediaFormatError, panePixels, resetMediaElement, sizeAbrCeiling, supportsNativeHls, } from '@nomercy-entertainment/nomercy-player-core';
8
+ import { abrCeiling, appendAuthTokenParam, createAuthorizationXhrSetup, destroyHlsInstance, detectDisplayHdr, hdrDecision, isHls, MediaElementBackend, MediaFormatError, mediaFormatError, panePixels, resetMediaElement, sizeAbrCeiling, StreamError, supportsNativeHls, } from '@nomercy-entertainment/nomercy-player-core';
9
+ import { drainCaptionCache } from './hls-caption-drain.js';
9
10
  import { createWarmLoader, HlsWarmCache } from './hls-warm-cache.js';
10
- import { isMediaAbsentStatus, MEDIA_ABSENT, SOURCE_OUTAGE_BACKOFF_MS, sourceOutageRetryLimit } from './source-outage.js';
11
+ import { definiteFailureCode, SOURCE_OUTAGE_BACKOFF_MS, sourceOutageRetryLimit } from './source-outage.js';
11
12
  /** Cap on bytes the next-item warmup may hold in memory. */
12
13
  const WARM_MAX_BYTES = 24 * 1024 * 1024;
14
+ const DEFAULT_LIVE_TARGET_LATENCY = 6;
15
+ const DEFAULT_MAX_CATCH_UP_RATE = 1.05;
16
+ const DEFAULT_LIVE_FORWARD_BUFFER = 12;
17
+ const VIDEO_CODEC_RE = /^(?:avc[1-4]|hvc1|hev1|dvh[1e]|vp0?[89]|av01|dav1)/i;
13
18
  const CODEC_LABELS = [
14
19
  [/avc1|h264/i, 'H.264'],
15
20
  [/hvc1|hev1|h265/i, 'H.265 (HEVC)'],
@@ -174,6 +179,7 @@ export class Html5VideoBackend extends MediaElementBackend {
174
179
  ownsElement = true;
175
180
  }
176
181
  super(element, ownsElement, 'html5');
182
+ this.element.preservesPitch = true;
177
183
  this.wireElementEvents();
178
184
  this._wireHdrMatchMedia();
179
185
  this._wirePaneResizeObserver();
@@ -250,12 +256,20 @@ export class Html5VideoBackend extends MediaElementBackend {
250
256
  // only HLS and whatever the element itself decodes. Nothing registered
251
257
  // means nothing returned, and the built-in path runs untouched.
252
258
  this._destroyCustomSource();
259
+ this._setLive(false);
260
+ this._watchTextTracks();
253
261
  const customSource = this._streamResolver?.(url);
254
262
  if (customSource) {
255
263
  this._customSource = customSource;
256
264
  await customSource.attach(this.element);
257
265
  this._state = 'ready';
258
266
  performance.mark('nm:backend:load:end');
267
+ // index.ts sets the player duration only from this event, so a custom source must emit it too.
268
+ const reportMetadata = () => this.emit('loadedmetadata', { url, kind: this.kind, duration: this.element.duration });
269
+ if (this.element.readyState >= 1 /* HAVE_METADATA */)
270
+ reportMetadata();
271
+ else
272
+ this.element.addEventListener('loadedmetadata', reportMetadata, { once: true });
259
273
  return;
260
274
  }
261
275
  if (hlsUrl && !nativeHls) {
@@ -276,7 +290,9 @@ export class Html5VideoBackend extends MediaElementBackend {
276
290
  ...(warmLoader ? { loader: warmLoader } : {}),
277
291
  autoStartLoad: true,
278
292
  enableWorker: true,
279
- lowLatencyMode: false,
293
+ lowLatencyMode: this._maxCatchUpRate() > 1,
294
+ liveSyncDuration: this._liveSync.targetLatency ?? DEFAULT_LIVE_TARGET_LATENCY,
295
+ maxLiveSyncPlaybackRate: this._viewerRate === 1 ? this._maxCatchUpRate() : 1,
280
296
  enableCEA708Captions: true,
281
297
  startPosition: typeof opts?.startTime === 'number' && opts.startTime > 0 ? opts.startTime : -1,
282
298
  startFragPrefetch: true,
@@ -293,6 +309,16 @@ export class Html5VideoBackend extends MediaElementBackend {
293
309
  hlsInstance.startLevel = warmedLevel;
294
310
  });
295
311
  // hls.js fills its audio list after the manifest parse, then fires this.
312
+ hlsInstance.on(Hls.Events.BUFFER_APPENDED, (_event, data) => {
313
+ if (data?.type === 'audiovideo')
314
+ drainCaptionCache(hlsInstance);
315
+ });
316
+ hlsInstance.on(Hls.Events.LEVEL_LOADED, (_event, data) => {
317
+ const live = Boolean(data?.details?.live);
318
+ this._setLive(live);
319
+ if (live)
320
+ hlsInstance.config.maxBufferLength = this._liveSync.forwardBuffer ?? DEFAULT_LIVE_FORWARD_BUFFER;
321
+ });
296
322
  hlsInstance.on(Hls.Events.AUDIO_TRACKS_UPDATED, () => {
297
323
  this._emitAudioTracks();
298
324
  });
@@ -325,6 +351,50 @@ export class Html5VideoBackend extends MediaElementBackend {
325
351
  this._state = 'ready';
326
352
  this.emit('loadedmetadata', { url, kind: this.kind, duration: this.element.duration });
327
353
  }
354
+ _textTrackWatch;
355
+ /** Report a track the element gains or loses after load; the list is read once at load otherwise. */
356
+ _watchTextTracks() {
357
+ if (this._textTrackWatch) {
358
+ this._textTrackWatch.list.removeEventListener('addtrack', this._textTrackWatch.handler);
359
+ this._textTrackWatch.list.removeEventListener('removetrack', this._textTrackWatch.handler);
360
+ this._textTrackWatch = undefined;
361
+ }
362
+ const list = this.element.textTracks;
363
+ if (typeof list?.addEventListener !== 'function')
364
+ return;
365
+ const handler = () => this.emit('subtitleTracks', { tracks: this.subtitleTracks() });
366
+ list.addEventListener('addtrack', handler);
367
+ list.addEventListener('removetrack', handler);
368
+ this._textTrackWatch = { list, handler };
369
+ }
370
+ _liveSync = {};
371
+ /** The speed the viewer chose; hls.js catch-up may move the element's own rate off it while live. */
372
+ _viewerRate = 1;
373
+ setLiveSync(options) {
374
+ this._liveSync = options;
375
+ }
376
+ _maxCatchUpRate() {
377
+ return this._liveSync.maxCatchUpRate ?? DEFAULT_MAX_CATCH_UP_RATE;
378
+ }
379
+ playbackRate(rate) {
380
+ if (rate === undefined)
381
+ return this._live ? this._viewerRate : super.playbackRate();
382
+ this._viewerRate = rate;
383
+ super.playbackRate(rate);
384
+ // hls.js resets the element's rate to 1 whenever it is not catching up, so it must stand down while the viewer picks a speed.
385
+ if (this.hls)
386
+ this.hls.config.maxLiveSyncPlaybackRate = rate === 1 ? this._maxCatchUpRate() : 1;
387
+ }
388
+ _live = false;
389
+ isLive() {
390
+ return this._live;
391
+ }
392
+ _setLive(live) {
393
+ if (live === this._live)
394
+ return;
395
+ this._live = live;
396
+ this.emit('live', { live });
397
+ }
328
398
  _warmCache = new HlsWarmCache();
329
399
  async warm(url, opts) {
330
400
  if (!isHls(url) || supportsNativeHls(this.element))
@@ -627,12 +697,14 @@ export class Html5VideoBackend extends MediaElementBackend {
627
697
  }
628
698
  emitActiveCues(tt) {
629
699
  const active = tt.activeCues;
630
- const cues = [];
700
+ const rows = [];
631
701
  if (active && active.length > 0) {
632
702
  for (let i = 0; i < active.length; i++) {
633
- cues.push(normaliseVttCue(active[i]));
703
+ rows.push(active[i]);
634
704
  }
635
705
  }
706
+ // CEA-608/708 gives one cue per screen row at its grid position; a viewer reads them as one block at the bottom.
707
+ const cues = tt.kind === 'captions' ? mergeCaptionRows(rows) : rows.map(normaliseVttCue);
636
708
  const change = { cues, language: tt.language || undefined };
637
709
  this.emit('subtitleCue', change);
638
710
  }
@@ -669,6 +741,12 @@ export class Html5VideoBackend extends MediaElementBackend {
669
741
  if (!codec || seen.has(codec) || this._capabilityCache.has(codec))
670
742
  continue;
671
743
  seen.add(codec);
744
+ // A video contentType may not list the audio codec of a muxed CODECS value, or decodingInfo reports it unsupported.
745
+ const videoCodec = codec.split(',').map(part => part.trim()).find(part => VIDEO_CODEC_RE.test(part));
746
+ if (!videoCodec) {
747
+ this._capabilityCache.set(codec, true);
748
+ continue;
749
+ }
672
750
  const height = level.height ?? 1080;
673
751
  const width = level.width ?? 1920;
674
752
  const bitrate = level.bitrate ?? 4_000_000;
@@ -677,7 +755,7 @@ export class Html5VideoBackend extends MediaElementBackend {
677
755
  const result = await navigator.mediaCapabilities.decodingInfo({
678
756
  type: 'media-source',
679
757
  video: {
680
- contentType: `video/mp4; codecs="${codec}"`,
758
+ contentType: `video/mp4; codecs="${videoCodec}"`,
681
759
  width,
682
760
  height,
683
761
  bitrate,
@@ -929,9 +1007,12 @@ export class Html5VideoBackend extends MediaElementBackend {
929
1007
  // that, and a consumer can act on it — offer the next item — but only if
930
1008
  // it is told which failure this was, so it gets its own code rather than
931
1009
  // the generic network one every outage ends with.
932
- if (isMediaAbsentStatus(httpStatus) && !this._sawConnectionFailure) {
1010
+ const definiteCode = this._sawConnectionFailure
1011
+ ? undefined
1012
+ : definiteFailureCode(httpStatus, this._state === 'loading');
1013
+ if (definiteCode) {
933
1014
  this._recoveringFromOutage = false;
934
- this._escalateHlsError(MEDIA_ABSENT, `media absent (HTTP ${httpStatus}): ${data.details}`);
1015
+ this._escalateHlsError(definiteCode, `HTTP ${httpStatus}: ${data.details}`, httpStatus);
935
1016
  return;
936
1017
  }
937
1018
  if (this._netRetryCount >= limit) {
@@ -997,10 +1078,10 @@ export class Html5VideoBackend extends MediaElementBackend {
997
1078
  * @param details - `HlsErrorData.details` string from hls.js
998
1079
  * @param message - Human-readable summary for the error payload
999
1080
  */
1000
- _escalateHlsError(details, message) {
1081
+ _escalateHlsError(details, message, status) {
1001
1082
  this._hadError = true;
1002
1083
  this._state = 'error';
1003
- this.emit('stream:error', { details, fatal: true });
1084
+ this.emit('stream:error', status === undefined ? { details, fatal: true } : { details, fatal: true, status });
1004
1085
  // Construct a synthetic error event so the `error` channel stays
1005
1086
  // typed as `Event` (BackendEventPayload contract). Consumers that
1006
1087
  // want the typed PlayerError should listen on `stream:error`.
@@ -1335,14 +1416,11 @@ export class Html5VideoBackend extends MediaElementBackend {
1335
1416
  waitForLoadedMetadata() {
1336
1417
  if (this.element.readyState >= 1 /* HAVE_METADATA */)
1337
1418
  return Promise.resolve();
1338
- const METADATA_TIMEOUT_MS = 10_000;
1339
1419
  return new Promise((resolve, reject) => {
1340
- let timer;
1341
1420
  let onLoad;
1342
1421
  let onElementError;
1343
1422
  let onStreamError;
1344
1423
  const cleanup = () => {
1345
- clearTimeout(timer);
1346
1424
  this.element.removeEventListener('loadedmetadata', onLoad);
1347
1425
  this.element.removeEventListener('error', onElementError);
1348
1426
  this.off('stream:error', onStreamError);
@@ -1361,18 +1439,15 @@ export class Html5VideoBackend extends MediaElementBackend {
1361
1439
  onStreamError = (data) => {
1362
1440
  if (data?.fatal) {
1363
1441
  cleanup();
1364
- reject(new Error(`HLS fatal: ${data.details}`));
1442
+ reject(new StreamError({
1443
+ code: data.details,
1444
+ severity: 'error',
1445
+ scope: { kind: 'stream', id: 'hls' },
1446
+ message: `HLS fatal: ${data.details}`,
1447
+ context: data.status === undefined ? undefined : { httpStatus: data.status },
1448
+ }));
1365
1449
  }
1366
1450
  };
1367
- // Hard backstop: if neither loadedmetadata nor a fatal error arrives
1368
- // within METADATA_TIMEOUT_MS, reject so load() never parks indefinitely.
1369
- // This catches the case where HLS.js retries exhaust slowly (the default
1370
- // three-retry back-off takes 7 s on manifest 404s) or where a non-fatal
1371
- // error loop never escalates to fatal at all.
1372
- timer = setTimeout(() => {
1373
- cleanup();
1374
- reject(new Error(`waitForLoadedMetadata timed out after ${METADATA_TIMEOUT_MS} ms`));
1375
- }, METADATA_TIMEOUT_MS);
1376
1451
  this.element.addEventListener('loadedmetadata', onLoad, { once: true });
1377
1452
  this.element.addEventListener('error', onElementError, { once: true });
1378
1453
  this.on('stream:error', onStreamError);
@@ -1397,6 +1472,17 @@ const ALL_TAG_RE = /<[^>]+>/g;
1397
1472
  * `'auto'` case (renderers fall back to safe-area positioning). `cue.size`
1398
1473
  * defaults to 100 per the WebVTT spec.
1399
1474
  */
1475
+ function mergeCaptionRows(rows) {
1476
+ if (rows.length === 0)
1477
+ return [];
1478
+ const ordered = rows
1479
+ .map(cue => ({ cue, line: typeof cue.line === 'number' ? cue.line : 0 }))
1480
+ .sort((upper, lower) => upper.line - lower.line)
1481
+ .map(({ cue }) => normaliseVttCue(cue));
1482
+ const text = ordered.map(cue => cue.text).join('\n');
1483
+ const plainText = ordered.map(cue => cue.plainText).join('\n');
1484
+ return [{ text, plainText, align: 'center', size: 100 }];
1485
+ }
1400
1486
  function normaliseVttCue(cue) {
1401
1487
  const raw = cue.text ?? '';
1402
1488
  const safe = raw.replace(TIMESTAMP_TAG_RE, '').replace(UNRECOGNISED_INLINE_TAG_RE, '');
@@ -57,6 +57,8 @@ export declare const NO_RETRIES = 0;
57
57
  * 410 is the same answer said more firmly.
58
58
  */
59
59
  export declare function isMediaAbsentStatus(httpStatus: number): boolean;
60
+ /** True for a 5xx from a server that is up (500, 501, 505...), as opposed to an origin-down status. */
61
+ export declare function isServerErrorStatus(httpStatus: number): boolean;
60
62
  /**
61
63
  * How many rungs this failure is allowed.
62
64
  *
@@ -80,3 +82,9 @@ export declare function sourceOutageRetryLimit(httpStatus: number, sawConnection
80
82
  * other.
81
83
  */
82
84
  export declare const MEDIA_ABSENT = "core:stream/media-absent";
85
+ /** The server answered 5xx while up; the player raises a fatal error. */
86
+ export declare const SERVER_ERROR = "core:stream/server-error";
87
+ /** The media request was refused with 401; the player refreshes the token once. */
88
+ export declare const UNAUTHENTICATED = "core:auth/unauthenticated";
89
+ /** The code for a failure no retry changes, else `undefined`. */
90
+ export declare function definiteFailureCode(httpStatus: number, loading: boolean): string | undefined;
@@ -77,6 +77,10 @@ export const NO_RETRIES = 0;
77
77
  export function isMediaAbsentStatus(httpStatus) {
78
78
  return httpStatus === 404 || httpStatus === 410;
79
79
  }
80
+ /** True for a 5xx from a server that is up (500, 501, 505...), as opposed to an origin-down status. */
81
+ export function isServerErrorStatus(httpStatus) {
82
+ return httpStatus >= 500 && httpStatus <= 599 && !isOriginDownStatus(httpStatus);
83
+ }
80
84
  /**
81
85
  * How many rungs this failure is allowed.
82
86
  *
@@ -99,7 +103,7 @@ export function sourceOutageRetryLimit(httpStatus, sawConnectionFailure) {
99
103
  return SOURCE_OUTAGE_BACKOFF_MS.length;
100
104
  if (isOriginDownStatus(httpStatus))
101
105
  return SOURCE_OUTAGE_BACKOFF_MS.length;
102
- if (isMediaAbsentStatus(httpStatus))
106
+ if (isMediaAbsentStatus(httpStatus) || isServerErrorStatus(httpStatus))
103
107
  return NO_RETRIES;
104
108
  if (httpStatus > 0)
105
109
  return HTTP_STATUS_RETRY_LIMIT;
@@ -112,3 +116,18 @@ export function sourceOutageRetryLimit(httpStatus, sawConnectionFailure) {
112
116
  * other.
113
117
  */
114
118
  export const MEDIA_ABSENT = 'core:stream/media-absent';
119
+ /** The server answered 5xx while up; the player raises a fatal error. */
120
+ export const SERVER_ERROR = 'core:stream/server-error';
121
+ /** The media request was refused with 401; the player refreshes the token once. */
122
+ export const UNAUTHENTICATED = 'core:auth/unauthenticated';
123
+ /** The code for a failure no retry changes, else `undefined`. */
124
+ export function definiteFailureCode(httpStatus, loading) {
125
+ if (isMediaAbsentStatus(httpStatus))
126
+ return MEDIA_ABSENT;
127
+ if (isServerErrorStatus(httpStatus))
128
+ return SERVER_ERROR;
129
+ // A 401 counts only while loading: mid-playback the ladder picks up a refreshed token.
130
+ if (httpStatus === 401 && loading)
131
+ return UNAUTHENTICATED;
132
+ return undefined;
133
+ }
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { StorageBackedSubtitleStyleStore } from './adapters/subtitle-style-store
11
11
  export type { IThumbnailSource, ThumbnailFrame } from './adapters/thumbnail-source/IThumbnailSource.js';
12
12
  export { VttSpriteThumbnailSource } from './adapters/thumbnail-source/vtt-sprite.js';
13
13
  export { Html5VideoBackend } from './adapters/video-backend/html5.js';
14
- export type { BackendEvent, BackendEventPayload, BackendLoaderState, BackendState, IVideoBackend, SubtitleCue, SubtitleCueChange, VideoBackendKind, } from './adapters/video-backend/IVideoBackend.js';
14
+ export type { BackendEvent, BackendEventPayload, BackendLoaderState, BackendState, IVideoBackend, LiveSyncOptions, SubtitleCue, SubtitleCueChange, VideoBackendKind, } from './adapters/video-backend/IVideoBackend.js';
15
15
  export { VideoPreloadStrategy } from './player/preload.js';
16
16
  export { KeyHandlerPlugin } from './plugins/key-handler/index.js';
17
17
  export { OctopusPlugin } from './plugins/octopus/index.js';
@@ -219,6 +219,7 @@ export declare class NMVideoPlayer<T extends VideoPlaylistItem = VideoPlaylistIt
219
219
  streams: () => ReadonlyArray<string>;
220
220
  getStreamFactory: (id: string) => IStreamFactory | undefined;
221
221
  private _backend;
222
+ live(): boolean;
222
223
  backend(): IVideoBackend;
223
224
  backend(kind: VideoBackendKind): Promise<void>;
224
225
  /**
package/dist/index.js CHANGED
@@ -308,6 +308,9 @@ export class NMVideoPlayer extends EventEmitter {
308
308
  }
309
309
  // ── Backend ──
310
310
  _backend;
311
+ live() {
312
+ return this._backend?.isLive?.() ?? false;
313
+ }
311
314
  backend(kind) {
312
315
  if (kind === undefined) {
313
316
  if (this._backend)
@@ -357,6 +360,7 @@ export class NMVideoPlayer extends EventEmitter {
357
360
  // into `options` — `hdrDecision`'s own default ('play') applies at the
358
361
  // point of use when this was never pushed at all.
359
362
  instance.setHdrOnSdrFallback?.(this.options?.hdrOnSdr ?? 'play');
363
+ instance.setLiveSync?.(this.options?.liveSync ?? {});
360
364
  // Mount the ResizeObserver that keeps videoRect() fresh. Done here so
361
365
  // the observer sees the real video element immediately after backend init.
362
366
  this._mountVideoRectObserver();
@@ -479,6 +483,13 @@ export class NMVideoPlayer extends EventEmitter {
479
483
  return;
480
484
  this.emit('duration', { duration: data.duration });
481
485
  });
486
+ instance.on('subtitleTracks', () => {
487
+ this.emit('subtitles', { tracks: this.subtitles() });
488
+ });
489
+ instance.on('live', (data) => {
490
+ if (data)
491
+ this.emit('live', data);
492
+ });
482
493
  // Bridge buffering / readiness signals so overlay plugins can
483
494
  // show/hide the spinner via typed player events.
484
495
  instance.on('waiting', () => { this.emit('waiting', undefined); });