@bluebillywig/react-native-bb-player 8.45.21 → 8.45.22
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/ios/BBShortsView.swift +23 -11
- package/package.json +1 -1
package/ios/BBShortsView.swift
CHANGED
|
@@ -139,12 +139,23 @@ class BBShortsView: UIView, BBNativeShortsViewDelegate {
|
|
|
139
139
|
|
|
140
140
|
// Wrap in a UINavigationController so the native SDK can present
|
|
141
141
|
// shelf-mode modals (openShortsPlayerAsModal uses navigationController?.present).
|
|
142
|
-
//
|
|
143
|
-
|
|
142
|
+
// The native SDK adds BBNativeShortsViewController as a child of the VC we pass.
|
|
143
|
+
// That child then uses its navigationController to present modals.
|
|
144
|
+
let containerVC = UIViewController()
|
|
145
|
+
containerVC.view.backgroundColor = .clear
|
|
146
|
+
let nav = UINavigationController(rootViewController: containerVC)
|
|
144
147
|
nav.isNavigationBarHidden = true
|
|
145
148
|
nav.view.frame = bounds
|
|
146
149
|
nav.view.backgroundColor = .clear
|
|
147
150
|
viewController.addChild(nav)
|
|
151
|
+
addSubview(nav.view)
|
|
152
|
+
nav.view.translatesAutoresizingMaskIntoConstraints = false
|
|
153
|
+
NSLayoutConstraint.activate([
|
|
154
|
+
nav.view.topAnchor.constraint(equalTo: topAnchor),
|
|
155
|
+
nav.view.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
156
|
+
nav.view.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
157
|
+
nav.view.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
158
|
+
])
|
|
148
159
|
nav.didMove(toParent: viewController)
|
|
149
160
|
self.navController = nav
|
|
150
161
|
|
|
@@ -154,10 +165,10 @@ class BBShortsView: UIView, BBNativeShortsViewDelegate {
|
|
|
154
165
|
optionsDict = dict
|
|
155
166
|
}
|
|
156
167
|
|
|
157
|
-
// Create the shorts view using the
|
|
158
|
-
//
|
|
168
|
+
// Create the shorts view using the container VC inside the nav controller
|
|
169
|
+
// so the native SDK's shelf tap can present modals via navigationController
|
|
159
170
|
shortsView = BBNativeShorts.createShortsView(
|
|
160
|
-
uiViewController:
|
|
171
|
+
uiViewController: containerVC,
|
|
161
172
|
frame: bounds,
|
|
162
173
|
jsonUrl: jsonUrl,
|
|
163
174
|
options: optionsDict
|
|
@@ -171,14 +182,15 @@ class BBShortsView: UIView, BBNativeShortsViewDelegate {
|
|
|
171
182
|
|
|
172
183
|
shorts.delegate = self
|
|
173
184
|
|
|
174
|
-
// Add
|
|
175
|
-
|
|
185
|
+
// Add shorts view inside the container VC's view so it sits within the
|
|
186
|
+
// navigation controller hierarchy (required for shelf modal presentation)
|
|
187
|
+
containerVC.view.addSubview(shorts)
|
|
176
188
|
shorts.translatesAutoresizingMaskIntoConstraints = false
|
|
177
189
|
NSLayoutConstraint.activate([
|
|
178
|
-
shorts.topAnchor.constraint(equalTo: topAnchor),
|
|
179
|
-
shorts.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
180
|
-
shorts.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
181
|
-
shorts.bottomAnchor.constraint(equalTo: bottomAnchor)
|
|
190
|
+
shorts.topAnchor.constraint(equalTo: containerVC.view.topAnchor),
|
|
191
|
+
shorts.leadingAnchor.constraint(equalTo: containerVC.view.leadingAnchor),
|
|
192
|
+
shorts.trailingAnchor.constraint(equalTo: containerVC.view.trailingAnchor),
|
|
193
|
+
shorts.bottomAnchor.constraint(equalTo: containerVC.view.bottomAnchor)
|
|
182
194
|
])
|
|
183
195
|
|
|
184
196
|
log("BBShortsView.setupShorts() completed")
|
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.22",
|
|
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",
|