react-native-theoplayer 2.11.0 → 2.12.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 (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -0
  3. package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +14 -0
  4. package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +1 -3
  5. package/android/src/main/java/com/theoplayer/audio/AudioFocusManager.kt +145 -0
  6. package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +1 -1
  7. package/ios/THEOplayerRCTPlayerAPI.swift +14 -2
  8. package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +2 -0
  9. package/ios/THEOplayerRCTTextTrackEventHandler.swift +32 -4
  10. package/ios/backgroundAudio/THEOplayerRCTRemoteCommandsManager.swift +51 -36
  11. package/lib/commonjs/api/source/SourceDescription.js.map +1 -1
  12. package/lib/commonjs/api/source/analytics/AnalyticsDescription.js +2 -0
  13. package/lib/commonjs/api/source/analytics/AnalyticsDescription.js.map +1 -0
  14. package/lib/commonjs/api/source/analytics/barrel.js +17 -0
  15. package/lib/commonjs/api/source/analytics/barrel.js.map +1 -0
  16. package/lib/commonjs/api/source/barrel.js +15 -4
  17. package/lib/commonjs/api/source/barrel.js.map +1 -1
  18. package/lib/commonjs/api/track/TextTrack.js +1 -1
  19. package/lib/commonjs/api/track/TextTrack.js.map +1 -1
  20. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  21. package/lib/module/api/source/SourceDescription.js.map +1 -1
  22. package/lib/module/api/source/analytics/AnalyticsDescription.js +2 -0
  23. package/lib/module/api/source/analytics/AnalyticsDescription.js.map +1 -0
  24. package/lib/module/api/source/analytics/barrel.js +2 -0
  25. package/lib/module/api/source/analytics/barrel.js.map +1 -0
  26. package/lib/module/api/source/barrel.js +1 -0
  27. package/lib/module/api/source/barrel.js.map +1 -1
  28. package/lib/module/api/track/TextTrack.js +1 -1
  29. package/lib/module/api/track/TextTrack.js.map +1 -1
  30. package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  31. package/lib/typescript/api/source/SourceDescription.d.ts +5 -0
  32. package/lib/typescript/api/source/analytics/AnalyticsDescription.d.ts +15 -0
  33. package/lib/typescript/api/source/analytics/barrel.d.ts +1 -0
  34. package/lib/typescript/api/source/barrel.d.ts +1 -0
  35. package/lib/typescript/api/track/TextTrack.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/react-native-theoplayer.json +2 -1
  38. package/react-native-theoplayer.podspec +5 -1
  39. package/src/api/source/SourceDescription.ts +6 -0
  40. package/src/api/source/analytics/AnalyticsDescription.ts +16 -0
  41. package/src/api/source/analytics/barrel.ts +1 -0
  42. package/src/api/source/barrel.ts +1 -0
  43. package/src/api/track/TextTrack.ts +2 -2
  44. package/src/internal/adapter/THEOplayerWebAdapter.ts +1 -1
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Describes the configuration of an analytics integration as part of the SourceDescription.
3
+ *
4
+ * @public
5
+ */
6
+ export interface AnalyticsDescription {
7
+ /**
8
+ * The identifier of the analytics integration.
9
+ */
10
+ integration: string;
11
+
12
+ /**
13
+ * Analytics extensions can define any custom set of fields.
14
+ */
15
+ [key: string]: unknown;
16
+ }
@@ -0,0 +1 @@
1
+ export * from './AnalyticsDescription';
@@ -1,4 +1,5 @@
1
1
  export * from './ads/barrel';
2
+ export * from './analytics/barrel';
2
3
  export * from './drm/barrel';
3
4
  export * from './dash/barrel';
4
5
  export * from './hls/barrel';
@@ -38,7 +38,7 @@ export interface TextTrack extends Track {
38
38
  /**
39
39
  * The label of the text track.
40
40
  */
41
- label: string;
41
+ readonly label: string;
42
42
 
43
43
  /**
44
44
  * The language of the text track.
@@ -122,7 +122,7 @@ export function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolea
122
122
  }
123
123
 
124
124
  export function removeTextTrackCue(textTrack?: TextTrack, cue?: TextTrackCue) {
125
- if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {
125
+ if (textTrack && textTrack.cues && cue && hasTextTrackCue(textTrack, cue)) {
126
126
  textTrack.cues = textTrack.cues.filter((c) => c.uid !== cue.uid);
127
127
  }
128
128
  }
@@ -71,7 +71,7 @@ export class THEOplayerWebAdapter extends DefaultEventDispatcher<PlayerEventMap>
71
71
  set source(source: SourceDescription | undefined) {
72
72
  this._targetVideoQuality = undefined;
73
73
  if (this._player) {
74
- this._player.source = source;
74
+ this._player.source = source as THEOplayerWeb.SourceDescription;
75
75
  }
76
76
  }
77
77