rx-player 4.3.0-dev.2025031700 → 4.3.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 (232) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/VERSION +1 -1
  3. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  4. package/dist/commonjs/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  5. package/dist/commonjs/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  6. package/dist/commonjs/__GENERATED_CODE/embedded_worker.js +1 -1
  7. package/dist/commonjs/compat/add_class_name.d.ts.map +1 -1
  8. package/dist/commonjs/compat/add_class_name.js +1 -4
  9. package/dist/commonjs/compat/browser_compatibility_types.d.ts.map +1 -1
  10. package/dist/commonjs/compat/browser_compatibility_types.js +0 -1
  11. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  12. package/dist/commonjs/compat/eme/custom_media_keys/webkit_media_keys.js +0 -2
  13. package/dist/commonjs/compat/eme/eme-api-implementation.js +0 -1
  14. package/dist/commonjs/compat/eme/generate_key_request.d.ts +2 -2
  15. package/dist/commonjs/compat/eme/generate_key_request.js +2 -2
  16. package/dist/commonjs/compat/is_vtt_cue.d.ts.map +1 -1
  17. package/dist/commonjs/compat/is_vtt_cue.js +0 -1
  18. package/dist/commonjs/compat/patch_webkit_source_buffer.js +1 -1
  19. package/dist/commonjs/core/main/worker/content_preparer.d.ts.map +1 -1
  20. package/dist/commonjs/core/main/worker/content_preparer.js +82 -0
  21. package/dist/commonjs/core/segment_sinks/garbage_collector.d.ts.map +1 -1
  22. package/dist/commonjs/core/segment_sinks/garbage_collector.js +4 -0
  23. package/dist/commonjs/core/stream/representation/representation_stream.d.ts.map +1 -1
  24. package/dist/commonjs/core/stream/representation/representation_stream.js +29 -45
  25. package/dist/commonjs/core/stream/representation/utils/push_init_segment.d.ts.map +1 -1
  26. package/dist/commonjs/core/stream/representation/utils/push_init_segment.js +0 -3
  27. package/dist/commonjs/core/stream/representation/utils/push_media_segment.d.ts.map +1 -1
  28. package/dist/commonjs/core/stream/representation/utils/push_media_segment.js +0 -3
  29. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/api/index.js +1 -1
  30. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/capabilities.d.ts +2 -2
  31. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/capabilities.js +2 -2
  32. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  33. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +0 -1
  34. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  35. package/dist/commonjs/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +0 -1
  36. package/dist/commonjs/main_thread/api/public_api.d.ts.map +1 -1
  37. package/dist/commonjs/main_thread/api/public_api.js +2 -3
  38. package/dist/commonjs/main_thread/decrypt/session_events_listener.d.ts.map +1 -1
  39. package/dist/commonjs/main_thread/decrypt/session_events_listener.js +26 -18
  40. package/dist/commonjs/main_thread/decrypt/utils/loaded_sessions_store.d.ts +1 -1
  41. package/dist/commonjs/main_thread/decrypt/utils/loaded_sessions_store.js +1 -1
  42. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  43. package/dist/commonjs/main_thread/init/multi_thread_content_initializer.js +5 -3
  44. package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts +5 -4
  45. package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
  46. package/dist/commonjs/main_thread/init/utils/update_manifest_codec_support.js +10 -4
  47. package/dist/commonjs/manifest/classes/manifest.js +1 -1
  48. package/dist/commonjs/manifest/classes/representation.d.ts +2 -0
  49. package/dist/commonjs/manifest/classes/representation.d.ts.map +1 -1
  50. package/dist/commonjs/manifest/classes/representation.js +1 -0
  51. package/dist/commonjs/manifest/types.d.ts +2 -0
  52. package/dist/commonjs/manifest/types.d.ts.map +1 -1
  53. package/dist/commonjs/parsers/manifest/dash/common/convert_supplemental_codecs.d.ts +1 -1
  54. package/dist/commonjs/parsers/manifest/dash/common/convert_supplemental_codecs.js +1 -1
  55. package/dist/commonjs/parsers/manifest/dash/common/indexes/tokens.js +3 -3
  56. package/dist/commonjs/parsers/manifest/dash/common/parse_representations.js +1 -1
  57. package/dist/commonjs/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts.map +1 -1
  58. package/dist/commonjs/parsers/manifest/dash/native-parser/node_parsers/utils.d.ts.map +1 -1
  59. package/dist/commonjs/parsers/texttracks/ttml/parse_ttml.d.ts +1 -1
  60. package/dist/commonjs/parsers/texttracks/ttml/regexps.d.ts.map +1 -1
  61. package/dist/commonjs/parsers/texttracks/ttml/regexps.js +1 -1
  62. package/dist/commonjs/parsers/texttracks/webvtt/native/set_settings_on_cue.js +1 -1
  63. package/dist/commonjs/transports/smooth/segment_loader.d.ts.map +1 -1
  64. package/dist/commonjs/utils/array_find.js +1 -1
  65. package/dist/commonjs/utils/array_find_index.js +1 -1
  66. package/dist/commonjs/utils/array_includes.js +1 -1
  67. package/dist/commonjs/utils/assert.js +1 -1
  68. package/dist/commonjs/utils/flat_map.d.ts.map +1 -1
  69. package/dist/commonjs/utils/flat_map.js +0 -1
  70. package/dist/commonjs/utils/logger.d.ts.map +1 -1
  71. package/dist/commonjs/utils/logger.js +0 -2
  72. package/dist/commonjs/utils/noop.js +1 -1
  73. package/dist/commonjs/utils/object_assign.d.ts.map +1 -1
  74. package/dist/commonjs/utils/object_assign.js +3 -4
  75. package/dist/commonjs/utils/object_values.js +1 -1
  76. package/dist/commonjs/utils/request/xhr.js +1 -1
  77. package/dist/commonjs/utils/starts_with.d.ts.map +1 -1
  78. package/dist/commonjs/utils/starts_with.js +0 -1
  79. package/dist/commonjs/utils/string_parsing.js +1 -1
  80. package/dist/commonjs/utils/url-utils.js +2 -2
  81. package/dist/commonjs/utils/weak_map_memory.d.ts.map +1 -1
  82. package/dist/commonjs/utils/weak_map_memory.js +0 -1
  83. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  84. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  85. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  86. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  87. package/dist/es2017/compat/add_class_name.d.ts.map +1 -1
  88. package/dist/es2017/compat/add_class_name.js +1 -4
  89. package/dist/es2017/compat/browser_compatibility_types.d.ts.map +1 -1
  90. package/dist/es2017/compat/browser_compatibility_types.js +0 -1
  91. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.d.ts.map +1 -1
  92. package/dist/es2017/compat/eme/custom_media_keys/webkit_media_keys.js +0 -2
  93. package/dist/es2017/compat/eme/eme-api-implementation.js +0 -1
  94. package/dist/es2017/compat/eme/generate_key_request.d.ts +2 -2
  95. package/dist/es2017/compat/eme/generate_key_request.js +2 -2
  96. package/dist/es2017/compat/is_vtt_cue.d.ts.map +1 -1
  97. package/dist/es2017/compat/is_vtt_cue.js +0 -1
  98. package/dist/es2017/compat/patch_webkit_source_buffer.js +1 -1
  99. package/dist/es2017/core/main/worker/content_preparer.d.ts.map +1 -1
  100. package/dist/es2017/core/main/worker/content_preparer.js +34 -0
  101. package/dist/es2017/core/segment_sinks/garbage_collector.d.ts.map +1 -1
  102. package/dist/es2017/core/segment_sinks/garbage_collector.js +4 -0
  103. package/dist/es2017/core/stream/representation/representation_stream.d.ts.map +1 -1
  104. package/dist/es2017/core/stream/representation/representation_stream.js +29 -45
  105. package/dist/es2017/core/stream/representation/utils/push_init_segment.d.ts.map +1 -1
  106. package/dist/es2017/core/stream/representation/utils/push_init_segment.js +0 -3
  107. package/dist/es2017/core/stream/representation/utils/push_media_segment.d.ts.map +1 -1
  108. package/dist/es2017/core/stream/representation/utils/push_media_segment.js +0 -3
  109. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/api/index.js +1 -1
  110. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/capabilities.d.ts +2 -2
  111. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/capabilities.js +2 -2
  112. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.d.ts.map +1 -1
  113. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.js +0 -1
  114. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.d.ts.map +1 -1
  115. package/dist/es2017/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.js +0 -1
  116. package/dist/es2017/main_thread/api/public_api.d.ts.map +1 -1
  117. package/dist/es2017/main_thread/api/public_api.js +2 -3
  118. package/dist/es2017/main_thread/decrypt/session_events_listener.d.ts.map +1 -1
  119. package/dist/es2017/main_thread/decrypt/session_events_listener.js +4 -6
  120. package/dist/es2017/main_thread/decrypt/utils/loaded_sessions_store.d.ts +1 -1
  121. package/dist/es2017/main_thread/decrypt/utils/loaded_sessions_store.js +1 -1
  122. package/dist/es2017/main_thread/init/multi_thread_content_initializer.d.ts.map +1 -1
  123. package/dist/es2017/main_thread/init/multi_thread_content_initializer.js +5 -3
  124. package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts +5 -4
  125. package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.d.ts.map +1 -1
  126. package/dist/es2017/main_thread/init/utils/update_manifest_codec_support.js +10 -4
  127. package/dist/es2017/manifest/classes/manifest.js +1 -1
  128. package/dist/es2017/manifest/classes/representation.d.ts +2 -0
  129. package/dist/es2017/manifest/classes/representation.d.ts.map +1 -1
  130. package/dist/es2017/manifest/classes/representation.js +1 -0
  131. package/dist/es2017/manifest/types.d.ts +2 -0
  132. package/dist/es2017/manifest/types.d.ts.map +1 -1
  133. package/dist/es2017/parsers/manifest/dash/common/convert_supplemental_codecs.d.ts +1 -1
  134. package/dist/es2017/parsers/manifest/dash/common/convert_supplemental_codecs.js +1 -1
  135. package/dist/es2017/parsers/manifest/dash/common/indexes/tokens.js +3 -3
  136. package/dist/es2017/parsers/manifest/dash/common/parse_representations.js +1 -1
  137. package/dist/es2017/parsers/manifest/dash/fast-js-parser/node_parsers/utils.d.ts.map +1 -1
  138. package/dist/es2017/parsers/manifest/dash/native-parser/node_parsers/utils.d.ts.map +1 -1
  139. package/dist/es2017/parsers/texttracks/ttml/parse_ttml.d.ts +1 -1
  140. package/dist/es2017/parsers/texttracks/ttml/regexps.d.ts.map +1 -1
  141. package/dist/es2017/parsers/texttracks/ttml/regexps.js +1 -1
  142. package/dist/es2017/parsers/texttracks/webvtt/native/set_settings_on_cue.js +1 -1
  143. package/dist/es2017/transports/smooth/segment_loader.d.ts.map +1 -1
  144. package/dist/es2017/utils/array_find.js +1 -1
  145. package/dist/es2017/utils/array_find_index.js +1 -1
  146. package/dist/es2017/utils/array_includes.js +1 -1
  147. package/dist/es2017/utils/assert.js +1 -1
  148. package/dist/es2017/utils/flat_map.d.ts.map +1 -1
  149. package/dist/es2017/utils/flat_map.js +0 -1
  150. package/dist/es2017/utils/logger.d.ts.map +1 -1
  151. package/dist/es2017/utils/logger.js +0 -2
  152. package/dist/es2017/utils/noop.js +1 -1
  153. package/dist/es2017/utils/object_assign.d.ts.map +1 -1
  154. package/dist/es2017/utils/object_assign.js +3 -4
  155. package/dist/es2017/utils/object_values.js +1 -1
  156. package/dist/es2017/utils/request/xhr.js +1 -1
  157. package/dist/es2017/utils/starts_with.d.ts.map +1 -1
  158. package/dist/es2017/utils/starts_with.js +0 -1
  159. package/dist/es2017/utils/string_parsing.js +1 -1
  160. package/dist/es2017/utils/url-utils.js +2 -2
  161. package/dist/es2017/utils/weak_map_memory.d.ts.map +1 -1
  162. package/dist/es2017/utils/weak_map_memory.js +0 -1
  163. package/dist/mpd-parser.wasm +0 -0
  164. package/dist/rx-player.js +80 -107
  165. package/dist/rx-player.min.js +13 -13
  166. package/dist/worker.js +4 -4
  167. package/eslint.config.mjs +423 -0
  168. package/package.json +25 -20
  169. package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
  170. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  171. package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +0 -1
  172. package/src/compat/add_class_name.ts +1 -4
  173. package/src/compat/browser_compatibility_types.ts +0 -1
  174. package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +0 -2
  175. package/src/compat/eme/eme-api-implementation.ts +0 -1
  176. package/src/compat/eme/generate_key_request.ts +2 -2
  177. package/src/compat/is_vtt_cue.ts +0 -1
  178. package/src/compat/patch_webkit_source_buffer.ts +1 -1
  179. package/src/core/main/worker/content_preparer.ts +35 -1
  180. package/src/core/segment_sinks/garbage_collector.ts +4 -0
  181. package/src/core/stream/representation/representation_stream.ts +29 -64
  182. package/src/core/stream/representation/utils/push_init_segment.ts +0 -3
  183. package/src/core/stream/representation/utils/push_media_segment.ts +0 -3
  184. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +0 -3
  185. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +0 -2
  186. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +0 -2
  187. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +0 -2
  188. package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +0 -7
  189. package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +1 -1
  190. package/src/experimental/tools/mediaCapabilitiesProber/capabilities.ts +2 -2
  191. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +0 -1
  192. package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +0 -1
  193. package/src/main_thread/api/public_api.ts +2 -3
  194. package/src/main_thread/decrypt/session_events_listener.ts +9 -8
  195. package/src/main_thread/decrypt/utils/loaded_sessions_store.ts +1 -1
  196. package/src/main_thread/init/multi_thread_content_initializer.ts +5 -2
  197. package/src/main_thread/init/utils/__tests__/update_manifest_codec_support.test.ts +45 -2
  198. package/src/main_thread/init/utils/update_manifest_codec_support.ts +13 -3
  199. package/src/manifest/classes/manifest.ts +1 -1
  200. package/src/manifest/classes/representation.ts +3 -0
  201. package/src/manifest/types.ts +2 -0
  202. package/src/parsers/manifest/dash/common/convert_supplemental_codecs.ts +1 -1
  203. package/src/parsers/manifest/dash/common/indexes/tokens.ts +3 -3
  204. package/src/parsers/manifest/dash/common/parse_representations.ts +1 -1
  205. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/AdaptationSet.test.ts +3 -7
  206. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentComponent.test.ts +1 -1
  207. package/src/parsers/manifest/dash/fast-js-parser/node_parsers/__tests__/ContentProtection.test.ts +1 -1
  208. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/AdaptationSet.test.ts +3 -3
  209. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentComponent.test.ts +1 -1
  210. package/src/parsers/manifest/dash/native-parser/node_parsers/__tests__/ContentProtection.test.ts +2 -2
  211. package/src/parsers/texttracks/ttml/parse_ttml.ts +1 -1
  212. package/src/parsers/texttracks/ttml/regexps.ts +1 -1
  213. package/src/parsers/texttracks/webvtt/native/set_settings_on_cue.ts +1 -1
  214. package/src/utils/__tests__/array_find.test.ts +1 -1
  215. package/src/utils/__tests__/array_find_index.test.ts +0 -1
  216. package/src/utils/__tests__/array_includes.test.ts +1 -1
  217. package/src/utils/__tests__/id_generator.test.ts +0 -2
  218. package/src/utils/array_find.ts +1 -1
  219. package/src/utils/array_find_index.ts +1 -1
  220. package/src/utils/array_includes.ts +1 -1
  221. package/src/utils/assert.ts +1 -1
  222. package/src/utils/flat_map.ts +0 -1
  223. package/src/utils/logger.ts +0 -2
  224. package/src/utils/noop.ts +1 -1
  225. package/src/utils/object_assign.ts +3 -4
  226. package/src/utils/object_values.ts +1 -1
  227. package/src/utils/request/xhr.ts +2 -2
  228. package/src/utils/starts_with.ts +0 -1
  229. package/src/utils/string_parsing.ts +1 -1
  230. package/src/utils/url-utils.ts +2 -2
  231. package/src/utils/weak_map_memory.ts +0 -1
  232. package/vitest.config.mjs +34 -28
