@bluebillywig/react-native-bb-player 8.45.10 → 8.45.12

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.
@@ -64,10 +64,6 @@ android {
64
64
  }
65
65
 
66
66
  repositories {
67
- def localRepo = file("$projectDir/repo")
68
- if (localRepo.exists()) {
69
- maven { url localRepo.toURI() }
70
- }
71
67
  mavenLocal()
72
68
  mavenCentral()
73
69
  google()
@@ -2,6 +2,8 @@ package com.bluebillywig.bbplayer
2
2
 
3
3
  import android.app.Activity
4
4
  import android.util.Log
5
+ import android.view.Choreographer
6
+ import android.view.View.MeasureSpec
5
7
  import android.widget.FrameLayout
6
8
  import com.bluebillywig.bbnativeplayersdk.BBNativeShorts
7
9
  import com.bluebillywig.bbnativeplayersdk.BBNativeShortsView
@@ -9,6 +11,7 @@ import com.bluebillywig.bbnativeplayersdk.BBNativeShortsViewDelegate
9
11
  import com.facebook.react.bridge.Arguments
10
12
  import com.facebook.react.bridge.ReadableMap
11
13
  import com.facebook.react.bridge.WritableMap
14
+ import com.facebook.react.modules.core.ReactChoreographer
12
15
  import com.facebook.react.uimanager.ThemedReactContext
13
16
  import com.facebook.react.uimanager.UIManagerHelper
14
17
  import com.facebook.react.uimanager.events.Event
@@ -48,20 +51,47 @@ class BBShortsView(private val reactContext: ThemedReactContext) : FrameLayout(r
48
51
 
49
52
  private var shortsView: BBNativeShortsView? = null
50
53
 
54
+ // ReactChoreographer layout pattern - same as BBPlayerView
55
+ private var isLayoutEnqueued = false
56
+ private var constructorComplete = false
57
+
58
+ private val layoutCallback = Choreographer.FrameCallback {
59
+ isLayoutEnqueued = false
60
+ measure(
61
+ MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
62
+ MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
63
+ )
64
+ layout(left, top, right, bottom)
65
+ }
66
+
51
67
  init {
52
68
  // Default to black background for Shorts
53
69
  setBackgroundColor(android.graphics.Color.BLACK)
70
+ setPadding(0, 0, 0, 0)
71
+ clipToPadding = false
72
+ clipChildren = false
73
+ constructorComplete = true
74
+ }
75
+
76
+ override fun requestLayout() {
77
+ super.requestLayout()
78
+ if (!constructorComplete) return
79
+ if (!isLayoutEnqueued) {
80
+ isLayoutEnqueued = true
81
+ ReactChoreographer.getInstance()
82
+ .postFrameCallback(
83
+ ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
84
+ layoutCallback
85
+ )
86
+ }
54
87
  }
55
88
 
56
- /**
57
- * Override onLayout to ensure child views receive proper bounds.
58
- * This is critical for React Native Fabric where layout isn't automatically propagated.
59
- */
60
89
  override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
61
90
  super.onLayout(changed, left, top, right, bottom)
62
- // Explicitly layout all children to fill the container
91
+ val w = right - left
92
+ val h = bottom - top
63
93
  for (i in 0 until childCount) {
64
- getChildAt(i)?.layout(0, 0, right - left, bottom - top)
94
+ getChildAt(i)?.layout(0, 0, w, h)
65
95
  }
66
96
  }
67
97
 
@@ -2,17 +2,21 @@ package com.bluebillywig.bbplayer
2
2
 
3
3
  import com.facebook.react.bridge.ReadableArray
4
4
  import com.facebook.react.bridge.ReadableMap
5
- import com.facebook.react.uimanager.SimpleViewManager
6
5
  import com.facebook.react.uimanager.ThemedReactContext
6
+ import com.facebook.react.uimanager.ViewGroupManager
7
7
  import com.facebook.react.uimanager.annotations.ReactProp
8
8
 
9
9
  /**
10
10
  * ViewManager for BBShortsView - manages the React Native native view for Shorts playback.
11
+ * Uses ViewGroupManager (not SimpleViewManager) because the native Shorts view has child views
12
+ * that need custom layout propagation via needsCustomLayoutForChildren().
11
13
  */
12
- class BBShortsViewManager : SimpleViewManager<BBShortsView>() {
14
+ class BBShortsViewManager : ViewGroupManager<BBShortsView>() {
13
15
 
14
16
  override fun getName(): String = REACT_CLASS
15
17
 
18
+ override fun needsCustomLayoutForChildren(): Boolean = true
19
+
16
20
  override fun createViewInstance(reactContext: ThemedReactContext): BBShortsView {
17
21
  return BBShortsView(reactContext)
18
22
  }
@@ -11,4 +11,3 @@
11
11
  #import <React/RCTBridge.h>
12
12
  #import <React/RCTEventEmitter.h>
13
13
  #import <React/RCTLog.h>
14
- #import <React/RCTUtils.h>
@@ -303,13 +303,7 @@ class BBPlayerModule: RCTEventEmitter {
303
303
 
304
304
  @objc func presentModalPlayer(_ jsonUrl: String, optionsJson: String?, contextJson: String?) {
305
305
  DispatchQueue.main.async {
306
- // RCTPresentedViewController() can return nil with RCTReactNativeFactory (RN 0.83+).
307
- // Fallback to UIScene-based lookup to find the root view controller.
308
- guard let rootVC = RCTPresentedViewController()
309
- ?? UIApplication.shared.connectedScenes
310
- .compactMap({ ($0 as? UIWindowScene)?.windows.first(where: { $0.isKeyWindow })?.rootViewController })
311
- .first
312
- else {
306
+ guard let rootVC = RCTPresentedViewController() else {
313
307
  NSLog("BBPlayerModule: No root view controller found")
314
308
  return
315
309
  }
@@ -5,38 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.BBModalPlayer = void 0;
7
7
  var _reactNative = require("react-native");
8
- // Resolve BBPlayerModule: TurboModuleRegistry (New Arch) with NativeModules fallback
9
- let BBPlayerModule = null;
10
- try {
11
- BBPlayerModule = require('./specs/NativeBBPlayerModule').default;
12
- } catch {
13
- // TurboModule not available
14
- }
15
- if (!BBPlayerModule) {
16
- BBPlayerModule = _reactNative.NativeModules.BBPlayerModule;
17
- }
18
- if (!BBPlayerModule) {
19
- console.warn('[BBModalPlayer] Native BBPlayerModule not found. ' + 'TurboModuleRegistry and NativeModules both returned null. ' + `Platform: ${_reactNative.Platform.OS}`);
20
- }
21
-
22
- // NativeEventEmitter requires a non-null module on iOS to avoid warnings.
23
- // Pass null-safe: events will simply never fire if module is missing.
24
- const eventEmitter = BBPlayerModule ? new _reactNative.NativeEventEmitter(BBPlayerModule) : new _reactNative.NativeEventEmitter();
8
+ const BBPlayerModule = _reactNative.NativeModules.BBPlayerModule;
9
+ const eventEmitter = new _reactNative.NativeEventEmitter(BBPlayerModule);
25
10
  const BBModalPlayer = exports.BBModalPlayer = {
26
- /**
27
- * Whether the native modal player module is available.
28
- * When false, present() will be a no-op.
29
- */
30
- get isAvailable() {
31
- return BBPlayerModule != null;
32
- },
33
11
  present(jsonUrl, options, context) {
34
- if (!BBPlayerModule) {
35
- console.warn('[BBModalPlayer] present() called but native module is null — cannot open modal');
36
- return false;
37
- }
38
- BBPlayerModule.presentModalPlayer(jsonUrl, options ? JSON.stringify(options) : null, context ? JSON.stringify(context) : null);
39
- return true;
12
+ BBPlayerModule?.presentModalPlayer(jsonUrl, options ? JSON.stringify(options) : null, context ? JSON.stringify(context) : null);
40
13
  },
41
14
  dismiss() {
42
15
  BBPlayerModule?.dismissModalPlayer();
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","BBPlayerModule","default","NativeModules","console","warn","Platform","OS","eventEmitter","NativeEventEmitter","BBModalPlayer","exports","isAvailable","present","jsonUrl","options","context","presentModalPlayer","JSON","stringify","dismiss","dismissModalPlayer","addEventListener","event","callback","addListener"],"sourceRoot":"../../src","sources":["BBModalPlayer.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA,IAAIC,cAAmB,GAAG,IAAI;AAC9B,IAAI;EACFA,cAAc,GAAGD,OAAO,CAAC,8BAA8B,CAAC,CAACE,OAAO;AAClE,CAAC,CAAC,MAAM;EACN;AAAA;AAEF,IAAI,CAACD,cAAc,EAAE;EACnBA,cAAc,GAAGE,0BAAa,CAACF,cAAc;AAC/C;AAEA,IAAI,CAACA,cAAc,EAAE;EACnBG,OAAO,CAACC,IAAI,CACV,mDAAmD,GACnD,4DAA4D,GAC5D,aAAaC,qBAAQ,CAACC,EAAE,EAC1B,CAAC;AACH;;AAEA;AACA;AACA,MAAMC,YAAY,GAAGP,cAAc,GAC/B,IAAIQ,+BAAkB,CAACR,cAAc,CAAC,GACtC,IAAIQ,+BAAkB,CAAC,CAAC;AAUrB,MAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC3B;AACF;AACA;AACA;EACE,IAAIE,WAAWA,CAAA,EAAY;IACzB,OAAOX,cAAc,IAAI,IAAI;EAC/B,CAAC;EAEDY,OAAOA,CAACC,OAAe,EAAEC,OAA4B,EAAEC,OAAgC,EAAW;IAChG,IAAI,CAACf,cAAc,EAAE;MACnBG,OAAO,CAACC,IAAI,CAAC,gFAAgF,CAAC;MAC9F,OAAO,KAAK;IACd;IACAJ,cAAc,CAACgB,kBAAkB,CAC/BH,OAAO,EACPC,OAAO,GAAGG,IAAI,CAACC,SAAS,CAACJ,OAAO,CAAC,GAAG,IAAI,EACxCC,OAAO,GAAGE,IAAI,CAACC,SAAS,CAACH,OAAO,CAAC,GAAG,IACtC,CAAC;IACD,OAAO,IAAI;EACb,CAAC;EAEDI,OAAOA,CAAA,EAAG;IACRnB,cAAc,EAAEoB,kBAAkB,CAAC,CAAC;EACtC,CAAC;EAEDC,gBAAgBA,CACdC,KAAa,EACbC,QAAkC,EAClC;IACA,OAAOhB,YAAY,CAACiB,WAAW,CAACF,KAAK,EAAEC,QAAQ,CAAC;EAClD;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","BBPlayerModule","NativeModules","eventEmitter","NativeEventEmitter","BBModalPlayer","exports","present","jsonUrl","options","context","presentModalPlayer","JSON","stringify","dismiss","dismissModalPlayer","addEventListener","event","callback","addListener"],"sourceRoot":"../../src","sources":["BBModalPlayer.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,cAAc,GAAGC,0BAAa,CAACD,cAAc;AACnD,MAAME,YAAY,GAAG,IAAIC,+BAAkB,CAACH,cAAc,CAAC;AAUpD,MAAMI,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC3BE,OAAOA,CAACC,OAAe,EAAEC,OAA4B,EAAEC,OAAgC,EAAE;IACvFT,cAAc,EAAEU,kBAAkB,CAChCH,OAAO,EACPC,OAAO,GAAGG,IAAI,CAACC,SAAS,CAACJ,OAAO,CAAC,GAAG,IAAI,EACxCC,OAAO,GAAGE,IAAI,CAACC,SAAS,CAACH,OAAO,CAAC,GAAG,IACtC,CAAC;EACH,CAAC;EAEDI,OAAOA,CAAA,EAAG;IACRb,cAAc,EAAEc,kBAAkB,CAAC,CAAC;EACtC,CAAC;EAEDC,gBAAgBA,CACdC,KAAa,EACbC,QAAkC,EAClC;IACA,OAAOf,YAAY,CAACgB,WAAW,CAACF,KAAK,EAAEC,QAAQ,CAAC;EAClD;AACF,CAAC","ignoreList":[]}
@@ -1,39 +1,11 @@
1
1
  "use strict";
2
2
 
3
- import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
4
-
5
- // Resolve BBPlayerModule: TurboModuleRegistry (New Arch) with NativeModules fallback
6
- let BBPlayerModule = null;
7
- try {
8
- BBPlayerModule = require('./specs/NativeBBPlayerModule').default;
9
- } catch {
10
- // TurboModule not available
11
- }
12
- if (!BBPlayerModule) {
13
- BBPlayerModule = NativeModules.BBPlayerModule;
14
- }
15
- if (!BBPlayerModule) {
16
- console.warn('[BBModalPlayer] Native BBPlayerModule not found. ' + 'TurboModuleRegistry and NativeModules both returned null. ' + `Platform: ${Platform.OS}`);
17
- }
18
-
19
- // NativeEventEmitter requires a non-null module on iOS to avoid warnings.
20
- // Pass null-safe: events will simply never fire if module is missing.
21
- const eventEmitter = BBPlayerModule ? new NativeEventEmitter(BBPlayerModule) : new NativeEventEmitter();
3
+ import { NativeEventEmitter, NativeModules } from 'react-native';
4
+ const BBPlayerModule = NativeModules.BBPlayerModule;
5
+ const eventEmitter = new NativeEventEmitter(BBPlayerModule);
22
6
  export const BBModalPlayer = {
23
- /**
24
- * Whether the native modal player module is available.
25
- * When false, present() will be a no-op.
26
- */
27
- get isAvailable() {
28
- return BBPlayerModule != null;
29
- },
30
7
  present(jsonUrl, options, context) {
31
- if (!BBPlayerModule) {
32
- console.warn('[BBModalPlayer] present() called but native module is null — cannot open modal');
33
- return false;
34
- }
35
- BBPlayerModule.presentModalPlayer(jsonUrl, options ? JSON.stringify(options) : null, context ? JSON.stringify(context) : null);
36
- return true;
8
+ BBPlayerModule?.presentModalPlayer(jsonUrl, options ? JSON.stringify(options) : null, context ? JSON.stringify(context) : null);
37
9
  },
38
10
  dismiss() {
39
11
  BBPlayerModule?.dismissModalPlayer();
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","Platform","BBPlayerModule","require","default","console","warn","OS","eventEmitter","BBModalPlayer","isAvailable","present","jsonUrl","options","context","presentModalPlayer","JSON","stringify","dismiss","dismissModalPlayer","addEventListener","event","callback","addListener"],"sourceRoot":"../../src","sources":["BBModalPlayer.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;;AAE1E;AACA,IAAIC,cAAmB,GAAG,IAAI;AAC9B,IAAI;EACFA,cAAc,GAAGC,OAAO,CAAC,8BAA8B,CAAC,CAACC,OAAO;AAClE,CAAC,CAAC,MAAM;EACN;AAAA;AAEF,IAAI,CAACF,cAAc,EAAE;EACnBA,cAAc,GAAGF,aAAa,CAACE,cAAc;AAC/C;AAEA,IAAI,CAACA,cAAc,EAAE;EACnBG,OAAO,CAACC,IAAI,CACV,mDAAmD,GACnD,4DAA4D,GAC5D,aAAaL,QAAQ,CAACM,EAAE,EAC1B,CAAC;AACH;;AAEA;AACA;AACA,MAAMC,YAAY,GAAGN,cAAc,GAC/B,IAAIH,kBAAkB,CAACG,cAAc,CAAC,GACtC,IAAIH,kBAAkB,CAAC,CAAC;AAU5B,OAAO,MAAMU,aAAa,GAAG;EAC3B;AACF;AACA;AACA;EACE,IAAIC,WAAWA,CAAA,EAAY;IACzB,OAAOR,cAAc,IAAI,IAAI;EAC/B,CAAC;EAEDS,OAAOA,CAACC,OAAe,EAAEC,OAA4B,EAAEC,OAAgC,EAAW;IAChG,IAAI,CAACZ,cAAc,EAAE;MACnBG,OAAO,CAACC,IAAI,CAAC,gFAAgF,CAAC;MAC9F,OAAO,KAAK;IACd;IACAJ,cAAc,CAACa,kBAAkB,CAC/BH,OAAO,EACPC,OAAO,GAAGG,IAAI,CAACC,SAAS,CAACJ,OAAO,CAAC,GAAG,IAAI,EACxCC,OAAO,GAAGE,IAAI,CAACC,SAAS,CAACH,OAAO,CAAC,GAAG,IACtC,CAAC;IACD,OAAO,IAAI;EACb,CAAC;EAEDI,OAAOA,CAAA,EAAG;IACRhB,cAAc,EAAEiB,kBAAkB,CAAC,CAAC;EACtC,CAAC;EAEDC,gBAAgBA,CACdC,KAAa,EACbC,QAAkC,EAClC;IACA,OAAOd,YAAY,CAACe,WAAW,CAACF,KAAK,EAAEC,QAAQ,CAAC;EAClD;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","BBPlayerModule","eventEmitter","BBModalPlayer","present","jsonUrl","options","context","presentModalPlayer","JSON","stringify","dismiss","dismissModalPlayer","addEventListener","event","callback","addListener"],"sourceRoot":"../../src","sources":["BBModalPlayer.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAEhE,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AACnD,MAAMC,YAAY,GAAG,IAAIH,kBAAkB,CAACE,cAAc,CAAC;AAU3D,OAAO,MAAME,aAAa,GAAG;EAC3BC,OAAOA,CAACC,OAAe,EAAEC,OAA4B,EAAEC,OAAgC,EAAE;IACvFN,cAAc,EAAEO,kBAAkB,CAChCH,OAAO,EACPC,OAAO,GAAGG,IAAI,CAACC,SAAS,CAACJ,OAAO,CAAC,GAAG,IAAI,EACxCC,OAAO,GAAGE,IAAI,CAACC,SAAS,CAACH,OAAO,CAAC,GAAG,IACtC,CAAC;EACH,CAAC;EAEDI,OAAOA,CAAA,EAAG;IACRV,cAAc,EAAEW,kBAAkB,CAAC,CAAC;EACtC,CAAC;EAEDC,gBAAgBA,CACdC,KAAa,EACbC,QAAkC,EAClC;IACA,OAAOb,YAAY,CAACc,WAAW,CAACF,KAAK,EAAEC,QAAQ,CAAC;EAClD;AACF,CAAC","ignoreList":[]}
@@ -6,12 +6,7 @@ export interface ModalPlayerOptions {
6
6
  [key: string]: unknown;
7
7
  }
8
8
  export declare const BBModalPlayer: {
9
- /**
10
- * Whether the native modal player module is available.
11
- * When false, present() will be a no-op.
12
- */
13
- readonly isAvailable: boolean;
14
- present(jsonUrl: string, options?: ModalPlayerOptions, context?: Record<string, string>): boolean;
9
+ present(jsonUrl: string, options?: ModalPlayerOptions, context?: Record<string, string>): void;
15
10
  dismiss(): void;
16
11
  addEventListener(event: string, callback: (...args: any[]) => void): import("react-native").EmitterSubscription;
17
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"BBModalPlayer.d.ts","sourceRoot":"","sources":["../../../src/BBModalPlayer.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,aAAa;IACxB;;;OAGG;;qBAKc,MAAM,YAAY,kBAAkB,YAAY,OAAO,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO;;4BAkBxF,MAAM,sBACO,GAAG,EAAE,KAAK,IAAI;CAIrC,CAAC"}
1
+ {"version":3,"file":"BBModalPlayer.d.ts","sourceRoot":"","sources":["../../../src/BBModalPlayer.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,aAAa;qBACP,MAAM,YAAY,kBAAkB,YAAY,OAAO,MAAM,EAAE,MAAM,CAAC;;4BAa9E,MAAM,sBACO,GAAG,EAAE,KAAK,IAAI;CAIrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluebillywig/react-native-bb-player",
3
- "version": "8.45.10",
3
+ "version": "8.45.12",
4
4
  "description": "Blue Billywig Native Video Player for React Native - iOS AVPlayer and Android ExoPlayer integration",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -32,7 +32,6 @@
32
32
  "ios",
33
33
  "android/src",
34
34
  "android/build.gradle",
35
- "android/repo",
36
35
  "plugin/build",
37
36
  "app.plugin.js",
38
37
  "README.md",
@@ -23,19 +23,12 @@ Pod::Spec.new do |s|
23
23
  s.static_framework = true
24
24
 
25
25
  s.dependency 'React-Core'
26
+ s.dependency 'BlueBillywigNativePlayerKit-iOS'
27
+ s.dependency 'BlueBillywigNativePlayerKit-iOS/GoogleCastSDK'
26
28
 
27
- # Prefer vendored frameworks (from npm package) over CocoaPods remote
28
- frameworks_dir = File.join(__dir__, 'ios', 'Frameworks')
29
- if File.exist?(File.join(frameworks_dir, 'BBNativePlayerKit.xcframework'))
30
- s.vendored_frameworks = 'ios/Frameworks/BBNativePlayerKit.xcframework',
31
- 'ios/Frameworks/bbnativeshared.xcframework'
32
- s.dependency 'GoogleAds-IMA-iOS-SDK', '3.23.0'
33
- s.dependency 'GoogleUserMessagingPlatform', '~> 2.1'
34
- s.dependency 'google-cast-sdk-dynamic-xcframework-ios-bb', '4.8.0'
35
- else
36
- s.dependency 'BlueBillywigNativePlayerKit-iOS'
37
- s.dependency 'BlueBillywigNativePlayerKit-iOS/GoogleCastSDK'
38
- end
29
+ # Note: TurboModule/New Architecture dependencies (React-Codegen, RCT-Folly, etc.)
30
+ # are automatically provided by React Native when New Architecture is enabled.
31
+ # No need to specify them here as they would create duplicate/conflicting deps.
39
32
 
40
33
  # Swift/Objective-C compatibility
41
34
  s.pod_target_xcconfig = {
@@ -43,5 +36,5 @@ Pod::Spec.new do |s|
43
36
  'SWIFT_COMPILATION_MODE' => 'wholemodule'
44
37
  }
45
38
 
46
- s.source_files = "ios/*.{h,m,mm,swift,hpp,cpp}"
39
+ s.source_files = "ios/**/*.{h,m,mm,swift,hpp,cpp}"
47
40
  end
@@ -1,29 +1,7 @@
1
- import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
2
 
3
- // Resolve BBPlayerModule: TurboModuleRegistry (New Arch) with NativeModules fallback
4
- let BBPlayerModule: any = null;
5
- try {
6
- BBPlayerModule = require('./specs/NativeBBPlayerModule').default;
7
- } catch {
8
- // TurboModule not available
9
- }
10
- if (!BBPlayerModule) {
11
- BBPlayerModule = NativeModules.BBPlayerModule;
12
- }
13
-
14
- if (!BBPlayerModule) {
15
- console.warn(
16
- '[BBModalPlayer] Native BBPlayerModule not found. ' +
17
- 'TurboModuleRegistry and NativeModules both returned null. ' +
18
- `Platform: ${Platform.OS}`,
19
- );
20
- }
21
-
22
- // NativeEventEmitter requires a non-null module on iOS to avoid warnings.
23
- // Pass null-safe: events will simply never fire if module is missing.
24
- const eventEmitter = BBPlayerModule
25
- ? new NativeEventEmitter(BBPlayerModule)
26
- : new NativeEventEmitter();
3
+ const BBPlayerModule = NativeModules.BBPlayerModule;
4
+ const eventEmitter = new NativeEventEmitter(BBPlayerModule);
27
5
 
28
6
  export interface ModalPlayerOptions {
29
7
  autoPlay?: boolean;
@@ -34,25 +12,12 @@ export interface ModalPlayerOptions {
34
12
  }
35
13
 
36
14
  export const BBModalPlayer = {
37
- /**
38
- * Whether the native modal player module is available.
39
- * When false, present() will be a no-op.
40
- */
41
- get isAvailable(): boolean {
42
- return BBPlayerModule != null;
43
- },
44
-
45
- present(jsonUrl: string, options?: ModalPlayerOptions, context?: Record<string, string>): boolean {
46
- if (!BBPlayerModule) {
47
- console.warn('[BBModalPlayer] present() called but native module is null — cannot open modal');
48
- return false;
49
- }
50
- BBPlayerModule.presentModalPlayer(
15
+ present(jsonUrl: string, options?: ModalPlayerOptions, context?: Record<string, string>) {
16
+ BBPlayerModule?.presentModalPlayer(
51
17
  jsonUrl,
52
18
  options ? JSON.stringify(options) : null,
53
19
  context ? JSON.stringify(context) : null,
54
20
  );
55
- return true;
56
21
  },
57
22
 
58
23
  dismiss() {