react-native-theoplayer 9.1.2 → 9.2.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 (70) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -1
  3. package/android/build.gradle +12 -0
  4. package/android/proguard-rules.pro +1 -0
  5. package/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt +14 -0
  6. package/android/src/main/java/com/theoplayer/source/MillicastSourceAdapter.kt +104 -0
  7. package/android/src/main/java/com/theoplayer/source/SourceAdapter.kt +7 -5
  8. package/android/src/main/java/com/theoplayer/track/TextTrackStyleAdapter.kt +4 -0
  9. package/ios/THEOplayerRCTBridge.m +2 -0
  10. package/ios/THEOplayerRCTPlayerAPI.swift +13 -0
  11. package/ios/THEOplayerRCTSourceDescriptionBuilder.swift +5 -1
  12. package/ios/THEOplayerRCTView.swift +8 -1
  13. package/ios/millicast/THEOplayerRCTSourceDescriptionBuilder+Millicast.swift +189 -0
  14. package/ios/millicast/THEOplayerRCTView+Millicast.swift +21 -0
  15. package/ios/sideloadedMetadata/THEOplayerRCTSideloadedMetadataProcessor.swift +3 -1
  16. package/lib/commonjs/api/barrel.js +31 -20
  17. package/lib/commonjs/api/barrel.js.map +1 -1
  18. package/lib/commonjs/api/millicast/MillicastConnectOptions.js +2 -0
  19. package/lib/commonjs/api/millicast/MillicastConnectOptions.js.map +1 -0
  20. package/lib/commonjs/api/millicast/MillicastSource.js +6 -0
  21. package/lib/commonjs/api/millicast/MillicastSource.js.map +1 -0
  22. package/lib/commonjs/api/millicast/barrel.js +28 -0
  23. package/lib/commonjs/api/millicast/barrel.js.map +1 -0
  24. package/lib/commonjs/api/track/TextTrackStyle.js.map +1 -1
  25. package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js +10 -0
  26. package/lib/commonjs/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
  27. package/lib/commonjs/internal/utils/Dimensions.js +4 -6
  28. package/lib/commonjs/internal/utils/Dimensions.js.map +1 -1
  29. package/lib/commonjs/manifest.json +1 -1
  30. package/lib/module/api/barrel.js +1 -0
  31. package/lib/module/api/barrel.js.map +1 -1
  32. package/lib/module/api/millicast/MillicastConnectOptions.js +2 -0
  33. package/lib/module/api/millicast/MillicastConnectOptions.js.map +1 -0
  34. package/lib/module/api/millicast/MillicastSource.js +4 -0
  35. package/lib/module/api/millicast/MillicastSource.js.map +1 -0
  36. package/lib/module/api/millicast/barrel.js +5 -0
  37. package/lib/module/api/millicast/barrel.js.map +1 -0
  38. package/lib/module/api/track/TextTrackStyle.js.map +1 -1
  39. package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js +10 -0
  40. package/lib/module/internal/adapter/track/TextTrackStyleAdapter.js.map +1 -1
  41. package/lib/module/internal/utils/Dimensions.js +5 -7
  42. package/lib/module/internal/utils/Dimensions.js.map +1 -1
  43. package/lib/module/manifest.json +1 -1
  44. package/lib/typescript/api/backgroundAudio/BackgroundAudioConfiguration.d.ts +2 -2
  45. package/lib/typescript/api/barrel.d.ts +1 -0
  46. package/lib/typescript/api/barrel.d.ts.map +1 -1
  47. package/lib/typescript/api/millicast/MillicastConnectOptions.d.ts +204 -0
  48. package/lib/typescript/api/millicast/MillicastConnectOptions.d.ts.map +1 -0
  49. package/lib/typescript/api/millicast/MillicastSource.d.ts +51 -0
  50. package/lib/typescript/api/millicast/MillicastSource.d.ts.map +1 -0
  51. package/lib/typescript/api/millicast/barrel.d.ts +3 -0
  52. package/lib/typescript/api/millicast/barrel.d.ts.map +1 -0
  53. package/lib/typescript/api/track/TextTrackStyle.d.ts +7 -0
  54. package/lib/typescript/api/track/TextTrackStyle.d.ts.map +1 -1
  55. package/lib/typescript/internal/adapter/track/TextTrackStyleAdapter.d.ts +3 -0
  56. package/lib/typescript/internal/adapter/track/TextTrackStyleAdapter.d.ts.map +1 -1
  57. package/lib/typescript/internal/utils/Dimensions.d.ts.map +1 -1
  58. package/package.json +3 -2
  59. package/react-native-theoplayer.json +1 -1
  60. package/react-native-theoplayer.podspec +15 -9
  61. package/src/api/backgroundAudio/BackgroundAudioConfiguration.ts +2 -2
  62. package/src/api/barrel.ts +1 -0
  63. package/src/api/millicast/MillicastConnectOptions.ts +229 -0
  64. package/src/api/millicast/MillicastSource.ts +56 -0
  65. package/src/api/millicast/barrel.ts +2 -0
  66. package/src/api/track/TextTrackStyle.ts +8 -0
  67. package/src/internal/adapter/THEOplayerWebAdapter.ts +1 -1
  68. package/src/internal/adapter/track/TextTrackStyleAdapter.ts +12 -0
  69. package/src/internal/utils/Dimensions.ts +5 -7
  70. package/src/manifest.json +1 -1