@@ -111,23 +111,23 @@ export default function SessionEventsListener(
111
111
  () => runGetLicense(message, messageType),
112
112
  backoffOptions,
113
113
  manualCanceller.signal,
114
- )
115
- .then((licenseObject) => {
114
+ ).then(
115
+ async (licenseObject) => {
116
116
  if (manualCanceller.isUsed()) {
117
- return Promise.resolve();
117
+ return;
118
118
  }
119
119
  if (isNullOrUndefined(licenseObject)) {
120
120
  log.info("DRM: No license given, skipping session.update");
121
121
  } else {
122
122
  try {
123
- return updateSessionWithMessage(session, licenseObject);
123
+ await updateSessionWithMessage(session, licenseObject);
124
124
  } catch (err) {
125
125
  manualCanceller.cancel();
126
126
  callbacks.onError(err);
127
127
  }
128
128
  }
129
- })
130
- .catch((err: unknown) => {
129
+ },
130
+ (err: unknown) => {
131
131
  if (manualCanceller.isUsed()) {
132
132
  return;
133
133
  }
@@ -148,7 +148,8 @@ export default function SessionEventsListener(
148
148
  }
149
149
  }
150
150
  callbacks.onError(formattedError);
151
- });
151
+ },
152
+ );
152
153
  },
