rx-player 4.2.0-dev.2024091000 → 4.2.0-dev.2024091600

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 (39) hide show
  1. package/CHANGELOG.md +14 -7
  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/main_thread/api/public_api.js +2 -2
  8. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  9. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +6 -5
  10. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Label.d.ts +4 -0
  11. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Label.d.ts.map +1 -0
  12. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/generators/Label.js +12 -0
  13. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
  14. package/dist/commonjs/parsers/manifest/dash/wasm-parser/ts/types.d.ts.map +1 -1
  15. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.d.ts.map +1 -1
  16. package/dist/es2017/__GENERATED_CODE/embedded_dash_wasm.js +1 -1
  17. package/dist/es2017/__GENERATED_CODE/embedded_worker.d.ts.map +1 -1
  18. package/dist/es2017/__GENERATED_CODE/embedded_worker.js +1 -1
  19. package/dist/es2017/main_thread/api/public_api.js +2 -2
  20. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.d.ts.map +1 -1
  21. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.js +6 -5
  22. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Label.d.ts +4 -0
  23. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Label.d.ts.map +1 -0
  24. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/generators/Label.js +9 -0
  25. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/types.d.ts +2 -1
  26. package/dist/es2017/parsers/manifest/dash/wasm-parser/ts/types.d.ts.map +1 -1
  27. package/dist/mpd-parser.wasm +0 -0
  28. package/dist/rx-player.js +4 -4
  29. package/dist/rx-player.min.js +15 -15
  30. package/dist/worker.js +6 -6
  31. package/package.json +5 -5
  32. package/src/__GENERATED_CODE/embedded_dash_wasm.ts +1 -1
  33. package/src/__GENERATED_CODE/embedded_worker.ts +1 -1
  34. package/src/main_thread/api/public_api.ts +2 -2
  35. package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +3 -2
  36. package/src/parsers/manifest/dash/wasm-parser/rs/processor/mod.rs +6 -2
  37. package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +10 -5
  38. package/src/parsers/manifest/dash/wasm-parser/ts/generators/Label.ts +16 -0
  39. package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +3 -0
@@ -409,7 +409,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
409
409
  // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1194624
410
410
  videoElement.preload = "auto";
411
411
 
412
- this.version = /* PLAYER_VERSION */ "4.2.0-dev.2024091000";
412
+ this.version = /* PLAYER_VERSION */ "4.2.0-dev.2024091600";
413
413
  this.log = log;
414
414
  this.state = "STOPPED";
415
415
  this.videoElement = videoElement;
@@ -3313,7 +3313,7 @@ class Player extends EventEmitter<IPublicAPIEvent> {
3313
3313
  }
3314
3314
  }
3315
3315
  }
3316
- Player.version = /* PLAYER_VERSION */ "4.2.0-dev.2024091000";
3316
+ Player.version = /* PLAYER_VERSION */ "4.2.0-dev.2024091600";
3317
3317
 
3318
3318
  /** Every events sent by the RxPlayer's public API. */
3319
3319
  interface IPublicAPIEvent {
@@ -86,6 +86,9 @@ pub enum TagName {
86
86
  // -- Inside a <SegmentList> --
87
87
  /// Indicate a <SegmentURL> node
88
88
  SegmentUrl = 20,
89
+
90
+ /// Indicate a <Label> node
91
+ Label = 21,
89
92
  }
90
93
 
91
94
  #[derive(PartialEq, Clone, Copy)]
@@ -276,8 +279,6 @@ pub enum AttributeName {
276
279
  /// namespaces that will appear in it.
277
280
  Namespace = 70,
278
281
 
279
- Label = 71, // String
280
-
281
282
  ServiceLocation = 72, // String
282
283
 
283
284
  // SegmentTemplate
@@ -114,7 +114,10 @@ impl MPDProcessor {
114
114
  }
115
115
  b"cenc:pssh" => self.process_cenc_element(),
116
116
  b"Location" => self.process_location_element(),
117
- b"Label" => self.process_label_element(),
117
+ b"Label" => {
118
+ TagName::Label.report_tag_open();
119
+ self.process_label_element();
120
+ }
118
121
  b"SegmentTimeline" => self.process_segment_timeline_element(),
119
122
 
120
123
  b"EventStream" => {
@@ -274,7 +277,7 @@ impl MPDProcessor {
274
277
  Ok(Event::Text(t)) => {
275
278
  if t.len() > 0 {
276
279
  match t.unescape() {
277
- Ok(unescaped) => AttributeName::Label.report(unescaped),
280
+ Ok(unescaped) => AttributeName::Text.report(unescaped),
278
281
  Err(err) => ParsingError::from(err).report_err(),
279
282
  }
280
283
  }
@@ -284,6 +287,7 @@ impl MPDProcessor {
284
287
  if inner_tag > 0 {
285
288
  inner_tag -= 1;
286
289
  } else {
290
+ TagName::Label.report_tag_close();
287
291
  break;
288
292
  }
289
293
  }
@@ -27,6 +27,7 @@ import { parseFloatOrBool, parseString } from "../utils";
27
27
  import { generateBaseUrlAttrParser } from "./BaseURL";
28
28
  import { generateContentComponentAttrParser } from "./ContentComponent";
29
29
  import { generateContentProtectionAttrParser } from "./ContentProtection";
30
+ import { generateLabelElementParser } from "./Label";
30
31
  import {
31
32
  generateRepresentationAttrParser,
32
33
  generateRepresentationChildrenParser,
@@ -209,6 +210,15 @@ export function generateAdaptationSetChildrenParser(
209
210
  break;
210
211
  }
211
212
 
213
+ case TagName.Label: {
214
+ parsersStack.pushParsers(
215
+ nodeId,
216
+ noop, // Label as treated like an attribute
217
+ generateLabelElementParser(adaptationSetChildren, linearMemory),
218
+ );
219
+ break;
220
+ }
221
+
212
222
  default:
213
223
  // Allows to make sure we're not mistakenly closing a re-opened
214
224
  // tag.
@@ -363,11 +373,6 @@ export function generateAdaptationSetAttrParser(
363
373
  case AttributeName.AvailabilityTimeComplete:
364
374
  adaptationAttrs.availabilityTimeComplete = dataView.getUint8(0) === 0;
365
375
  break;
366
- case AttributeName.Label: {
367
- const label = parseString(textDecoder, linearMemory.buffer, ptr, len);
368
- adaptationAttrs.label = label;
369
- break;
370
- }
371
376
 
372
377
  // TODO
373
378
  // case AttributeName.StartsWithSap:
@@ -0,0 +1,16 @@
1
+ import type { IAdaptationSetChildren } from "../../../node_parser_types";
2
+ import type { IAttributeParser } from "../parsers_stack";
3
+ import { AttributeName } from "../types";
4
+ import { parseString } from "../utils";
5
+
6
+ export function generateLabelElementParser(
7
+ adaptationSet: IAdaptationSetChildren,
8
+ linearMemory: WebAssembly.Memory,
9
+ ): IAttributeParser {
10
+ const textDecoder = new TextDecoder();
11
+ return function onMPDAttribute(attr: AttributeName, ptr: number, len: number) {
12
+ if (attr === AttributeName.Text) {
13
+ adaptationSet.label = parseString(textDecoder, linearMemory.buffer, ptr, len);
14
+ }
15
+ };
16
+ }
@@ -108,6 +108,9 @@ export const enum TagName {
108
108
 
109
109
  /// Indicate a <SegmentURL> node
110
110
  SegmentUrl = 20,
111
+
112
+ /// Indicate a <Label> node
113
+ Label = 21,
111
114
  }
112
115
 
113
116
  /**