react-native-theoplayer 2.11.0 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +6 -3
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +14 -0
  5. package/android/src/main/java/com/theoplayer/ReactTHEOplayerView.kt +1 -3
  6. package/android/src/main/java/com/theoplayer/audio/AudioFocusManager.kt +145 -0
  7. package/android/src/main/java/com/theoplayer/drm/ContentProtectionModule.kt +1 -1
  8. package/ios/THEOplayerRCTBridge.m +0 -1
  9. package/ios/THEOplayerRCTNetworkUtils.swift +0 -2
  10. package/ios/THEOplayerRCTPlayerAPI.swift +14 -2
  11. package/ios/THEOplayerRCTPrintUtils.swift +0 -3
  12. package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +2 -0
  13. package/ios/THEOplayerRCTTextTrackEventHandler.swift +32 -4
  14. package/ios/THEOplayerRCTViewManager.swift +0 -3
  15. package/ios/ads/THEOplayerRCTAdsAPI.swift +0 -4
  16. package/ios/backgroundAudio/THEOplayerRCTRemoteCommandsManager.swift +51 -36
  17. package/ios/casting/THEOplayerRCTCastAPI.swift +0 -3
  18. package/ios/contentprotection/THEOplayerRCTContentProtectionAPI.swift +0 -3
  19. package/ios/contentprotection/THEOplayerRCTProxyContentProtectionIntegration.swift +0 -2
  20. package/ios/contentprotection/THEOplayerRCTProxyContentProtectionIntegrationFactory.swift +0 -2
  21. package/lib/commonjs/api/source/SourceDescription.js.map +1 -1
  22. package/lib/commonjs/api/source/analytics/AnalyticsDescription.js +2 -0
  23. package/lib/commonjs/api/source/analytics/AnalyticsDescription.js.map +1 -0
  24. package/lib/commonjs/api/source/analytics/barrel.js +17 -0
  25. package/lib/commonjs/api/source/analytics/barrel.js.map +1 -0
  26. package/lib/commonjs/api/source/barrel.js +15 -4
  27. package/lib/commonjs/api/source/barrel.js.map +1 -1
  28. package/lib/commonjs/api/track/TextTrack.js +1 -1
  29. package/lib/commonjs/api/track/TextTrack.js.map +1 -1
  30. package/lib/commonjs/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  31. package/lib/module/api/source/SourceDescription.js.map +1 -1
  32. package/lib/module/api/source/analytics/AnalyticsDescription.js +2 -0
  33. package/lib/module/api/source/analytics/AnalyticsDescription.js.map +1 -0
  34. package/lib/module/api/source/analytics/barrel.js +2 -0
  35. package/lib/module/api/source/analytics/barrel.js.map +1 -0
  36. package/lib/module/api/source/barrel.js +1 -0
  37. package/lib/module/api/source/barrel.js.map +1 -1
  38. package/lib/module/api/track/TextTrack.js +1 -1
  39. package/lib/module/api/track/TextTrack.js.map +1 -1
  40. package/lib/module/internal/adapter/THEOplayerWebAdapter.js.map +1 -1
  41. package/lib/typescript/api/source/SourceDescription.d.ts +5 -0
  42. package/lib/typescript/api/source/analytics/AnalyticsDescription.d.ts +15 -0
  43. package/lib/typescript/api/source/analytics/barrel.d.ts +1 -0
  44. package/lib/typescript/api/source/barrel.d.ts +1 -0
  45. package/lib/typescript/api/track/TextTrack.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/react-native-theoplayer.json +2 -1
  48. package/react-native-theoplayer.podspec +7 -3
  49. package/src/api/source/SourceDescription.ts +6 -0
  50. package/src/api/source/analytics/AnalyticsDescription.ts +16 -0
  51. package/src/api/source/analytics/barrel.ts +1 -0
  52. package/src/api/source/barrel.ts +1 -0
  53. package/src/api/track/TextTrack.ts +2 -2
  54. package/src/internal/adapter/THEOplayerWebAdapter.ts +1 -1
@@ -12,6 +12,7 @@ import type { HlsPlaybackConfiguration } from './hls/HlsPlaybackConfiguration';
12
12
  import type { AdDescription } from './ads/Ads';