153
154
  manualCanceller.signal,
154
155
  );
@@ -248,7 +249,7 @@ export interface ISessionEventListenerCallbacks {
248
249
  */
249
250
  onKeyUpdate: (val: IKeyUpdateValue) => void;
250
251
  onWarning: (val: IPlayerError) => void;
251
- // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
252
+ /* eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents */
252
253
  onError: (val: unknown | BlacklistedSessionError) => void;
253
254
  }
254
255
 
@@ -149,7 +149,7 @@ export default class LoadedSessionsStore {
149
149
  * @param {Object} mediaKeySession
150
150
  * @param {string|undefined} initializationDataType - Initialization data type
151
151
  * given e.g. by the "encrypted" event for the corresponding request.
152
- * @param {Uint8Array} initializationData - Initialization data given e.g. by
152
+ * @param {Uint8Array} initializationData - Initialization data given e.g. by
153
153
  * the "encrypted" event for the corresponding request.
154
154
  * @returns {Promise}
155
155
  */
@@ -1,4 +1,5 @@
1
1
  import type { IMediaElement } from "../../compat/browser_compatibility_types";
2
+ import hasMseInWorker from "../../compat/has_mse_in_worker";
2
3
  import mayMediaElementFailOnUndecipherableData from "../../compat/may_media_element_fail_on_undecipherable_data";
3
4
  import shouldReloadMediaSourceOnDecipherabilityUpdate from "../../compat/should_reload_media_source_on_decipherability_update";
4
5
  import type { ISegmentSinkMetrics } from "../../core/segment_sinks/segment_sinks_store";
@@ -1168,7 +1169,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer {
1168
1169
  case WorkerMessageType.LogMessage:
1169
1170
  // Already handled by prepare's handler
1170
1171
  break;
1171
- case WorkerMessageType.ThumbnailDataResponse:
1172
+ case WorkerMessageType.ThumbnailDataResponse: {
1172
1173
  if (this._currentContentInfo?.contentId !== msgData.contentId) {
1173
1174
  return;
1174
1175
  }
@@ -1185,6 +1186,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer {
1185
1186
  log.error("MTCI: Failed to send segment sink store update");
1186
1187
  }
1187
1188
  break;
1189
+ }
1188
1190
  default:
1189
1191
  assertUnreachable(msgData);
1190
1192
  }
@@ -1411,6 +1413,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer {
1411
1413
  const updatedCodecs = updateManifestCodecSupport(
1412
1414
  manifest,
1413
1415
  this._currentContentInfo?.contentDecryptor ?? null,
1416
+ hasMseInWorker,
1414
1417
  );
1415
1418
  if (updatedCodecs.length > 0) {
1416
1419
  sendMessage(this._settings.worker, {
@@ -2074,7 +2077,7 @@ function bindNumberReferencesToWorker(
2074
2077
  // overload, but the body here is not aware of that.
2075
2078
  sendMessage(worker, {
2076
2079
  type: MainThreadMessageType.ReferenceUpdate,
2077
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
2080
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
2078
2081
  value: { name: ref[1] as any, newVal: newVal as any },
2079
2082
  });
2080
2083
  },
@@ -47,6 +47,7 @@ function generateFakeManifestWithRepresentations(
47
47
  id: "period1",
48
48
  start: 0,
49
49
  streamEvents: [],
50
+ thumbnailTracks: [],
50
51
  };
51
52
 
52
53
  const manifest: IManifestMetadata = {
@@ -192,7 +193,7 @@ describe("init - utils - updateManifestCodecSupport", () => {
192
193
  },
193
194
  };
194
195
  const contentDecryptor = new ContentDecryptor(video, [keySystem1]);
195
- updateManifestCodecSupport(manifest, contentDecryptor);
196
+ updateManifestCodecSupport(manifest, contentDecryptor, true);
196
197
  expect(representationAVC.isSupported).toBe(true);
197
198
  expect(representationHEVC.isSupported).toBe(true);
198
199
  expect(representationVP9.isSupported).toBe(false); // Not Supported by MSE
@@ -273,11 +274,53 @@ describe("init - utils - updateManifestCodecSupport", () => {
273
274
  const contentDecryptor = new ContentDecryptor(video, [keySystem1]);
274
275
  await sleep(100);
275
276
  contentDecryptor.attach();
276
- updateManifestCodecSupport(manifest, contentDecryptor);
277
+ updateManifestCodecSupport(manifest, contentDecryptor, true);
277
278
  expect(encryptedRepresentationAVC.isSupported).toBe(true);
278
279
  expect(encryptedRepresentationHEVC.isSupported).toBe(false); // Not supported by EME
279
280
  expect(encryptedRepresentationVP9.isSupported).toBe(false); // Not supported by MSE
280
281
  expect(encryptedRepresentationMP4A.isSupported).toBe(true);
281
282
  expect(encryptedRepresentationEC3.isSupported).toBe(false); // Not supported by EME
282
283
  });
284
+
285
+ it("should update to false if the codec is not usable with MSE in worker", () => {
286
+ const representationAVC: IRepresentationMetadata = {
287
+ bitrate: 1000,
288
+ id: "representation1",
289
+ uniqueId: "representation1",
290
+ codecs: ["avc1.4d401e"],
291
+ mimeType: "video/mp4",
292
+ isSupported: undefined,
293
+ isCodecSupportedInWebWorker: undefined,
294
+ };
295
+ const representationHEVC: IRepresentationMetadata = {
296
+ bitrate: 2000,
297
+ id: "representation2",
298
+ uniqueId: "representation2",
299
+ codecs: ["hvc1.2.4.L153.B0"],
300
+ mimeType: "video/mp4",
301
+ isSupported: undefined,
302
+ isCodecSupportedInWebWorker: false,
303
+ };
304
+
305
+ const representationMP4A: IRepresentationMetadata = {
306
+ bitrate: 1000,
307
+ id: "representation4",
308
+ uniqueId: "representation4",
309
+ codecs: ["mp4a.40.2"],
310
+ mimeType: "audio/mp4",
311
+ isSupported: undefined,
312
+ isCodecSupportedInWebWorker: true,
313
+ };
314
+ const manifest = generateFakeManifestWithRepresentations(
315
+ [representationAVC, representationHEVC],
316
+ [representationMP4A],
317
+ );
318
+
319
+ const video = document.createElement("video");
320
+ const contentDecryptor = new ContentDecryptor(video, []);
321
+ updateManifestCodecSupport(manifest, contentDecryptor, true);
322
+ expect(representationAVC.isSupported).toBe(true);
323
+ expect(representationHEVC.isSupported).toBe(false); // not supported with MSE in worker
324
+ expect(representationMP4A.isSupported).toBe(true);
325
+ });
283
326
  });
@@ -56,13 +56,15 @@ export function getCodecsWithUnknownSupport(
56
56
  * Because probing for codec support is always synchronous in the main thread,
57
57
  * calling this function ensures that support is now known.
58
58
  *
59
- * @param {Object} manifest
60
- * @param {Object|null} contentDecryptor
61
- * @returns {boolean}
59
+ * @param {Object} manifest - The manifest to update
60
+ * @param {Object|null} contentDecryptor - The current content decryptor
61
+ * @param {boolean} isPlayingWithMSEinWorker - True if WebWorker is used with MSE in worker
62
+ * @returns {Array.<Object>}
62
63
  */
63
64
  export function updateManifestCodecSupport(
64
65
  manifest: IManifestMetadata,
65
66
  contentDecryptor: ContentDecryptor | null,
67
+ isPlayingWithMSEinWorker: boolean,
66
68
  ): ICodecSupportInfo[] {
67
69
  const codecSupportMap: Map<
68
70
  string,
@@ -131,6 +133,14 @@ export function updateManifestCodecSupport(
131
133
  let hasSupportedCodec: boolean = false;
132
134
  let hasCodecWithUndefinedSupport: boolean = false;
133
135
  adaptation.representations.forEach((representation) => {
136
+ if (
137
+ representation.isCodecSupportedInWebWorker === false &&
138
+ isPlayingWithMSEinWorker
139
+ ) {
140
+ representation.isSupported = false;
141
+ return;
142
+ }
143
+
134
144
  if (representation.isSupported !== undefined) {
135
145
  if (representation.isSupported) {
136
146
  hasSupportedCodec = true;
@@ -601,7 +601,7 @@ export default class Manifest
601
601
  const adaptationsByType = firstPeriod.adaptations;
602
602
  const adaptationsList: Adaptation[] = [];
603
603
  for (const adaptationType in adaptationsByType) {
604
- if (adaptationsByType.hasOwnProperty(adaptationType)) {
604
+ if (Object.prototype.hasOwnProperty.call(adaptationsByType, adaptationType)) {
605
605
  const adaptations = adaptationsByType[
606
606
  adaptationType as ITrackType
607
607
  ] as Adaptation[];
@@ -121,6 +121,8 @@ class Representation implements IRepresentationMetadata {
121
121
  * `Manifest` methods for this.
122
122
  */
123
123
  public shouldBeAvoided: boolean;
124
+ /** If the codec is supported with MSE in worker */
125
+ public isCodecSupportedInWebWorker: boolean | undefined;
124
126
 
125
127
  /**
126
128
  * @param {Object} args
@@ -484,6 +486,7 @@ class Representation implements IRepresentationMetadata {
484
486
  hdrInfo: this.hdrInfo,
485
487
  contentProtections: this.contentProtections,
486
488
  decipherable: this.decipherable,
489
+ isCodecSupportedInWebWorker: this.isCodecSupportedInWebWorker,
487
490
  };
488
491
  }
489
492
  }
@@ -488,4 +488,6 @@ export interface IRepresentationMetadata {
488
488
  decipherable?: boolean | undefined;
489
489
  /** Encryption information for this Representation. */
490
490
  contentProtections?: IContentProtections | undefined;
491
+ /** If the codec is supported with MSE in worker */
492
+ isCodecSupportedInWebWorker?: boolean | undefined;
491
493
  }
@@ -15,7 +15,7 @@ const supplementalCodecSeparator = /[, ]+/g;
15
15
  * to be compliant with what MSE APIs expect
16
16
  *
17
17
  * @param {string} val - The codec string to parse
18
- * @returns { Array.<string | undefined | null>}
18
+ * @returns { Array.<string | undefined | null>}
19
19
  */
20
20
  export function convertSupplementalCodecsToRFC6381(val: string): string {
21
21
  if (isNonEmptyString(val)) {
@@ -78,7 +78,7 @@ export function replaceRepresentationDASHTokens(
78
78
  .replace(/\$\$/g, "$")
79
79
  .replace(/\$RepresentationID\$/g, String(id))
80
80
  .replace(
81
- /\$Bandwidth(\%0(\d+)d)?\$/g,
81
+ /\$Bandwidth(%0(\d+)d)?\$/g,
82
82
  processFormatedToken(bitrate === undefined ? 0 : bitrate),
83
83
  );
84
84
  }
@@ -110,13 +110,13 @@ export function createDashUrlDetokenizer(
110
110
  } else {
111
111
  return url
112
112
  .replace(/\$\$/g, "$")
113
- .replace(/\$Number(\%0(\d+)d)?\$/g, (_x, _y, widthStr: string) => {
113
+ .replace(/\$Number(%0(\d+)d)?\$/g, (_x, _y, widthStr: string) => {
114
114
  if (nb === undefined) {
115
115
  throw new Error("Segment number not defined in a $Number$ scheme");
116
116
  }
117
117
  return processFormatedToken(nb)(_x, _y, widthStr);
118
118
  })
119
- .replace(/\$Time(\%0(\d+)d)?\$/g, (_x, _y, widthStr: string) => {
119
+ .replace(/\$Time(%0(\d+)d)?\$/g, (_x, _y, widthStr: string) => {
120
120
  if (time === undefined) {
121
121
  throw new Error("Segment time not defined in a $Time$ scheme");
122
122
  }
@@ -37,7 +37,7 @@ import resolveBaseURLs from "./resolve_base_urls";
37
37
  * adaptation data.
38
38
  * @param {Object} representation
39
39
  * @param {Object} adaptation
40
- * @returns {undefined | Array.<Object>}
40
+ * @returns {undefined | Array.<Object>}
41
41
  */
42
42
  function combineInbandEventStreams(
43
43
  representation: IRepresentationIntermediateRepresentation,
@@ -19,9 +19,7 @@ function testBooleanAttribute(attributeName: string, variableName?: string): voi
19
19
  [],
20
20
  ]);
21
21
 
22
- const element2 = parseXml(
23
- `<AdaptationSet ${attributeName}=\"false\" />`,
24
- )[0] as ITNode;
22
+ const element2 = parseXml(`<AdaptationSet ${attributeName}="false" />`)[0] as ITNode;
25
23
  expect(createAdaptationSetIntermediateRepresentation(element2)).toEqual([
26
24
  {
27
25
  attributes: { [_variableName]: false },
@@ -81,7 +79,7 @@ function testStringAttribute(attributeName: string, variableName?: string): void
81
79
  [],
82
80
  ]);
83
81
 
84
- const element2 = parseXml(`<AdaptationSet ${attributeName}=\"\" />`)[0] as ITNode;
82
+ const element2 = parseXml(`<AdaptationSet ${attributeName}="" />`)[0] as ITNode;
85
83
  expect(createAdaptationSetIntermediateRepresentation(element2)).toEqual([
86
84
  {
87
85
  attributes: { [_variableName]: "" },
@@ -407,9 +405,7 @@ function testNumberOrBooleanAttribute(
407
405
  [],
408
406
  ]);
409
407
 
410
- const element2 = parseXml(
411
- `<AdaptationSet ${attributeName}=\"false\" />`,
412
- )[0] as ITNode;
408
+ const element2 = parseXml(`<AdaptationSet ${attributeName}="false" />`)[0] as ITNode;
413
409
  expect(createAdaptationSetIntermediateRepresentation(element2)).toEqual([
414
410
  {
415
411
  attributes: { [_variableName]: false },
@@ -14,7 +14,7 @@ function testStringAttribute(attributeName: string, variableName?: string): void
14
14
  [_variableName]: "foobar",
15
15
  });
16
16
 
17
- const element2 = parseXml(`<contentComponent ${attributeName}=\"\" />`)[0] as ITNode;
17
+ const element2 = parseXml(`<contentComponent ${attributeName}="" />`)[0] as ITNode;
18
18
  expect(parseContentComponent(element2)).toEqual({ [_variableName]: "" });
19
19
  });
20
20
  }
@@ -17,7 +17,7 @@ function testStringAttribute(attributeName: string, variableName?: string): void
17
17
  [],
18
18
  ]);
19
19
 
20
- const element2 = parseXml(`<ContentProtection ${attributeName}=\"\" />`)[0] as ITNode;
20
+ const element2 = parseXml(`<ContentProtection ${attributeName}="" />`)[0] as ITNode;
21
21
  expect(parseContentProtection(element2)).toEqual([
22
22
  { attributes: { [_variableName]: "" }, children: { cencPssh: [] } },
23
23
  [],
@@ -21,7 +21,7 @@ function testBooleanAttribute(attributeName: string, variableName?: string): voi
21
21
  ]);
22
22
 
23
23
  const element2 = new DOMParser().parseFromString(
24
- `<AdaptationSet ${attributeName}=\"false\" />`,
24
+ `<AdaptationSet ${attributeName}="false" />`,
25
25
  "text/xml",
26
26
  ).childNodes[0] as Element;
27
27
  expect(createAdaptationSetIntermediateRepresentation(element2)).toEqual([
@@ -93,7 +93,7 @@ function testStringAttribute(attributeName: string, variableName?: string): void
93
93
  ]);
94
94
 
95
95
  const element2 = new DOMParser().parseFromString(
96
- `<AdaptationSet ${attributeName}=\"\" />`,
96
+ `<AdaptationSet ${attributeName}="" />`,
97
97
  "text/xml",
98
98
  ).childNodes[0] as Element;
99
99
  expect(createAdaptationSetIntermediateRepresentation(element2)).toEqual([
@@ -497,7 +497,7 @@ function testNumberOrBooleanAttribute(
497
497
  ]);
498
498
 
499
499
  const element2 = new DOMParser().parseFromString(
500
- `<AdaptationSet ${attributeName}=\"false\" />`,
500
+ `<AdaptationSet ${attributeName}="false" />`,
501
501
  "text/xml",
502
502
  ).childNodes[0] as Element;
503
503
  expect(createAdaptationSetIntermediateRepresentation(element2)).toEqual([
@@ -14,7 +14,7 @@ function testStringAttribute(attributeName: string, variableName?: string): void
14
14
  });
15
15
 
16
16
  const element2 = new DOMParser().parseFromString(
17
- `<contentComponent ${attributeName}=\"\" />`,
17
+ `<contentComponent ${attributeName}="" />`,
18
18
  "text/xml",
19
19
  ).childNodes[0] as Element;
20
20
  expect(parseContentComponent(element2)).toEqual({ [_variableName]: "" });
@@ -17,7 +17,7 @@ function testStringAttribute(attributeName: string, variableName?: string): void
17
17
  ]);
18
18
 
19
19
  const element2 = new DOMParser().parseFromString(
20
- `<ContentProtection ${attributeName}=\"\" />`,
20
+ `<ContentProtection ${attributeName}="" />`,
21
21
  "text/xml",
22
22
  ).childNodes[0] as Element;
23
23
  expect(parseContentProtection(element2)).toEqual([
@@ -66,7 +66,7 @@ describe("DASH Node Parsers - ContentProtection", () => {
66
66
  xmlns:cenc="urn:mpeg:cenc:2013"
67
67
  xmlns:mspr="urn:microsoft:playready"
68
68
  xmlns:scte35="urn:scte:scte35:2014:xml+bin">
69
- <ContentProtection cenc:default_KID=\"dead-beef\" />
69
+ <ContentProtection cenc:default_KID="dead-beef" />
70
70
  </MPD>
71
71
  `,
72
72
  "text/xml",
@@ -73,7 +73,7 @@ export interface IParsedTTMLCue {
73
73
  /** An object containing TTML parameters */
74
74
  ttParams: ITTParameters;
75
75
  shouldTrimWhiteSpace: boolean;
76
- /** TTML body as a DOM Element */
76
+ /** TTML body as a DOM Element */
77
77
  body: Element | null;
78
78
  }
79
79
 
@@ -36,7 +36,7 @@ const REGXP_TIME_HMS =
36
36
  // examples: 50% 10%
37
37
  const REGXP_PERCENT_VALUES = /^(\d{1,2}|100)% (\d{1,2}|100)%$/;
38
38
 
39
- const REGXP_LENGTH = /^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;
39
+ const REGXP_LENGTH = /^((?:\+|-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;
40
40
 
41
41
  const REGXP_8_HEX_COLOR = /^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/;
42
42
  const REGXP_4_HEX_COLOR = /^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/;
@@ -69,7 +69,7 @@ export default function setSettingsOnCue(
69
69
  }
70
70
 
71
71
  if (isNonEmptyString(settings.position)) {
72
- const positionRegex = /^([\d\.]+)%(?:,(line-left|line-right|center))?$/;
72
+ const positionRegex = /^([\d.]+)%(?:,(line-left|line-right|center))?$/;
73
73
  const positionArr = positionRegex.exec(settings.position);
74
74
  if (Array.isArray(positionArr) && positionArr.length >= 2) {
75
75
  const position = parseInt(positionArr[1], 10);
@@ -1,7 +1,7 @@
1
1
  import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
2
2
  import arrayFind from "../array_find";
3
3
 
4
- // eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
4
+ // eslint-disable-next-line no-restricted-properties
5
5
  const initialArrayFind = Array.prototype.find;
6
6
 
7
7
  describe("utils - arrayFind", () => {
@@ -1,7 +1,6 @@
1
1
  import { describe, beforeEach, afterEach, it, expect, vi } from "vitest";
2
2
  import arrayFindIndex from "../array_find_index";
3
3
 
4
- // eslint-disable-next-line @typescript-eslint/unbound-method
5
4
  // eslint-disable-next-line no-restricted-properties
6
5
  const initialArrayFindIndex = Array.prototype.findIndex;
7
6
 
@@ -1,7 +1,7 @@
1
1
  import { describe, beforeEach, afterEach, it, expect } from "vitest";
2
2
  import arrayIncludes from "../array_includes";
3
3
 
4
- // eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
4
+ // eslint-disable-next-line no-restricted-properties
5
5
  const initialArrayIncludes = Array.prototype.includes;
6
6
 
7
7
  describe("utils - array-includes", () => {
@@ -2,8 +2,6 @@ import { describe, afterEach, it, expect } from "vitest";
2
2
  import globalScope from "../global_scope";
3
3
  import idGenerator from "../id_generator";
4
4
 
5
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
6
-
7
5
  const oldNumberDef = globalScope.Number;
8
6
 
9
7
  describe("utils - idGenerator", () => {
@@ -31,7 +31,7 @@ export default function arrayFind<T>(
31
31
  predicate: (arg: T, index: number, fullArray: T[]) => boolean,
32
32
  thisArg?: unknown,
33
33
  ): T | undefined {
34
- // eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
34
+ // eslint-disable-next-line no-restricted-properties
35
35
  if (typeof (Array.prototype as ArrayWithFind<T>).find === "function") {
36
36
  // eslint-disable-next-line no-restricted-properties
37
37
  return (arr as ArrayWithFind<T>).find(predicate, thisArg);
@@ -34,7 +34,7 @@ export default function arrayFindIndex<T>(
34
34
  predicate: (arg: T, index: number, fullArray: T[]) => boolean,
35
35
  thisArg?: unknown,
36
36
  ): number {
37
- // eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
37
+ // eslint-disable-next-line no-restricted-properties
38
38
  if (typeof (Array.prototype as ArrayWithFindIndex<T>).findIndex === "function") {
39
39
  // eslint-disable-next-line no-restricted-properties
40
40
  return (arr as ArrayWithFindIndex<T>).findIndex(predicate, thisArg);
@@ -56,7 +56,7 @@ export default function arrayIncludes<T>(
56
56
  searchElement: T,
57
57
  fromIndex?: number,
58
58
  ): boolean {
59
- // eslint-disable-next-line no-restricted-properties, @typescript-eslint/unbound-method
59
+ // eslint-disable-next-line no-restricted-properties
60
60
  if (typeof Array.prototype.includes === "function") {
61
61
  // eslint-disable-next-line no-restricted-properties
62
62
  return arr.includes(searchElement, fromIndex);
@@ -72,7 +72,7 @@ export function assertInterface<T>(
72
72
  ): void {
73
73
  assert(!isNullOrUndefined(o), `${name} should be an object`);
74
74
  for (const k in iface) {
75
- if (iface.hasOwnProperty(k)) {
75
+ if (Object.prototype.hasOwnProperty.call(iface, k)) {
76
76
  assert(
77
77
  typeof o[k] === iface[k],
78
78
  `${name} should have property ${k} as a ${iface[k]}`,
@@ -29,7 +29,6 @@ type ArrayWithFlatMap<T> = T[] & {
29
29
  * @param {Function} fn
30
30
  */
31
31
  export default function flatMap<T, U>(originalArray: T[], fn: (arg: T) => U[] | U): U[] {
32
- // eslint-disable-next-line @typescript-eslint/unbound-method
33
32
  if (typeof (Array.prototype as ArrayWithFlatMap<T>).flatMap === "function") {
34
33
  return (originalArray as ArrayWithFlatMap<T>).flatMap(fn);
35
34
  }
@@ -117,7 +117,6 @@ export default class Logger extends EventEmitter<ILoggerEvents> {
117
117
  : (_namespace: string, consoleFn: IConsoleFn): IConsoleFn => consoleFn;
118
118
 
119
119
  if (logFn === undefined) {
120
- /* eslint-disable no-invalid-this */
121
120
  /* eslint-disable no-console */
122
121
  this.error =
123
122
  level >= this._levels.ERROR
@@ -136,7 +135,6 @@ export default class Logger extends EventEmitter<ILoggerEvents> {
136
135
  ? generateLogFn("log", console.log.bind(console))
137
136
  : noop;
138
137
  /* eslint-enable no-console */
139
- /* eslint-enable no-invalid-this */
140
138
  } else {
141
139
  const produceLogFn = (logLevel: ILoggerLevel) => {
142
140
  return level >= this._levels[logLevel]
package/src/utils/noop.ts CHANGED
@@ -21,5 +21,5 @@
21
21
  * is needed.
22
22
  * Also, it allows to avoid telling eslint to ignore empty blocks everywhere.
23
23
  */
24
- // eslint-disable-next-line no-empty,@typescript-eslint/no-empty-function
24
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
25
25
  export default function (): void {}
@@ -73,7 +73,7 @@ function objectAssign<T extends object, U extends object[]>(
73
73
  for (const source of sources) {
74
74
  for (const key in source) {
75
75
  if (Object.prototype.hasOwnProperty.call(source, key)) {
76
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
76
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
77
77
  to[key] = source[key as keyof typeof source];
78
78
  }
79
79
  }
@@ -81,9 +81,8 @@ function objectAssign<T extends object, U extends object[]>(
81
81
  return to as MergeRecursively<T, U>;
82
82
  }
83
83
 
84
- // eslint-disable-next-line @typescript-eslint/unbound-method, no-restricted-properties
84
+ // eslint-disable-next-line no-restricted-properties
85
85
  export default typeof Object.assign === "function"
86
86
  ? // eslint-disable-next-line no-restricted-properties
87
87
  Object.assign
88
- : // eslint-disable-next-line @typescript-eslint/unbound-method
89
- objectAssign;
88
+ : objectAssign;
@@ -22,7 +22,7 @@ function objectValues<T>(o: { [s: string]: T }): T[] {
22
22
  return Object.keys(o).map((k: string) => o[k]);
23
23
  }
24
24
 
25
- // eslint-disable-next-line @typescript-eslint/unbound-method, no-restricted-properties
25
+ // eslint-disable-next-line no-restricted-properties
26
26
  export default typeof Object.values === "function" ? Object.values : objectValues;
27
27
 
28
28
  export { objectValues };
@@ -49,7 +49,7 @@ export default function request(
49
49
  options: IRequestOptions<"document">,
50
50
  ): Promise<IRequestResponse<Document, "document">>;
51
51
  export default function request(
52
- options: IRequestOptions<"json">, // eslint-disable-next-line @typescript-eslint/no-restricted-types
52
+ options: IRequestOptions<"json">,
53
53
  ): Promise<IRequestResponse<object, "json">>;
54
54
  export default function request(
55
55
  options: IRequestOptions<"blob">,
@@ -108,7 +108,7 @@ export default function request<T>(
108
108
  if (!isNullOrUndefined(headers)) {
109
109
  const _headers = headers;
110
110
  for (const key in _headers) {
111
- if (_headers.hasOwnProperty(key)) {
111
+ if (Object.prototype.hasOwnProperty.call(_headers, key)) {
112
112
  xhr.setRequestHeader(key, _headers[key]);
113
113
  }
114
114
  }
@@ -29,7 +29,6 @@ export default function startsWith(
29
29
  searchString: string,
30
30
  position?: number,
31
31
  ): boolean {
32
- // eslint-disable-next-line @typescript-eslint/unbound-method
33
32
  // eslint-disable-next-line no-restricted-properties
34
33
  if (typeof String.prototype.startsWith === "function") {
35
34
  // eslint-disable-next-line no-restricted-properties
@@ -299,7 +299,7 @@ function utf8ToStr(data: Uint8Array): string {
299
299
  } else {
300
300
  // Let's implement a simple escape function
301
301
  // http://ecma-international.org/ecma-262/9.0/#sec-escape-string
302
- const nonEscapedChar = /[A-Za-z0-9*_\+-\.\/]/;
302
+ const nonEscapedChar = /[A-Za-z0-9*_+-./]/;
303
303
  escaped = "";
304
304
  for (let i = 0; i < utf8Str.length; i++) {
305
305
  if (nonEscapedChar.test(utf8Str[i])) {
@@ -34,7 +34,7 @@ const schemeRe = /^(?:[a-z]+:)?\/\//i;
34
34
  * 5th match is the fragment (e.g "nose")
35
35
  * */
36
36
  const urlComponentRegex =
37
- /^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/;
37
+ /^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/;
38
38
 
39
39
  /**
40
40
  * In a given URL, find the index at which the filename begins.
@@ -154,7 +154,7 @@ function getRelativeUrl(baseUrl: string, newUrl: string): string | null {
154
154
  * @param base
155
155
  * @param relative
156
156
  * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5
157
- * @example base: http://example.com | relative: /b/c | output: http://example.com/b/c
157
+ * @example base: http://example.com | relative: /b/c | output: http://example.com/b/c
158
158
  * @returns the resolved url
159
159
  */
160
160
  function _resolveURL(base: string, relative: string) {
@@ -52,7 +52,6 @@
52
52
  * ```
53
53
  * @class WeakMapMemory
54
54
  */
55
- // eslint-disable-next-line @typescript-eslint/no-restricted-types
56
55
  export default class WeakMapMemory<T extends object, U> {
57
56
  private readonly _fn: (obj: T) => U;
58
57
  private _weakMap: WeakMap<T, U>;