@wscsports/blaze-rtn-sdk 1.18.0 → 1.20.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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/BlazeSdkModule.kt +109 -2
- package/android/src/main/java/com/blaze/rtnblazesdk/base/BaseWidgetView.kt +198 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/base/BlazeWidgetViewManager.kt +14 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactCommonMerger.kt +41 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactLayoutMerger.kt +16 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactMomentPlayerStyleMerger.kt +5 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactMomentsPlayerStyle.kt +8 -3
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactPlayerTabsStyle.kt +47 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactPlayerTabsStyleMerger.kt +71 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactStoriesPlayerStyleMerger.kt +5 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactStoryPlayerStyle.kt +6 -2
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactVideosPlayerStyle.kt +5 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactVideosPlayerStyleMerger.kt +5 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactWidgetCommon.kt +17 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactWidgetLayout.kt +9 -2
- package/android/src/main/java/com/blaze/rtnblazesdk/events/MomentsContainerTabsEvent.kt +59 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/events/SdkModuleJsEvent.kt +12 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/events/WidgetShareClickedEvent.kt +31 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsGridView.kt +63 -12
- package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsGridViewManager.kt +2 -4
- package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsRowView.kt +64 -13
- package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsRowViewManager.kt +2 -4
- package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsWidgetViewManager.kt +86 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/stories/BlazeStoriesGridView.kt +5 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/stories/BlazeStoriesRowView.kt +5 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/utils/DataSourceTypeExtractUtils.kt +25 -3
- package/android/src/main/java/com/blaze/rtnblazesdk/utils/EventParamsBuilder.kt +63 -11
- package/android/src/main/java/com/blaze/rtnblazesdk/utils/GeneralExtractExtensions.kt +9 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/utils/MapExtensions.kt +6 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/utils/MomentsWidgetTabsConfigurationExtractUtils.kt +109 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/utils/PlaybackConfigurationExtractUtils.kt +74 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosGridView.kt +5 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosGridViewManager.kt +1 -2
- package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosRowView.kt +5 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosRowViewManager.kt +1 -2
- package/android/src/main/java/com/blaze/rtnblazesdk/videos/BlazeVideosWidgetViewManager.kt +28 -0
- package/blaze-rtn-sdk.podspec +2 -1
- package/ios/Sources/BlazeMomentsGridWidgetManager/BlazeMomentsGridWidgetManager.m +2 -0
- package/ios/Sources/BlazeMomentsRowWidgetManager/BlazeMomentsRowWidgetManager.m +2 -0
- package/ios/Sources/BlazeNativeSDKModule/BlazeNativeSDKModule.m +18 -0
- package/ios/Sources/BlazeNativeSDKModule/BlazeNativeSDKModule.swift +84 -9
- package/ios/Sources/BlazeNativeSDKModule/RTNBlazeSdkModule+AppEvents.swift +27 -2
- package/ios/Sources/BlazeVideosGridWidgetManager/BlazeVideosGridWidgetManager.m +1 -0
- package/ios/Sources/BlazeVideosRowWidgetManager/BlazeVideosRowWidgetManager.m +1 -0
- package/ios/Sources/LayoutCustomization/MomentsPlayer/BlazeReactMomentsPlayerStyle.swift +5 -0
- package/ios/Sources/LayoutCustomization/MomentsPlayer/BlazeReactMomentsPlayerStyleMerger.swift +6 -1
- package/ios/Sources/LayoutCustomization/Shared/SharedStyleModels.swift +13 -0
- package/ios/Sources/LayoutCustomization/Shared/SharedStyleModelsMerger.swift +45 -0
- package/ios/Sources/LayoutCustomization/StoriesPlayer/BlazeReactStoriesPlayerStyle.swift +4 -0
- package/ios/Sources/LayoutCustomization/StoriesPlayer/BlazeReactStoriesPlayerStyleMerger.swift +5 -1
- package/ios/Sources/LayoutCustomization/TabsStyle/BlazeReactPlayerTabsStyle.swift +48 -0
- package/ios/Sources/LayoutCustomization/TabsStyle/BlazeReactPlayerTabsStyleMerger.swift +78 -0
- package/ios/Sources/LayoutCustomization/VideoPlayer/BlazeReactVideosPlayerStyle.swift +67 -0
- package/ios/Sources/LayoutCustomization/VideoPlayer/BlazeReactVideosPlayerStyleMerger.swift +87 -1
- package/ios/Sources/LayoutCustomization/WidgetLayout/BlazeReactWidgetLayout.swift +6 -0
- package/ios/Sources/LayoutCustomization/WidgetLayout/BlazeReactWidgetLayoutMerger.swift +12 -0
- package/ios/Sources/Utils/BlazeReactNumberParsing.swift +13 -0
- package/ios/Sources/Utils/BlazeReactParamsParser.swift +93 -8
- package/ios/Sources/Utils/EventParamsBuilder.swift +43 -2
- package/ios/Sources/Utils/MomentsWidgetTabsConfigurationExtractUtils.swift +106 -0
- package/ios/Sources/Utils/PlaybackConfigurationExtractUtils.swift +50 -4
- package/ios/Sources/Widgets/Base/BlazeWidgetBase.swift +275 -39
- package/ios/Sources/Widgets/Base/BlazeWidgetBaseProtocol.swift +12 -2
- package/ios/Sources/Widgets/Base/BlazeWidgetViewManagerBase.h +31 -7
- package/ios/Sources/Widgets/Base/BlazeWidgetViewManagerBase.swift +42 -2
- package/ios/Sources/Widgets/BlazeMomentsGridWidget.swift +17 -18
- package/ios/Sources/Widgets/BlazeMomentsRowWidget.swift +18 -18
- package/ios/Sources/Widgets/BlazeStoriesGridWidget.swift +5 -10
- package/ios/Sources/Widgets/BlazeStoriesRowWidget.swift +5 -10
- package/ios/Sources/Widgets/BlazeVideosGridWidget.swift +7 -17
- package/ios/Sources/Widgets/BlazeVideosRowWidget.swift +8 -17
- package/lib/commonjs/NativeBlazeSdk.js +12 -0
- package/lib/commonjs/NativeBlazeSdk.js.map +1 -1
- package/lib/commonjs/classes/base-player-delegate.js +37 -1
- package/lib/commonjs/classes/base-player-delegate.js.map +1 -1
- package/lib/commonjs/classes/entry-point-delegate.js +11 -0
- package/lib/commonjs/classes/entry-point-delegate.js.map +1 -1
- package/lib/commonjs/classes/player-container-tabs-delegate.js +6 -0
- package/lib/commonjs/classes/player-container-tabs-delegate.js.map +1 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/captions-style.js +6 -0
- package/lib/commonjs/interfaces/captions-style.js.map +1 -0
- package/lib/commonjs/interfaces/index.js +33 -0
- package/lib/commonjs/interfaces/index.js.map +1 -1
- package/lib/commonjs/interfaces/moments-widget-tabs-configuration.js +6 -0
- package/lib/commonjs/interfaces/moments-widget-tabs-configuration.js.map +1 -0
- package/lib/commonjs/interfaces/player-sound-state.js +2 -0
- package/lib/commonjs/interfaces/player-sound-state.js.map +1 -0
- package/lib/commonjs/interfaces/stories-playback-configuration.js +2 -0
- package/lib/commonjs/interfaces/stories-playback-configuration.js.map +1 -0
- package/lib/commonjs/interfaces/videos-filter-params.interface.js +2 -0
- package/lib/commonjs/interfaces/videos-filter-params.interface.js.map +1 -0
- package/lib/commonjs/widgets/BlazeBaseWidgetComponent.js +70 -0
- package/lib/commonjs/widgets/BlazeBaseWidgetComponent.js.map +1 -1
- package/lib/commonjs/widgets/BlazeMomentsGridView.js +2 -2
- package/lib/commonjs/widgets/BlazeMomentsGridView.js.map +1 -1
- package/lib/commonjs/widgets/BlazeMomentsRowView.js +2 -2
- package/lib/commonjs/widgets/BlazeMomentsRowView.js.map +1 -1
- package/lib/commonjs/widgets/BlazeMomentsTabsWidgetView.js +38 -0
- package/lib/commonjs/widgets/BlazeMomentsTabsWidgetView.js.map +1 -0
- package/lib/module/NativeBlazeSdk.js +12 -0
- package/lib/module/NativeBlazeSdk.js.map +1 -1
- package/lib/module/classes/base-player-delegate.js +37 -1
- package/lib/module/classes/base-player-delegate.js.map +1 -1
- package/lib/module/classes/entry-point-delegate.js +11 -0
- package/lib/module/classes/entry-point-delegate.js.map +1 -1
- package/lib/module/classes/player-container-tabs-delegate.js +2 -0
- package/lib/module/classes/player-container-tabs-delegate.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/captions-style.js +2 -0
- package/lib/module/interfaces/captions-style.js.map +1 -0
- package/lib/module/interfaces/index.js +3 -0
- package/lib/module/interfaces/index.js.map +1 -1
- package/lib/module/interfaces/moments-widget-tabs-configuration.js +2 -0
- package/lib/module/interfaces/moments-widget-tabs-configuration.js.map +1 -0
- package/lib/module/interfaces/player-sound-state.js +2 -0
- package/lib/module/interfaces/player-sound-state.js.map +1 -0
- package/lib/module/interfaces/stories-playback-configuration.js +2 -0
- package/lib/module/interfaces/stories-playback-configuration.js.map +1 -0
- package/lib/module/interfaces/videos-filter-params.interface.js +2 -0
- package/lib/module/interfaces/videos-filter-params.interface.js.map +1 -0
- package/lib/module/widgets/BlazeBaseWidgetComponent.js +70 -0
- package/lib/module/widgets/BlazeBaseWidgetComponent.js.map +1 -1
- package/lib/module/widgets/BlazeMomentsGridView.js +2 -2
- package/lib/module/widgets/BlazeMomentsGridView.js.map +1 -1
- package/lib/module/widgets/BlazeMomentsRowView.js +2 -2
- package/lib/module/widgets/BlazeMomentsRowView.js.map +1 -1
- package/lib/module/widgets/BlazeMomentsTabsWidgetView.js +32 -0
- package/lib/module/widgets/BlazeMomentsTabsWidgetView.js.map +1 -0
- package/lib/typescript/NativeBlazeSdk.d.ts +6 -0
- package/lib/typescript/NativeBlazeSdk.d.ts.map +1 -1
- package/lib/typescript/classes/base-player-delegate.d.ts +24 -0
- package/lib/typescript/classes/base-player-delegate.d.ts.map +1 -1
- package/lib/typescript/classes/blaze-recommendations-type.d.ts +4 -3
- package/lib/typescript/classes/blaze-recommendations-type.d.ts.map +1 -1
- package/lib/typescript/classes/entry-point-delegate.d.ts +1 -0
- package/lib/typescript/classes/entry-point-delegate.d.ts.map +1 -1
- package/lib/typescript/classes/player-container-tabs-delegate.d.ts +18 -0
- package/lib/typescript/classes/player-container-tabs-delegate.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +4 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/interfaces/actions-options.interface.d.ts +8 -0
- package/lib/typescript/interfaces/actions-options.interface.d.ts.map +1 -1
- package/lib/typescript/interfaces/captions-style.d.ts +33 -0
- package/lib/typescript/interfaces/captions-style.d.ts.map +1 -0
- package/lib/typescript/interfaces/index.d.ts +3 -0
- package/lib/typescript/interfaces/index.d.ts.map +1 -1
- package/lib/typescript/interfaces/init-options.interface.d.ts +2 -0
- package/lib/typescript/interfaces/init-options.interface.d.ts.map +1 -1
- package/lib/typescript/interfaces/moments-playback-configuration.d.ts +7 -0
- package/lib/typescript/interfaces/moments-playback-configuration.d.ts.map +1 -1
- package/lib/typescript/interfaces/moments-player-style.d.ts +21 -1
- package/lib/typescript/interfaces/moments-player-style.d.ts.map +1 -1
- package/lib/typescript/interfaces/moments-widget-tabs-configuration.d.ts +120 -0
- package/lib/typescript/interfaces/moments-widget-tabs-configuration.d.ts.map +1 -0
- package/lib/typescript/interfaces/player-sound-state.d.ts +12 -0
- package/lib/typescript/interfaces/player-sound-state.d.ts.map +1 -0
- package/lib/typescript/interfaces/stories-playback-configuration.d.ts +28 -0
- package/lib/typescript/interfaces/stories-playback-configuration.d.ts.map +1 -0
- package/lib/typescript/interfaces/stories-player-style.d.ts +15 -1
- package/lib/typescript/interfaces/stories-player-style.d.ts.map +1 -1
- package/lib/typescript/interfaces/videos-filter-params.interface.d.ts +17 -0
- package/lib/typescript/interfaces/videos-filter-params.interface.d.ts.map +1 -0
- package/lib/typescript/interfaces/videos-playback-configuration.d.ts +12 -1
- package/lib/typescript/interfaces/videos-playback-configuration.d.ts.map +1 -1
- package/lib/typescript/interfaces/videos-player-style.d.ts +96 -1
- package/lib/typescript/interfaces/videos-player-style.d.ts.map +1 -1
- package/lib/typescript/interfaces/widget-layout.interface.d.ts +13 -0
- package/lib/typescript/interfaces/widget-layout.interface.d.ts.map +1 -1
- package/lib/typescript/interfaces/widgets-props.interface.d.ts +34 -1
- package/lib/typescript/interfaces/widgets-props.interface.d.ts.map +1 -1
- package/lib/typescript/shared/BlazeAsyncBridge.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeBaseWidgetComponent.d.ts +12 -0
- package/lib/typescript/widgets/BlazeBaseWidgetComponent.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeBaseWidgetViewProps.d.ts +68 -3
- package/lib/typescript/widgets/BlazeBaseWidgetViewProps.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeMomentsGridView.d.ts +3 -4
- package/lib/typescript/widgets/BlazeMomentsGridView.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeMomentsRowView.d.ts +3 -4
- package/lib/typescript/widgets/BlazeMomentsRowView.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeMomentsTabsWidgetView.d.ts +9 -0
- package/lib/typescript/widgets/BlazeMomentsTabsWidgetView.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/NativeBlazeSdk.tsx +26 -0
- package/src/classes/base-player-delegate.tsx +61 -2
- package/src/classes/blaze-recommendations-type.tsx +4 -4
- package/src/classes/entry-point-delegate.tsx +19 -1
- package/src/classes/player-container-tabs-delegate.tsx +19 -0
- package/src/index.tsx +15 -1
- package/src/interfaces/actions-options.interface.tsx +8 -0
- package/src/interfaces/captions-style.tsx +43 -0
- package/src/interfaces/index.tsx +3 -0
- package/src/interfaces/init-options.interface.tsx +7 -0
- package/src/interfaces/moments-playback-configuration.tsx +8 -0
- package/src/interfaces/moments-player-style.tsx +22 -0
- package/src/interfaces/moments-widget-tabs-configuration.tsx +134 -0
- package/src/interfaces/player-sound-state.tsx +11 -0
- package/src/interfaces/stories-playback-configuration.tsx +29 -0
- package/src/interfaces/stories-player-style.tsx +16 -0
- package/src/interfaces/videos-filter-params.interface.tsx +19 -0
- package/src/interfaces/videos-playback-configuration.tsx +13 -1
- package/src/interfaces/videos-player-style.tsx +110 -1
- package/src/interfaces/widget-layout.interface.tsx +14 -0
- package/src/interfaces/widgets-props.interface.tsx +41 -0
- package/src/widgets/BlazeBaseWidgetComponent.tsx +115 -0
- package/src/widgets/BlazeBaseWidgetViewProps.tsx +79 -2
- package/src/widgets/BlazeMomentsGridView.tsx +10 -14
- package/src/widgets/BlazeMomentsRowView.tsx +13 -17
- package/src/widgets/BlazeMomentsTabsWidgetView.tsx +62 -0
package/android/build.gradle
CHANGED
|
@@ -16,6 +16,7 @@ import com.blaze.blazesdk.delegates.models.BlazePlaybackModificationResponse
|
|
|
16
16
|
import com.blaze.blazesdk.style.shared.models.BlazePlayerCustomActionButtonParams
|
|
17
17
|
import com.blaze.blazesdk.delegates.models.BlazePlayerEvent
|
|
18
18
|
import com.blaze.blazesdk.delegates.models.BlazePlayerType
|
|
19
|
+
import com.blaze.blazesdk.delegates.models.BlazeShareParams
|
|
19
20
|
import com.blaze.blazesdk.follow.models.BlazeFollowEntity
|
|
20
21
|
import com.blaze.blazesdk.external_modules.BlazeExternalModulesBinder
|
|
21
22
|
import com.blaze.blazesdk.features.moments.models.configuration.BlazeMomentsLoopBehavior
|
|
@@ -25,15 +26,20 @@ import com.blaze.blazesdk.features.shared.models.ui_shared.BlazeLinkActionHandle
|
|
|
25
26
|
import com.blaze.blazesdk.prefetch.models.BlazeCachingLevel
|
|
26
27
|
import com.blaze.blazesdk.shared.BlazeSDK
|
|
27
28
|
import com.blaze.blazesdk.shared.models.BlazeEntryPointTriggerSource
|
|
29
|
+
import com.blaze.blazesdk.shared.models.BlazeLayoutDirection
|
|
30
|
+
import com.blaze.blazesdk.shared.models.BlazePlayerSoundState
|
|
28
31
|
import com.blaze.blazesdk.shared.results.BlazeResult
|
|
29
32
|
import com.blaze.rtnblazesdk.events.SdkModuleJsEvent
|
|
30
33
|
import com.blaze.rtnblazesdk.shared.blazeAsyncBridge
|
|
31
34
|
import com.blaze.rtnblazesdk.shared.callJSMethod
|
|
32
35
|
import com.blaze.rtnblazesdk.utils.extractCachingLevel
|
|
36
|
+
import com.blaze.rtnblazesdk.utils.extractLayoutDirection
|
|
33
37
|
import com.blaze.rtnblazesdk.utils.extractDataSource
|
|
34
38
|
import com.blaze.rtnblazesdk.utils.extractMomentsPlayerStyle
|
|
35
39
|
import com.blaze.rtnblazesdk.utils.extractStoriesPlayerStyle
|
|
36
40
|
import com.blaze.rtnblazesdk.utils.extractMomentsPlaybackConfiguration
|
|
41
|
+
import com.blaze.rtnblazesdk.utils.extractStoriesPlaybackConfiguration
|
|
42
|
+
import com.blaze.rtnblazesdk.utils.extractVideosFilterParams
|
|
37
43
|
import com.blaze.rtnblazesdk.utils.extractVideosPlaybackConfiguration
|
|
38
44
|
import com.blaze.rtnblazesdk.utils.extractVideosPlayerStyle
|
|
39
45
|
import com.blaze.rtnblazesdk.utils.getBooleanOrNull
|
|
@@ -161,6 +167,17 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
161
167
|
sendJsEvent(event)
|
|
162
168
|
}
|
|
163
169
|
|
|
170
|
+
override fun onShareClicked(
|
|
171
|
+
playerType: BlazePlayerType,
|
|
172
|
+
sourceId: String?,
|
|
173
|
+
shareParams: BlazeShareParams
|
|
174
|
+
): String? {
|
|
175
|
+
val event = SdkModuleJsEvent.ShareClicked(playerType, sourceId, shareParams)
|
|
176
|
+
sendJsEvent(event)
|
|
177
|
+
// Observer-only: not currently supported for bridging out to React side (see plan.md ## Decisions).
|
|
178
|
+
return null
|
|
179
|
+
}
|
|
180
|
+
|
|
164
181
|
override fun onReadStatusChanged(
|
|
165
182
|
playerType: BlazePlayerType,
|
|
166
183
|
sourceId: String?,
|
|
@@ -221,12 +238,15 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
221
238
|
val cachingLevel = options.extractCachingLevel() ?: BlazeCachingLevel.DEFAULT
|
|
222
239
|
BlazeSdkModuleRepo.cachingLevel = cachingLevel
|
|
223
240
|
|
|
241
|
+
val forceLayoutDirection = options.extractLayoutDirection()
|
|
242
|
+
|
|
224
243
|
BlazeSDK.init(
|
|
225
244
|
apiKey = options.getString(KEY_INIT_API_KEY)!!,
|
|
226
245
|
externalUserId = options.getString(KEY_INIT_EXTERNAL_USER_ID),
|
|
227
246
|
geoLocation = options.getString(KEY_INIT_GEO_LOCATION),
|
|
228
247
|
cachingSize = options.getInt(KEY_INIT_CACHING_SIZE),
|
|
229
248
|
cachingLevel = cachingLevel,
|
|
249
|
+
forceLayoutDirection = forceLayoutDirection,
|
|
230
250
|
completionBlock = {
|
|
231
251
|
promise.resolve(BlazeResult.Success(true).toString())
|
|
232
252
|
},
|
|
@@ -264,6 +284,10 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
264
284
|
return getString(KEY_INIT_CACHING_LEVEL)?.extractCachingLevel()
|
|
265
285
|
}
|
|
266
286
|
|
|
287
|
+
private fun ReadableMap.extractLayoutDirection(): BlazeLayoutDirection? {
|
|
288
|
+
return getString(KEY_INIT_FORCE_LAYOUT_DIRECTION)?.extractLayoutDirection()
|
|
289
|
+
}
|
|
290
|
+
|
|
267
291
|
private fun setAppOverrideCtaHandling(options: ReadableMap) {
|
|
268
292
|
// getBoolean can throw exception while getString will return null if no such key
|
|
269
293
|
try {
|
|
@@ -292,10 +316,14 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
292
316
|
|
|
293
317
|
val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
|
|
294
318
|
?: BlazeEntryPointTriggerSource.ENTRYPOINT
|
|
319
|
+
val playbackConfiguration = options.getMap(KEY_ENTRY_POINT_PLAYBACK_CONFIGURATION)
|
|
320
|
+
.extractStoriesPlaybackConfiguration()
|
|
321
|
+
?: BlazeSDK.getDefaultStoriesPlaybackConfiguration()
|
|
295
322
|
BlazeSDK.playStory(
|
|
296
323
|
storyId = storyId,
|
|
297
324
|
pageId = pageId,
|
|
298
325
|
storyPlayerStyle = playerStyle,
|
|
326
|
+
playbackConfiguration = playbackConfiguration,
|
|
299
327
|
triggerSource = triggerSource
|
|
300
328
|
) { result ->
|
|
301
329
|
promise.handleResult(result)
|
|
@@ -320,10 +348,14 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
320
348
|
val triggerSource = options.getString("triggerSource")?.asEntryPointTriggerSource
|
|
321
349
|
?: BlazeEntryPointTriggerSource.ENTRYPOINT
|
|
322
350
|
val shouldOrderContentByReadStatus = options.getBooleanOrNull("shouldOrderContentByReadStatus") ?: true
|
|
351
|
+
val playbackConfiguration = options.getMap(KEY_ENTRY_POINT_PLAYBACK_CONFIGURATION)
|
|
352
|
+
.extractStoriesPlaybackConfiguration()
|
|
353
|
+
?: BlazeSDK.getDefaultStoriesPlaybackConfiguration()
|
|
323
354
|
BlazeSDK.playStories(
|
|
324
355
|
dataSource = dataSource,
|
|
325
356
|
entryContentId = entryContentId,
|
|
326
357
|
storyPlayerStyle = playerStyle,
|
|
358
|
+
playbackConfiguration = playbackConfiguration,
|
|
327
359
|
triggerSource = triggerSource,
|
|
328
360
|
shouldOrderContentByReadStatus = shouldOrderContentByReadStatus
|
|
329
361
|
) { result ->
|
|
@@ -499,13 +531,16 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
499
531
|
val playbackConfiguration = options.getMap(KEY_ENTRY_POINT_PLAYBACK_CONFIGURATION)
|
|
500
532
|
.extractVideosPlaybackConfiguration()
|
|
501
533
|
?: BlazeSDK.getDefaultVideosPlaybackConfiguration()
|
|
534
|
+
val videosFilterParams = options.getMap(KEY_ENTRY_POINT_VIDEOS_FILTER_PARAMS)
|
|
535
|
+
.extractVideosFilterParams()
|
|
502
536
|
BlazeSDK.playVideos(
|
|
503
537
|
dataSource = dataSource,
|
|
504
538
|
entryContentId = entryContentId,
|
|
505
539
|
videosPlayerStyle = playerStyle,
|
|
506
540
|
triggerSource = triggerSource,
|
|
507
541
|
shouldOrderContentByReadStatus = shouldOrderContentByReadStatus,
|
|
508
|
-
playbackConfiguration = playbackConfiguration
|
|
542
|
+
playbackConfiguration = playbackConfiguration,
|
|
543
|
+
videosFilterParams = videosFilterParams
|
|
509
544
|
) { result ->
|
|
510
545
|
promise.handleResult(result)
|
|
511
546
|
}
|
|
@@ -523,7 +558,13 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
523
558
|
return
|
|
524
559
|
}
|
|
525
560
|
val entryContentId = options.getString(KEY_ENTRY_POINT_CONTENT_ID)
|
|
526
|
-
|
|
561
|
+
val videosFilterParams = options.getMap(KEY_ENTRY_POINT_VIDEOS_FILTER_PARAMS)
|
|
562
|
+
.extractVideosFilterParams()
|
|
563
|
+
BlazeSDK.prepareVideos(
|
|
564
|
+
dataSource = dataSource,
|
|
565
|
+
entryContentId = entryContentId,
|
|
566
|
+
videosFilterParams = videosFilterParams
|
|
567
|
+
) { result ->
|
|
527
568
|
promise.handleResult(result)
|
|
528
569
|
}
|
|
529
570
|
} catch (e: Exception) {
|
|
@@ -558,6 +599,7 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
558
599
|
putMap("pipConfiguration", Arguments.createMap().apply {
|
|
559
600
|
putBoolean("enterPipOnAppBackground", config.pip.enterPipOnAppBackground)
|
|
560
601
|
})
|
|
602
|
+
putDouble("bufferingSpinnerDelayMs", config.bufferingSpinnerDelayMs.toDouble())
|
|
561
603
|
}
|
|
562
604
|
promise.resolve(result)
|
|
563
605
|
} catch (e: Exception) {
|
|
@@ -600,6 +642,40 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
600
642
|
}
|
|
601
643
|
}
|
|
602
644
|
putMap("loopBehavior", loopBehavior)
|
|
645
|
+
putDouble("bufferingSpinnerDelayMs", config.bufferingSpinnerDelayMs.toDouble())
|
|
646
|
+
}
|
|
647
|
+
promise.resolve(result)
|
|
648
|
+
} catch (e: Exception) {
|
|
649
|
+
promise.rejectWith(e.toString())
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
@ReactMethod
|
|
654
|
+
@DoNotStrip
|
|
655
|
+
fun setDefaultStoriesPlaybackConfiguration(config: ReadableMap, promise: Promise) {
|
|
656
|
+
try {
|
|
657
|
+
val playbackConfig = (config as ReadableMap?).extractStoriesPlaybackConfiguration()
|
|
658
|
+
?: run {
|
|
659
|
+
promise.rejectWith("Invalid stories playback configuration")
|
|
660
|
+
return
|
|
661
|
+
}
|
|
662
|
+
BlazeSDK.setDefaultStoriesPlaybackConfiguration(playbackConfig)
|
|
663
|
+
promise.resolve(null)
|
|
664
|
+
} catch (e: Exception) {
|
|
665
|
+
promise.rejectWith(e.toString())
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
@ReactMethod
|
|
670
|
+
@DoNotStrip
|
|
671
|
+
fun getDefaultStoriesPlaybackConfiguration(promise: Promise) {
|
|
672
|
+
try {
|
|
673
|
+
val config = BlazeSDK.getDefaultStoriesPlaybackConfiguration()
|
|
674
|
+
val result = Arguments.createMap().apply {
|
|
675
|
+
putDouble("bufferingSpinnerDelayMs", config.bufferingSpinnerDelayMs.toDouble())
|
|
676
|
+
putMap("ads", Arguments.createMap().apply {
|
|
677
|
+
putBoolean("enablePreroll", config.ads.enablePreroll)
|
|
678
|
+
})
|
|
603
679
|
}
|
|
604
680
|
promise.resolve(result)
|
|
605
681
|
} catch (e: Exception) {
|
|
@@ -607,6 +683,35 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
607
683
|
}
|
|
608
684
|
}
|
|
609
685
|
|
|
686
|
+
@ReactMethod
|
|
687
|
+
@DoNotStrip
|
|
688
|
+
fun setPlayerSoundState(state: String, promise: Promise) {
|
|
689
|
+
try {
|
|
690
|
+
val nativeState = when (state.lowercase()) {
|
|
691
|
+
"mute" -> BlazePlayerSoundState.MUTE
|
|
692
|
+
"unmute" -> BlazePlayerSoundState.UNMUTE
|
|
693
|
+
else -> {
|
|
694
|
+
promise.rejectWith("Invalid BlazePlayerSoundState '$state'. Expected 'mute' or 'unmute'.")
|
|
695
|
+
return
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
BlazeSDK.setPlayerSoundState(nativeState)
|
|
699
|
+
promise.resolve(null)
|
|
700
|
+
} catch (e: Exception) {
|
|
701
|
+
promise.rejectWith(e.toString())
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
@ReactMethod
|
|
706
|
+
@DoNotStrip
|
|
707
|
+
fun isMuted(promise: Promise) {
|
|
708
|
+
try {
|
|
709
|
+
promise.resolve(BlazeSDK.isMuted)
|
|
710
|
+
} catch (e: Exception) {
|
|
711
|
+
promise.rejectWith(e.toString())
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
610
715
|
@ReactMethod
|
|
611
716
|
@DoNotStrip
|
|
612
717
|
fun dismissPlayer(promise: Promise) {
|
|
@@ -806,6 +911,7 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
806
911
|
const val KEY_INIT_GEO_LOCATION = "geoLocation"
|
|
807
912
|
const val KEY_INIT_CACHING_SIZE = "cachingSize"
|
|
808
913
|
const val KEY_INIT_CACHING_LEVEL = "cachingLevel"
|
|
914
|
+
const val KEY_INIT_FORCE_LAYOUT_DIRECTION = "forceLayoutDirection"
|
|
809
915
|
const val KEY_INIT_APP_OVERRIDES_CTA_HANDLING = "appOverridesCTAHandling"
|
|
810
916
|
const val KEY_INIT_DEFAULT_STORY_PLAYER_STYLE = "defaultStoryPlayerStyle"
|
|
811
917
|
const val KEY_INIT_DEFAULT_MOMENT_PLAYER_STYLE = "defaultMomentsPlayerStyle"
|
|
@@ -819,6 +925,7 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
819
925
|
const val KEY_ENTRY_POINT_SOURCE_ID = "sourceId"
|
|
820
926
|
const val KEY_ENTRY_POINT_CONTENT_ID = "entryContentId"
|
|
821
927
|
const val KEY_ENTRY_POINT_PLAYBACK_CONFIGURATION = "playbackConfiguration"
|
|
928
|
+
const val KEY_ENTRY_POINT_VIDEOS_FILTER_PARAMS = "videosFilterParams"
|
|
822
929
|
private const val PLAYBACK_MODIFICATION_METHOD_NAME = "Blaze.GlobalDelegate.playbackModificationHandler"
|
|
823
930
|
}
|
|
824
931
|
|
|
@@ -6,10 +6,12 @@ import android.util.AttributeSet
|
|
|
6
6
|
import android.view.View
|
|
7
7
|
import androidx.core.view.doOnPreDraw
|
|
8
8
|
import com.blaze.blazesdk.data_source.BlazeDataSourceType
|
|
9
|
+
import com.blaze.blazesdk.delegates.BlazePlayerContainerTabsDelegate
|
|
9
10
|
import com.blaze.blazesdk.delegates.BlazeWidgetDelegate
|
|
10
11
|
import com.blaze.blazesdk.delegates.models.BlazeCTAActionType
|
|
11
12
|
import com.blaze.blazesdk.delegates.models.BlazePlayerEvent
|
|
12
13
|
import com.blaze.blazesdk.delegates.models.BlazePlayerType
|
|
14
|
+
import com.blaze.blazesdk.delegates.models.BlazeShareParams
|
|
13
15
|
import com.blaze.blazesdk.extentions.blazeDeepCopy
|
|
14
16
|
import com.blaze.blazesdk.features.shared.models.ui_shared.BlazeLinkActionHandleType
|
|
15
17
|
import com.blaze.blazesdk.prefetch.models.BlazeCachingLevel
|
|
@@ -21,6 +23,8 @@ import com.blaze.rtnblazesdk.BlazeSdkModuleRepo
|
|
|
21
23
|
import com.blaze.rtnblazesdk.customization.BlazeReactWidgetItemCustomMapping
|
|
22
24
|
import com.blaze.rtnblazesdk.customization.BlazeReactWidgetItemStyleOverrides
|
|
23
25
|
import com.blaze.rtnblazesdk.customization.mergedWith
|
|
26
|
+
import com.blaze.rtnblazesdk.events.MomentsContainerTabsEvent
|
|
27
|
+
import com.blaze.rtnblazesdk.events.MomentsContainerTabsEventNames
|
|
24
28
|
import com.blaze.rtnblazesdk.events.WidgetCTAClickEvent
|
|
25
29
|
import com.blaze.rtnblazesdk.events.WidgetDataLoadCompletedEvent
|
|
26
30
|
import com.blaze.rtnblazesdk.events.WidgetDataLoadStartedEvent
|
|
@@ -31,7 +35,9 @@ import com.blaze.rtnblazesdk.events.WidgetOnPlayerEventTriggered
|
|
|
31
35
|
import com.blaze.rtnblazesdk.events.WidgetOnTriggerPlayerBodyTextLinkEvent
|
|
32
36
|
import com.blaze.rtnblazesdk.events.WidgetPlayerDidAppearEvent
|
|
33
37
|
import com.blaze.rtnblazesdk.events.WidgetPlayerDismissedEvent
|
|
38
|
+
import com.blaze.rtnblazesdk.events.WidgetShareClickedEvent
|
|
34
39
|
import com.blaze.blazesdk.style.shared.models.BlazePlayerCustomActionButtonParams
|
|
40
|
+
import com.blaze.rtnblazesdk.utils.EventParamsBuilder
|
|
35
41
|
import com.blaze.rtnblazesdk.utils.extractCachingLevel
|
|
36
42
|
import com.blaze.rtnblazesdk.utils.extractDataSource
|
|
37
43
|
import com.blaze.rtnblazesdk.utils.getBooleanOrNull
|
|
@@ -41,6 +47,7 @@ import com.blaze.rtnblazesdk.utils.parsing.toObject
|
|
|
41
47
|
import com.facebook.react.bridge.ReactContext
|
|
42
48
|
import com.facebook.react.bridge.ReadableArray
|
|
43
49
|
import com.facebook.react.bridge.ReadableMap
|
|
50
|
+
import com.facebook.react.bridge.WritableMap
|
|
44
51
|
import com.facebook.react.uimanager.ReactStylesDiffMap
|
|
45
52
|
import com.facebook.react.uimanager.UIManagerHelper
|
|
46
53
|
import com.facebook.react.uimanager.events.Event
|
|
@@ -56,6 +63,20 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
56
63
|
|
|
57
64
|
private var dataSourceType: BlazeDataSourceType? = null
|
|
58
65
|
var reactCachingLevel: String? = null
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Read once by [callInitWidget] on the standard (non-tabs) initialization path — native has no
|
|
69
|
+
* runtime setter for this, so unlike most other props here, changing it after mount has no effect.
|
|
70
|
+
* Ignored on tabs-backed Moments widgets: the native tabs `initWidget` overload has no such
|
|
71
|
+
* parameter (hardcoded to `null` internally).
|
|
72
|
+
*/
|
|
73
|
+
var reactWidgetRemoteIdentifier: String? = null
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Developer-supplied override for the widget's native `widgetId`, read once per `callInitWidget`.
|
|
77
|
+
* When null, the auto-generated `"<Type>-<Row|Grid>: $id"` value is used.
|
|
78
|
+
*/
|
|
79
|
+
var reactWidgetId: String? = null
|
|
59
80
|
var perItemStyleOverridesReadableMap: ReadableMap? = null
|
|
60
81
|
var presetWidgetLayoutString: String? = null
|
|
61
82
|
var appOverridesCTAHandling: Boolean = false
|
|
@@ -65,6 +86,18 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
65
86
|
var nativeWidgetLayout: BlazeWidgetLayout? = null
|
|
66
87
|
var reactWidgetPlaybackConfigurationMap: ReadableMap? = null
|
|
67
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Moments-only: when set, the widget is initialized to launch a fullscreen tabs player on item
|
|
91
|
+
* tap. Exported to the bridge only by the Moments row/grid managers; ignored by Stories/Videos.
|
|
92
|
+
*/
|
|
93
|
+
var reactTabsContainerMap: ReadableMap? = null
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Videos-only: filter by content type (regular videos vs. live streams) and live-stream state.
|
|
97
|
+
* Exported to the bridge only by the Videos row/grid managers; ignored by Moments/Stories.
|
|
98
|
+
*/
|
|
99
|
+
var reactVideosFilterParamsMap: ReadableMap? = null
|
|
100
|
+
|
|
68
101
|
val cachingLevel: BlazeCachingLevel
|
|
69
102
|
get() = reactCachingLevel?.extractCachingLevel() ?: BlazeSdkModuleRepo.cachingLevel ?: BlazeCachingLevel.DEFAULT
|
|
70
103
|
|
|
@@ -201,8 +234,152 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
201
234
|
)
|
|
202
235
|
)
|
|
203
236
|
}
|
|
237
|
+
|
|
238
|
+
override fun onShareClicked(
|
|
239
|
+
playerType: BlazePlayerType,
|
|
240
|
+
sourceId: String?,
|
|
241
|
+
shareParams: BlazeShareParams
|
|
242
|
+
): String? {
|
|
243
|
+
dispatchEvent(
|
|
244
|
+
WidgetShareClickedEvent(
|
|
245
|
+
UIManagerHelper.getSurfaceId(context),
|
|
246
|
+
id,
|
|
247
|
+
playerType = playerType,
|
|
248
|
+
sourceId = sourceId,
|
|
249
|
+
shareParams = shareParams
|
|
250
|
+
)
|
|
251
|
+
)
|
|
252
|
+
// Observer-only: not currently supported for bridging out to React side (see plan.md ## Decisions).
|
|
253
|
+
return null
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Per-view delegate for the Moments "widget to tabs" fullscreen player. Passed to the native tabs
|
|
259
|
+
* configuration by the Moments row/grid views. Every callback is dispatched on this view's own
|
|
260
|
+
* event channel, so each widget reports to its own JS `momentsContainerTabsDelegate` — mirroring
|
|
261
|
+
* the per-instance [widgetDelegate].
|
|
262
|
+
*/
|
|
263
|
+
protected val containerTabsDelegate =
|
|
264
|
+
object : BlazePlayerContainerTabsDelegate {
|
|
265
|
+
override fun onDataLoadStarted(playerType: BlazePlayerType, sourceId: String?) {
|
|
266
|
+
dispatchTabsEvent(
|
|
267
|
+
MomentsContainerTabsEventNames.DATA_LOAD_STARTED,
|
|
268
|
+
EventParamsBuilder.buildDataLoadStartedParams(playerType, sourceId)
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
override fun onDataLoadComplete(
|
|
273
|
+
playerType: BlazePlayerType,
|
|
274
|
+
sourceId: String?,
|
|
275
|
+
itemsCount: Int,
|
|
276
|
+
result: BlazeResult<Unit>
|
|
277
|
+
) {
|
|
278
|
+
dispatchTabsEvent(
|
|
279
|
+
MomentsContainerTabsEventNames.DATA_LOAD_COMPLETE,
|
|
280
|
+
EventParamsBuilder.buildDataLoadCompletedParams(playerType, sourceId, itemsCount, result)
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
override fun onPlayerDidAppear(playerType: BlazePlayerType, sourceId: String?) {
|
|
285
|
+
dispatchTabsEvent(
|
|
286
|
+
MomentsContainerTabsEventNames.PLAYER_DID_APPEAR,
|
|
287
|
+
EventParamsBuilder.buildPlayerDidAppearParams(playerType, sourceId)
|
|
288
|
+
)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
override fun onPlayerDidDismiss(playerType: BlazePlayerType, sourceId: String?) {
|
|
292
|
+
dispatchTabsEvent(
|
|
293
|
+
MomentsContainerTabsEventNames.PLAYER_DID_DISMISS,
|
|
294
|
+
EventParamsBuilder.buildPlayerDidDismissParams(playerType, sourceId)
|
|
295
|
+
)
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
override fun onTriggerCTA(
|
|
299
|
+
playerType: BlazePlayerType,
|
|
300
|
+
sourceId: String?,
|
|
301
|
+
actionType: BlazeCTAActionType,
|
|
302
|
+
actionParam: String
|
|
303
|
+
): Boolean {
|
|
304
|
+
dispatchTabsEvent(
|
|
305
|
+
MomentsContainerTabsEventNames.TRIGGER_CTA,
|
|
306
|
+
EventParamsBuilder.buildTriggerCTAParams(playerType, sourceId, actionType, actionParam)
|
|
307
|
+
)
|
|
308
|
+
return appOverridesCTAHandling
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
override fun onTriggerPlayerBodyTextLink(
|
|
312
|
+
playerType: BlazePlayerType,
|
|
313
|
+
sourceId: String?,
|
|
314
|
+
actionParam: String
|
|
315
|
+
): BlazeLinkActionHandleType {
|
|
316
|
+
dispatchTabsEvent(
|
|
317
|
+
MomentsContainerTabsEventNames.TRIGGER_PLAYER_BODY_TEXT_LINK,
|
|
318
|
+
EventParamsBuilder.buildTriggerPlayerBodyTextLinkParams(playerType, sourceId, actionParam)
|
|
319
|
+
)
|
|
320
|
+
return BlazeLinkActionHandleType.DEEPLINK
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
override fun onPlayerEventTriggered(
|
|
324
|
+
playerType: BlazePlayerType,
|
|
325
|
+
sourceId: String?,
|
|
326
|
+
event: BlazePlayerEvent
|
|
327
|
+
) {
|
|
328
|
+
dispatchTabsEvent(
|
|
329
|
+
MomentsContainerTabsEventNames.PLAYER_EVENT_TRIGGERED,
|
|
330
|
+
EventParamsBuilder.buildPlayerEventTriggeredParams(playerType, sourceId, event)
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
override fun onTriggerCustomActionButton(
|
|
335
|
+
playerType: BlazePlayerType,
|
|
336
|
+
sourceId: String?,
|
|
337
|
+
customParams: BlazePlayerCustomActionButtonParams
|
|
338
|
+
) {
|
|
339
|
+
dispatchTabsEvent(
|
|
340
|
+
MomentsContainerTabsEventNames.TRIGGER_CUSTOM_ACTION_BUTTON,
|
|
341
|
+
EventParamsBuilder.buildTriggerCustomActionButtonParams(playerType, sourceId, customParams)
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
override fun onTabSelected(
|
|
346
|
+
playerType: BlazePlayerType,
|
|
347
|
+
sourceId: String?,
|
|
348
|
+
tabIndex: Int
|
|
349
|
+
) {
|
|
350
|
+
dispatchTabsEvent(
|
|
351
|
+
MomentsContainerTabsEventNames.TAB_SELECTED,
|
|
352
|
+
EventParamsBuilder.buildTabSelectedParams(playerType, sourceId, tabIndex)
|
|
353
|
+
)
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
override fun onShareClicked(
|
|
357
|
+
playerType: BlazePlayerType,
|
|
358
|
+
sourceId: String?,
|
|
359
|
+
shareParams: BlazeShareParams
|
|
360
|
+
): String? {
|
|
361
|
+
dispatchTabsEvent(
|
|
362
|
+
MomentsContainerTabsEventNames.SHARE_CLICKED,
|
|
363
|
+
EventParamsBuilder.buildShareClickedParams(playerType, sourceId, shareParams)
|
|
364
|
+
)
|
|
365
|
+
// Observer-only: not currently supported for bridging out to React side (see plan.md ## Decisions).
|
|
366
|
+
return null
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// `onSearchButtonClicked` (sync return) is intentionally left at its native default.
|
|
204
370
|
}
|
|
205
371
|
|
|
372
|
+
private fun dispatchTabsEvent(name: String, data: WritableMap) {
|
|
373
|
+
dispatchEvent(
|
|
374
|
+
MomentsContainerTabsEvent(
|
|
375
|
+
UIManagerHelper.getSurfaceId(context),
|
|
376
|
+
id,
|
|
377
|
+
name = name,
|
|
378
|
+
data = data,
|
|
379
|
+
)
|
|
380
|
+
)
|
|
381
|
+
}
|
|
382
|
+
|
|
206
383
|
abstract fun callInitWidget(dataSource: BlazeDataSourceType)
|
|
207
384
|
abstract fun createNewWidgetView(): View
|
|
208
385
|
abstract fun reloadData(isSilentRefresh: Boolean)
|
|
@@ -214,6 +391,19 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
214
391
|
abstract fun updateWidgetsUi()
|
|
215
392
|
abstract fun play()
|
|
216
393
|
|
|
394
|
+
/**
|
|
395
|
+
* Moments "widget to tabs" programmatic reload. No-op by default (Stories/Videos, and Moments
|
|
396
|
+
* widgets not in tabs mode); overridden by [com.blaze.rtnblazesdk.moments.BlazeMomentsRowView] /
|
|
397
|
+
* [com.blaze.rtnblazesdk.moments.BlazeMomentsGridView] to forward to their retained
|
|
398
|
+
* `BlazeMomentsWidgetTabsController`. Kept here (rather than as an interface Stories/Videos also
|
|
399
|
+
* implement) so the shared [BlazeWidgetViewManager.receiveCommand] dispatch has one call shape,
|
|
400
|
+
* while the Moments-only view managers are the only ones that actually register these commands.
|
|
401
|
+
*/
|
|
402
|
+
open fun reloadAllTabs() {}
|
|
403
|
+
open fun reloadNonActiveTabs() {}
|
|
404
|
+
open fun reloadTab(at: Int) {}
|
|
405
|
+
open fun reloadTabByContainerId(containerId: String) {}
|
|
406
|
+
|
|
217
407
|
override fun onHeightChanged(height: Int) {
|
|
218
408
|
dispatchEvent(
|
|
219
409
|
WidgetHeightChangedEvent(
|
|
@@ -247,13 +437,20 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
247
437
|
)
|
|
248
438
|
this.addView(view)
|
|
249
439
|
view.doOnPreDraw {
|
|
250
|
-
|
|
440
|
+
resolveInitialDataSource()?.let { sourceType ->
|
|
251
441
|
callInitWidget(sourceType)
|
|
252
442
|
}
|
|
253
443
|
}
|
|
254
444
|
}
|
|
255
445
|
}
|
|
256
446
|
|
|
447
|
+
/**
|
|
448
|
+
* The data source used to trigger [callInitWidget]. Defaults to the explicit `dataSource` prop.
|
|
449
|
+
* Moments overrides this so a tabs-backed widget initializes from its first tab even when no
|
|
450
|
+
* standalone `dataSource` prop is provided.
|
|
451
|
+
*/
|
|
452
|
+
protected open fun resolveInitialDataSource(): BlazeDataSourceType? = dataSourceType
|
|
453
|
+
|
|
257
454
|
private fun removeWidgetView() {
|
|
258
455
|
widgetView?.let {
|
|
259
456
|
removeView(widgetView)
|
|
@@ -11,6 +11,7 @@ import com.blaze.rtnblazesdk.events.WidgetOnPlayerEventTriggered
|
|
|
11
11
|
import com.blaze.rtnblazesdk.events.WidgetOnTriggerPlayerBodyTextLinkEvent
|
|
12
12
|
import com.blaze.rtnblazesdk.events.WidgetPlayerDidAppearEvent
|
|
13
13
|
import com.blaze.rtnblazesdk.events.WidgetPlayerDismissedEvent
|
|
14
|
+
import com.blaze.rtnblazesdk.events.WidgetShareClickedEvent
|
|
14
15
|
import com.blaze.rtnblazesdk.stories.BlazeStoriesGridView
|
|
15
16
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
16
17
|
import com.facebook.react.bridge.ReadableArray
|
|
@@ -44,6 +45,7 @@ abstract class BlazeWidgetViewManager<TWidget : BaseWidgetView>(
|
|
|
44
45
|
WidgetOnTriggerPlayerBodyTextLinkEvent.EVENT_NAME to mapOf(Pair(KEY_EVENT_REGISTRATION_NAME, "onTriggerPlayerBodyTextLinkInternal")),
|
|
45
46
|
WidgetOnPlayerEventTriggered.EVENT_NAME to mapOf(Pair(KEY_EVENT_REGISTRATION_NAME, "onPlayerEventTriggeredInternal")),
|
|
46
47
|
WidgetCustomActionButtonEvent.EVENT_NAME to mapOf(Pair(KEY_EVENT_REGISTRATION_NAME, "onTriggerCustomActionButtonInternal")),
|
|
48
|
+
WidgetShareClickedEvent.EVENT_NAME to mapOf(Pair(KEY_EVENT_REGISTRATION_NAME, "onShareClickedInternal")),
|
|
47
49
|
WidgetHeightChangedEvent.EVENT_NAME to mapOf(Pair(KEY_EVENT_REGISTRATION_NAME, "onHeightChangedInternal")),
|
|
48
50
|
)
|
|
49
51
|
return map
|
|
@@ -106,6 +108,18 @@ abstract class BlazeWidgetViewManager<TWidget : BaseWidgetView>(
|
|
|
106
108
|
view.reactWidgetLayoutStyleMap = value
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
@Keep
|
|
112
|
+
@ReactProp(name = "widgetRemoteIdentifier")
|
|
113
|
+
fun setWidgetRemoteIdentifier(view: TWidget, value: String?) {
|
|
114
|
+
view.reactWidgetRemoteIdentifier = value
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@Keep
|
|
118
|
+
@ReactProp(name = "widgetId")
|
|
119
|
+
fun setWidgetId(view: TWidget, value: String?) {
|
|
120
|
+
view.reactWidgetId = value
|
|
121
|
+
}
|
|
122
|
+
|
|
109
123
|
@Keep
|
|
110
124
|
@ReactProp(name = "shouldOrderWidgetByReadStatus")
|
|
111
125
|
fun setShouldOrderWidgetByReadStatus(view: TWidget, value: Boolean) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package com.blaze.rtnblazesdk.customization
|
|
2
2
|
|
|
3
|
+
import BlazeReactCaptionsPositioning
|
|
4
|
+
import BlazeReactCaptionsStyle
|
|
3
5
|
import BlazeReactFirstTimeSlideCTAStyle
|
|
4
6
|
import BlazeReactFirstTimeSlideInstructionStyle
|
|
5
7
|
import BlazeReactFirstTimeSlideTextStyle
|
|
@@ -10,6 +12,10 @@ import BlazeReactPlayerButtonStyle
|
|
|
10
12
|
import BlazeReactSeekBarStyle
|
|
11
13
|
import android.content.Context
|
|
12
14
|
import android.widget.ImageView
|
|
15
|
+
import com.blaze.blazesdk.style.players.BlazeCaptionsPositioning
|
|
16
|
+
import com.blaze.blazesdk.style.players.BlazeCaptionsStyle
|
|
17
|
+
import com.blaze.blazesdk.style.players.BlazeCaptionsXPosition
|
|
18
|
+
import com.blaze.blazesdk.style.players.BlazeCaptionsYPosition
|
|
13
19
|
import com.blaze.blazesdk.style.players.BlazeFirstTimeSlideCTAStyle
|
|
14
20
|
import com.blaze.blazesdk.style.players.BlazeFirstTimeSlideInstructionStyle
|
|
15
21
|
import com.blaze.blazesdk.style.players.BlazeFirstTimeSlideTextStyle
|
|
@@ -169,6 +175,41 @@ fun <T : IPlayerItemButtonStyle> T.mergeButtonThemes(
|
|
|
169
175
|
return this
|
|
170
176
|
}
|
|
171
177
|
|
|
178
|
+
fun BlazeCaptionsStyle.mergedWith(
|
|
179
|
+
customization: BlazeReactCaptionsStyle?,
|
|
180
|
+
context: Context
|
|
181
|
+
): BlazeCaptionsStyle {
|
|
182
|
+
customization ?: return this
|
|
183
|
+
|
|
184
|
+
val merged = this
|
|
185
|
+
merged.fontResId = customization.font?.toFontResId(context)
|
|
186
|
+
merged.textSize = customization.textSize ?: this.textSize
|
|
187
|
+
merged.positioning = this.positioning.mergedWith(customization.positioning)
|
|
188
|
+
|
|
189
|
+
return merged
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
fun BlazeCaptionsPositioning.mergedWith(
|
|
193
|
+
customization: BlazeReactCaptionsPositioning?
|
|
194
|
+
): BlazeCaptionsPositioning {
|
|
195
|
+
customization ?: return this
|
|
196
|
+
|
|
197
|
+
val merged = this
|
|
198
|
+
when (customization.xPosition) {
|
|
199
|
+
"Start" -> merged.xPosition = BlazeCaptionsXPosition.Start
|
|
200
|
+
"Center" -> merged.xPosition = BlazeCaptionsXPosition.Center
|
|
201
|
+
"Custom" -> merged.xPosition = BlazeCaptionsXPosition.Custom(customization.xOffsetPercent ?: 0)
|
|
202
|
+
}
|
|
203
|
+
when (customization.yPosition) {
|
|
204
|
+
"Top" -> merged.yPosition = BlazeCaptionsYPosition.Top
|
|
205
|
+
"Center" -> merged.yPosition = BlazeCaptionsYPosition.Center
|
|
206
|
+
"Bottom" -> merged.yPosition = BlazeCaptionsYPosition.Bottom
|
|
207
|
+
"Custom" -> merged.yPosition = BlazeCaptionsYPosition.Custom(customization.yOffsetPercent ?: 0)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return merged
|
|
211
|
+
}
|
|
212
|
+
|
|
172
213
|
fun BlazeSeekBarStyle.mergedWith(
|
|
173
214
|
customization: BlazeReactSeekBarStyle?,
|
|
174
215
|
context: Context
|
|
@@ -19,6 +19,7 @@ import BlazeReactWidgetItemStatusIndicatorStyle
|
|
|
19
19
|
import BlazeReactWidgetItemStyle
|
|
20
20
|
import BlazeReactWidgetItemTitleStyle
|
|
21
21
|
import BlazeReactWidgetLayout
|
|
22
|
+
import BlazeReactWidgetShimmeringStyle
|
|
22
23
|
import android.content.Context
|
|
23
24
|
import com.blaze.blazesdk.style.shared.models.BlazeObjectPositioning
|
|
24
25
|
import com.blaze.blazesdk.style.shared.models.BlazeObjectXPosition
|
|
@@ -37,6 +38,7 @@ import com.blaze.blazesdk.style.widgets.BlazeWidgetItemStyle
|
|
|
37
38
|
import com.blaze.blazesdk.style.widgets.BlazeWidgetItemTextStyle
|
|
38
39
|
import com.blaze.blazesdk.style.widgets.BlazeWidgetItemTitleStyle
|
|
39
40
|
import com.blaze.blazesdk.style.widgets.BlazeWidgetLayout
|
|
41
|
+
import com.blaze.blazesdk.style.widgets.BlazeWidgetShimmeringStyle
|
|
40
42
|
|
|
41
43
|
fun BlazeWidgetLayout.mergedWith(
|
|
42
44
|
customization: BlazeReactWidgetLayout?,
|
|
@@ -55,6 +57,20 @@ fun BlazeWidgetLayout.mergedWith(
|
|
|
55
57
|
merged.widgetItemStyle =
|
|
56
58
|
this.widgetItemStyle.mergedWith(customization.widgetItemStyle, context)
|
|
57
59
|
merged.margins = this.margins.mergedWith(customization.margins)
|
|
60
|
+
merged.shimmering = this.shimmering.mergedWith(customization.shimmering)
|
|
61
|
+
return merged
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
fun BlazeWidgetShimmeringStyle.mergedWith(
|
|
65
|
+
customization: BlazeReactWidgetShimmeringStyle?
|
|
66
|
+
): BlazeWidgetShimmeringStyle {
|
|
67
|
+
customization ?: return this
|
|
68
|
+
|
|
69
|
+
val merged = this
|
|
70
|
+
|
|
71
|
+
merged.baseColor = safeParseColor(customization.baseColor) ?: merged.baseColor
|
|
72
|
+
merged.highlightColor = safeParseColor(customization.highlightColor) ?: merged.highlightColor
|
|
73
|
+
|
|
58
74
|
return merged
|
|
59
75
|
}
|
|
60
76
|
|
|
@@ -62,6 +62,7 @@ fun BlazeMomentsPlayerStyle.mergedWith(
|
|
|
62
62
|
customization.bottomComponentsAlignment?.let { merged.bottomComponentsAlignment = it.mapToBlazeEnumClass() }
|
|
63
63
|
customization.playerDisplayMode?.let { merged.playerDisplayMode = it.mapToBlazeEnumClass() }
|
|
64
64
|
merged.followEntity = this.followEntity.mergedWith(customization.followEntity)
|
|
65
|
+
merged.captions = this.captions.mergedWith(customization.captions, context)
|
|
65
66
|
return merged
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -131,9 +132,11 @@ fun BlazeMomentsPlayerButtonsStyle.mergedWith(
|
|
|
131
132
|
merged.share = merged.share.mergeButtonThemes(customization.share, context)
|
|
132
133
|
merged.like = merged.like.mergeButtonThemes(customization.like, context)
|
|
133
134
|
merged.play = merged.play.mergeButtonThemes(customization.play, context)
|
|
135
|
+
merged.captions = merged.captions.mergeButtonThemes(customization.captions, context)
|
|
134
136
|
merged.seekForward = merged.seekForward.mergeButtonThemes(customization.seekForward, context)
|
|
135
137
|
merged.seekBackward = merged.seekBackward.mergeButtonThemes(customization.seekBackward, context)
|
|
136
138
|
merged.search = merged.search.mergeButtonThemes(customization.search, context)
|
|
139
|
+
merged.shouldPreserveLikesCountBelowThreshold = customization.shouldPreserveLikesCountBelowThreshold ?: merged.shouldPreserveLikesCountBelowThreshold
|
|
137
140
|
|
|
138
141
|
mergeCustomActionButtons(customization.customActionButtons, context)?.let {
|
|
139
142
|
merged.setBottomStackCustomActionButtons(it)
|
|
@@ -172,6 +175,8 @@ fun BlazeMomentsPlayerCtaStyle.mergedWith(
|
|
|
172
175
|
customization.horizontalAlignment?.let { merged.horizontalAlignment = it.mapToBlazeEnumClass() }
|
|
173
176
|
customization.icon?.let { this.icon = this.icon.mergeWith(it, context) }
|
|
174
177
|
merged.isVisible = customization.isVisible ?: this.isVisible
|
|
178
|
+
merged.borderColor = safeParseColor(customization.borderColor) ?: this.borderColor
|
|
179
|
+
merged.borderWidth = customization.borderWidth?.blazeDp ?: this.borderWidth
|
|
175
180
|
return merged
|
|
176
181
|
}
|
|
177
182
|
|