13
13
  import type { MetadataDescription } from './metadata/MetadataDescription';
14
14
  import type { ServerSideAdInsertionConfiguration } from "./ads/ssai/ServerSideAdInsertionConfiguration";
15
+ import type { AnalyticsDescription } from "./analytics/AnalyticsDescription";
15
16
  export declare type Source = TypedSource;
16
17
  /**
17
18
  * A media resource or list of media resources.
@@ -78,6 +79,10 @@ export interface SourceConfiguration {
78
79
  * @public
79
80
  */
80
81
  metadata?: MetadataDescription;
82
+ /**
83
+ * List of {@link AnalyticsDescription}s to configure source-related properties for analytics connectors.
84
+ */
85
+ analytics?: AnalyticsDescription[];
81
86
  }
82
87
  /**
83
88
  * Describes the configuration of a player's source.
@@ -0,0 +1,15 @@
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
+ * Analytics extensions can define any custom set of fields.
13
+ */
14
+ [key: string]: unknown;
15
+ }
@@ -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';
@@ -33,7 +33,7 @@ export interface TextTrack extends Track {
33
33
  /**
34
34
  * The label of the text track.
35
35
  */
36
- label: string;
36
+ readonly label: string;
37
37
  /**
38
38
  * The language of the text track.
39
39
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-theoplayer",
3
- "version": "2.11.0",
3
+ "version": "2.12.1",
4
4
  "description": "A THEOplayer video component for react-native.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -2,7 +2,8 @@
2
2
  "ios": {
3
3
  "features": [
4
4
  "GOOGLE_IMA",
5
- "CHROMECAST"
5
+ "CHROMECAST",
6
+ "SIDELOADED_TEXTTRACKS"
6
7
  ]
7
8
  }
8
9
  }
@@ -36,14 +36,18 @@ Pod::Spec.new do |s|
36
36
  }
37
37
  else
38
38
  puts "Using THEOplayer-core SDK"
39
- s.dependency "THEOplayerSDK-core", "~> 5.6"
39
+ s.dependency "THEOplayerSDK-core", "~> 5.11"
40
40
  if theofeatures.include?("GOOGLE_IMA")
41
41
  puts "Adding THEOplayer-Integration-GoogleIMA"
42
- s.dependency "THEOplayer-Integration-GoogleIMA"
42
+ s.dependency "THEOplayer-Integration-GoogleIMA", "~> 5.11"
43
43
  end
44
44
  if theofeatures.include?("CHROMECAST")
45
45
  puts "Adding THEOplayer-Integration-GoogleCast"
46
- s.ios.dependency "THEOplayer-Integration-GoogleCast"
46
+ s.ios.dependency "THEOplayer-Integration-GoogleCast", "~> 5.11"
47
+ end
48
+ if theofeatures.include?("SIDELOADED_TEXTTRACKS")
49
+ puts "Adding THEOplayer-Connector-SideloadedSubtitle"
50
+ s.dependency "THEOplayer-Connector-SideloadedSubtitle", "~> 5.11"
47
51
  end
48
52
  end
49
53
 
@@ -12,6 +12,7 @@ import type { HlsPlaybackConfiguration } from './hls/HlsPlaybackConfiguration';
12
12
  import type { AdDescription } from './ads/Ads';
13
13
  import type { MetadataDescription } from './metadata/MetadataDescription';
14
14
  import type { ServerSideAdInsertionConfiguration } from "./ads/ssai/ServerSideAdInsertionConfiguration";
15
+ import type { AnalyticsDescription } from "./analytics/AnalyticsDescription";
15
16
 
16
17
  export type Source = TypedSource;
17
18
 
@@ -87,6 +88,11 @@ export interface SourceConfiguration {
87
88
  * @public
88
89
  */
89
90
  metadata?: MetadataDescription;
91
+
92
+ /**
93
+ * List of {@link AnalyticsDescription}s to configure source-related properties for analytics connectors.
94
+ */
95
+ analytics?: AnalyticsDescription[];
90
96
  }
91
97
 
92
98
  /**
@@ -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