@@ -0,0 +1,56 @@
1
+ import { MillicastConnectOptions, TypedSource } from 'react-native-theoplayer';
2
+
3
+ /**
4
+ * Represents a source for a {@link https://dolby.io/products/real-time-streaming/ | Millicast} live stream.
5
+ *
6
+ * @category Source
7
+ * @category Millicast
8
+ * @public
9
+ */
10
+ export interface MillicastSource extends TypedSource {
11
+ /**
12
+ * The content type.
13
+ *
14
+ * Must be `"millicast"`.
15
+ */
16
+ type: 'millicast';
17
+
18
+ /**
19
+ * The name of the Millicast stream to subscribe to.
20
+ *
21
+ * @see https://millicast.github.io/millicast-sdk/global.html#DirectorSubscriberOptions
22
+ */
23
+ src: string;
24
+
25
+ /**
26
+ * The Millicast account identifier.
27
+ *
28
+ * @see https://millicast.github.io/millicast-sdk/global.html#DirectorSubscriberOptions
29
+ */
30
+ streamAccountId: string;
31
+
32
+ /**
33
+ * Token to subscribe to secure streams.
34
+ *
35
+ * - If you are subscribing to an unsecure stream, you can omit this param.
36
+ *
37
+ * @see https://millicast.github.io/millicast-sdk/global.html#DirectorSubscriberOptions
38
+ */
39
+ subscriberToken?: string;
40
+
41
+ /**
42
+ * An optional configuration object to set additional subscriber options.
43
+ *
44
+ * - The available options are listed in the link below.
45
+ *
46
+ * @see https://millicast.github.io/millicast-sdk/View.html#connect
47
+ */
48
+ connectOptions?: MillicastConnectOptions;
49
+
50
+ /**
51
+ * The URL of the API endpoint that the SDK communicates with for authentication.
52
+ *
53
+ * @see https://millicast.github.io/millicast-sdk/module-Director.html#~setEndpoint
54
+ */
55
+ apiUrl?: string;
56
+ }
@@ -0,0 +1,2 @@
1
+ export * from './MillicastConnectOptions';
2
+ export * from './MillicastSource';
@@ -64,6 +64,14 @@ export interface TextTrackStyle {
64
64
  */
65
65
  edgeStyle: EdgeStyle | undefined;
66
66
 
67
+ /**
68
+ * The edge color for the text track.
69
+ *
70
+ * @remarks
71
+ * <br/> - Available on Android only.
72
+ */
73
+ edgeColor: string | undefined;
74
+
67
75
  /**
68
76
  * The top margin of the area where subtitles are being rendered.
69
77
  *
@@ -261,7 +261,7 @@ export class THEOplayerWebAdapter extends DefaultEventDispatcher<PlayerEventMap>
261
261
  }
262
262
 
263
263
  get textTrackStyle(): TextTrackStyle {
264
- return this._player?.textTrackStyle as TextTrackStyle;
264
+ return this._player?.textTrackStyle as unknown as TextTrackStyle;
265
265
  }
266
266
 
267
267
  get selectedVideoTrack(): number | undefined {
@@ -8,6 +8,7 @@ const NativePlayerModule = NativeModules.THEORCTPlayerModule;
8
8
  export class TextTrackStyleAdapter implements TextTrackStyle {
9
9
  private _backgroundColor: string | undefined = undefined;
10
10
  private _edgeStyle: EdgeStyle | undefined = undefined;
11
+ private _edgeColor: string | undefined = undefined;
11
12
  private _fontColor: string | undefined = undefined;
12
13
  private _fontFamily: string | undefined = undefined;
13
14
  private _fontSize: string | undefined = undefined;
@@ -41,6 +42,17 @@ export class TextTrackStyleAdapter implements TextTrackStyle {
41
42
  });
42
43
  }
43
44
 
45
+ get edgeColor(): string | undefined {
46
+ return this._edgeColor;
47
+ }
48
+
49
+ set edgeColor(color: string | undefined) {
50
+ this._edgeColor = color;
51
+ NativePlayerModule.setTextTrackStyle(this._view.nativeHandle, {
52
+ edgeColor: convertColorToRGBA(color),
53
+ });
54
+ }
55
+
44
56
  get fontColor(): string | undefined {
45
57
  return this._fontColor;
46
58
  }
@@ -1,5 +1,5 @@
1
1
  import type { ScaledSize } from 'react-native/Libraries/Utilities/Dimensions';
2
- import { Dimensions, NativeModules, Platform } from 'react-native';
2
+ import { Dimensions, NativeModules } from 'react-native';
3
3
 
4
4
  /**
5
5
  * Calculate the device's screen dimensions, while taking into account the full usable screen dimensions on Android.
@@ -7,12 +7,10 @@ import { Dimensions, NativeModules, Platform } from 'react-native';
7
7
  export function getFullscreenSize(): ScaledSize {
8
8
  const screenSize = Dimensions.get('screen');
9
9
 
10
- // For Android, ask the platform for the full usable screen dimensions.
10
+ // On Android, ask the platform for the full usable screen dimensions.
11
11
  // It should return the full usable screen size, including support for edgeToEdge layouts.
12
12
  // {@link https://developer.android.com/develop/ui/views/layout/edge-to-edge}
13
- if (Platform.OS === 'android') {
14
- const nativeDims: ScaledSize = NativeModules.THEORCTPlayerModule.getUsableScreenDimensions();
15
- return nativeDims.width > 0 && nativeDims.height > 0 ? nativeDims : screenSize;
16
- }
17
- return screenSize;
13
+
14
+ const nativeDims: ScaledSize = NativeModules.THEORCTPlayerModule.getUsableScreenDimensions();
15
+ return nativeDims.width > 0 && nativeDims.height > 0 ? nativeDims : screenSize;
18
16
  }
package/src/manifest.json CHANGED
@@ -1 +1 @@
1
- {"version":"9.1.2","buildDate":"2025-05-14T13:39:57.943Z"}
1
+ {"version":"9.2.0","buildDate":"2025-05-20T14:26:14.067Z"}