@bluebillywig/react-native-bb-player 8.45.20 → 8.45.21
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.
- package/README.md +28 -0
- package/ios/BBShortsView.swift +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -377,6 +377,34 @@ export function ChromecastPlayer() {
|
|
|
377
377
|
|
|
378
378
|
> **Note:** Chromecast functionality is available on both iOS and Android platforms.
|
|
379
379
|
|
|
380
|
+
## Example App
|
|
381
|
+
|
|
382
|
+
The included example app (`example/`) demonstrates all SDK features. It's available on TestFlight (iOS) and as an APK download on each [GitHub release](https://github.com/bluebillywig/react-native-bb-player/releases).
|
|
383
|
+
|
|
384
|
+
### Screens
|
|
385
|
+
|
|
386
|
+
| Screen | Description |
|
|
387
|
+
|--------|-------------|
|
|
388
|
+
| **Simple Player** | Minimal player for performance testing |
|
|
389
|
+
| **API Reference** | Interactive demo of all player methods: play, pause, seek, volume, fullscreen |
|
|
390
|
+
| **Shorts** | Vertical video with swipe navigation, supports full and shelf display modes |
|
|
391
|
+
| **Outstream Ads** | Standalone ad player with collapse/expand for article placements |
|
|
392
|
+
| **Modal Player** | Native full-screen modal overlay with swipe-to-close (iOS) |
|
|
393
|
+
|
|
394
|
+
### Running Locally
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
# Install dependencies
|
|
398
|
+
npm ci && cd example && npm ci
|
|
399
|
+
|
|
400
|
+
# iOS
|
|
401
|
+
cd ios && pod install && cd ..
|
|
402
|
+
npx react-native run-ios
|
|
403
|
+
|
|
404
|
+
# Android
|
|
405
|
+
npx react-native run-android
|
|
406
|
+
```
|
|
407
|
+
|
|
380
408
|
## API Reference
|
|
381
409
|
|
|
382
410
|
### Component Props
|
package/ios/BBShortsView.swift
CHANGED
|
@@ -40,6 +40,7 @@ private enum LogLevel {
|
|
|
40
40
|
*/
|
|
41
41
|
class BBShortsView: UIView, BBNativeShortsViewDelegate {
|
|
42
42
|
private var shortsView: BBNativeShortsView?
|
|
43
|
+
private var navController: UINavigationController?
|
|
43
44
|
private var hasSetup: Bool = false
|
|
44
45
|
|
|
45
46
|
// MARK: - Props (set from React Native)
|
|
@@ -136,6 +137,17 @@ class BBShortsView: UIView, BBNativeShortsViewDelegate {
|
|
|
136
137
|
return
|
|
137
138
|
}
|
|
138
139
|
|
|
140
|
+
// Wrap in a UINavigationController so the native SDK can present
|
|
141
|
+
// shelf-mode modals (openShortsPlayerAsModal uses navigationController?.present).
|
|
142
|
+
// Hide the nav bar since we don't need visible navigation chrome.
|
|
143
|
+
let nav = UINavigationController(rootViewController: UIViewController())
|
|
144
|
+
nav.isNavigationBarHidden = true
|
|
145
|
+
nav.view.frame = bounds
|
|
146
|
+
nav.view.backgroundColor = .clear
|
|
147
|
+
viewController.addChild(nav)
|
|
148
|
+
nav.didMove(toParent: viewController)
|
|
149
|
+
self.navController = nav
|
|
150
|
+
|
|
139
151
|
// Convert options to Swift dictionary
|
|
140
152
|
var optionsDict: [String: Any]? = nil
|
|
141
153
|
if let dict = options as? [String: Any], !dict.isEmpty {
|
|
@@ -143,8 +155,9 @@ class BBShortsView: UIView, BBNativeShortsViewDelegate {
|
|
|
143
155
|
}
|
|
144
156
|
|
|
145
157
|
// Create the shorts view using the factory method
|
|
158
|
+
// Pass the nav controller so the native SDK's shelf tap can present modals
|
|
146
159
|
shortsView = BBNativeShorts.createShortsView(
|
|
147
|
-
uiViewController:
|
|
160
|
+
uiViewController: nav,
|
|
148
161
|
frame: bounds,
|
|
149
162
|
jsonUrl: jsonUrl,
|
|
150
163
|
options: optionsDict
|
|
@@ -176,6 +189,10 @@ class BBShortsView: UIView, BBNativeShortsViewDelegate {
|
|
|
176
189
|
shortsView?.destroy()
|
|
177
190
|
shortsView?.removeFromSuperview()
|
|
178
191
|
shortsView = nil
|
|
192
|
+
navController?.willMove(toParent: nil)
|
|
193
|
+
navController?.view.removeFromSuperview()
|
|
194
|
+
navController?.removeFromParent()
|
|
195
|
+
navController = nil
|
|
179
196
|
hasSetup = false
|
|
180
197
|
}
|
|
181
198
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluebillywig/react-native-bb-player",
|
|
3
|
-
"version": "8.45.
|
|
3
|
+
"version": "8.45.21",
|
|
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",
|