@wscsports/blaze-rtn-sdk 1.19.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 +38 -2
- package/android/src/main/java/com/blaze/rtnblazesdk/base/BaseWidgetView.kt +67 -2
- 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/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 +9 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactPlayerTabsStyleMerger.kt +8 -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/events/MomentsContainerTabsEvent.kt +2 -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 +26 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsRowView.kt +26 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/moments/BlazeMomentsWidgetViewManager.kt +45 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/stories/BlazeStoriesGridView.kt +2 -1
- package/android/src/main/java/com/blaze/rtnblazesdk/stories/BlazeStoriesRowView.kt +2 -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 +50 -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 +8 -0
- package/android/src/main/java/com/blaze/rtnblazesdk/utils/PlaybackConfigurationExtractUtils.kt +43 -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 +1 -1
- package/ios/Sources/BlazeNativeSDKModule/BlazeNativeSDKModule.swift +31 -7
- 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 +8 -0
- package/ios/Sources/LayoutCustomization/TabsStyle/BlazeReactPlayerTabsStyleMerger.swift +8 -0
- package/ios/Sources/LayoutCustomization/VideoPlayer/BlazeReactVideosPlayerStyle.swift +67 -0
- package/ios/Sources/LayoutCustomization/VideoPlayer/BlazeReactVideosPlayerStyleMerger.swift +87 -1
- package/ios/Sources/Utils/BlazeReactParamsParser.swift +63 -6
- package/ios/Sources/Utils/EventParamsBuilder.swift +43 -2
- package/ios/Sources/Utils/PlaybackConfigurationExtractUtils.swift +15 -0
- package/ios/Sources/Widgets/Base/BlazeWidgetBase.swift +82 -14
- package/ios/Sources/Widgets/Base/BlazeWidgetBaseProtocol.swift +12 -2
- package/ios/Sources/Widgets/Base/BlazeWidgetViewManagerBase.h +17 -1
- package/ios/Sources/Widgets/Base/BlazeWidgetViewManagerBase.swift +42 -2
- package/ios/Sources/Widgets/BlazeMomentsGridWidget.swift +1 -0
- package/ios/Sources/Widgets/BlazeMomentsRowWidget.swift +1 -0
- package/ios/Sources/Widgets/BlazeVideosGridWidget.swift +1 -0
- package/ios/Sources/Widgets/BlazeVideosRowWidget.swift +1 -0
- 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/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 +22 -0
- package/lib/commonjs/interfaces/index.js.map +1 -1
- 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 +8 -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/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/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 +2 -0
- package/lib/module/interfaces/index.js.map +1 -1
- 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 +8 -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.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/index.d.ts +2 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/interfaces/actions-options.interface.d.ts +5 -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 +2 -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-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 +24 -0
- package/lib/typescript/interfaces/moments-widget-tabs-configuration.d.ts.map +1 -1
- package/lib/typescript/interfaces/stories-playback-configuration.d.ts +15 -0
- package/lib/typescript/interfaces/stories-playback-configuration.d.ts.map +1 -1
- 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 +5 -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/widgets-props.interface.d.ts +25 -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 +2 -0
- package/lib/typescript/widgets/BlazeBaseWidgetComponent.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeBaseWidgetViewProps.d.ts +19 -1
- package/lib/typescript/widgets/BlazeBaseWidgetViewProps.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeMomentsGridView.d.ts +2 -2
- package/lib/typescript/widgets/BlazeMomentsGridView.d.ts.map +1 -1
- package/lib/typescript/widgets/BlazeMomentsRowView.d.ts +2 -2
- 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/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/index.tsx +7 -1
- package/src/interfaces/actions-options.interface.tsx +5 -0
- package/src/interfaces/captions-style.tsx +43 -0
- package/src/interfaces/index.tsx +2 -0
- package/src/interfaces/init-options.interface.tsx +7 -0
- package/src/interfaces/moments-player-style.tsx +22 -0
- package/src/interfaces/moments-widget-tabs-configuration.tsx +25 -0
- package/src/interfaces/stories-playback-configuration.tsx +17 -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 +5 -1
- package/src/interfaces/videos-player-style.tsx +110 -1
- package/src/interfaces/widgets-props.interface.tsx +31 -0
- package/src/widgets/BlazeBaseWidgetComponent.tsx +17 -0
- package/src/widgets/BlazeBaseWidgetViewProps.tsx +20 -0
- package/src/widgets/BlazeMomentsGridView.tsx +3 -3
- package/src/widgets/BlazeMomentsRowView.tsx +6 -6
- 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,17 +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
|
|
28
30
|
import com.blaze.blazesdk.shared.models.BlazePlayerSoundState
|
|
29
31
|
import com.blaze.blazesdk.shared.results.BlazeResult
|
|
30
32
|
import com.blaze.rtnblazesdk.events.SdkModuleJsEvent
|
|
31
33
|
import com.blaze.rtnblazesdk.shared.blazeAsyncBridge
|
|
32
34
|
import com.blaze.rtnblazesdk.shared.callJSMethod
|
|
33
35
|
import com.blaze.rtnblazesdk.utils.extractCachingLevel
|
|
36
|
+
import com.blaze.rtnblazesdk.utils.extractLayoutDirection
|
|
34
37
|
import com.blaze.rtnblazesdk.utils.extractDataSource
|
|
35
38
|
import com.blaze.rtnblazesdk.utils.extractMomentsPlayerStyle
|
|
36
39
|
import com.blaze.rtnblazesdk.utils.extractStoriesPlayerStyle
|
|
37
40
|
import com.blaze.rtnblazesdk.utils.extractMomentsPlaybackConfiguration
|
|
38
41
|
import com.blaze.rtnblazesdk.utils.extractStoriesPlaybackConfiguration
|
|
42
|
+
import com.blaze.rtnblazesdk.utils.extractVideosFilterParams
|
|
39
43
|
import com.blaze.rtnblazesdk.utils.extractVideosPlaybackConfiguration
|
|
40
44
|
import com.blaze.rtnblazesdk.utils.extractVideosPlayerStyle
|
|
41
45
|
import com.blaze.rtnblazesdk.utils.getBooleanOrNull
|
|
@@ -163,6 +167,17 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
163
167
|
sendJsEvent(event)
|
|
164
168
|
}
|
|
165
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
|
+
|
|
166
181
|
override fun onReadStatusChanged(
|
|
167
182
|
playerType: BlazePlayerType,
|
|
168
183
|
sourceId: String?,
|
|
@@ -223,12 +238,15 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
223
238
|
val cachingLevel = options.extractCachingLevel() ?: BlazeCachingLevel.DEFAULT
|
|
224
239
|
BlazeSdkModuleRepo.cachingLevel = cachingLevel
|
|
225
240
|
|
|
241
|
+
val forceLayoutDirection = options.extractLayoutDirection()
|
|
242
|
+
|
|
226
243
|
BlazeSDK.init(
|
|
227
244
|
apiKey = options.getString(KEY_INIT_API_KEY)!!,
|
|
228
245
|
externalUserId = options.getString(KEY_INIT_EXTERNAL_USER_ID),
|
|
229
246
|
geoLocation = options.getString(KEY_INIT_GEO_LOCATION),
|
|
230
247
|
cachingSize = options.getInt(KEY_INIT_CACHING_SIZE),
|
|
231
248
|
cachingLevel = cachingLevel,
|
|
249
|
+
forceLayoutDirection = forceLayoutDirection,
|
|
232
250
|
completionBlock = {
|
|
233
251
|
promise.resolve(BlazeResult.Success(true).toString())
|
|
234
252
|
},
|
|
@@ -266,6 +284,10 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
266
284
|
return getString(KEY_INIT_CACHING_LEVEL)?.extractCachingLevel()
|
|
267
285
|
}
|
|
268
286
|
|
|
287
|
+
private fun ReadableMap.extractLayoutDirection(): BlazeLayoutDirection? {
|
|
288
|
+
return getString(KEY_INIT_FORCE_LAYOUT_DIRECTION)?.extractLayoutDirection()
|
|
289
|
+
}
|
|
290
|
+
|
|
269
291
|
private fun setAppOverrideCtaHandling(options: ReadableMap) {
|
|
270
292
|
// getBoolean can throw exception while getString will return null if no such key
|
|
271
293
|
try {
|
|
@@ -509,13 +531,16 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
509
531
|
val playbackConfiguration = options.getMap(KEY_ENTRY_POINT_PLAYBACK_CONFIGURATION)
|
|
510
532
|
.extractVideosPlaybackConfiguration()
|
|
511
533
|
?: BlazeSDK.getDefaultVideosPlaybackConfiguration()
|
|
534
|
+
val videosFilterParams = options.getMap(KEY_ENTRY_POINT_VIDEOS_FILTER_PARAMS)
|
|
535
|
+
.extractVideosFilterParams()
|
|
512
536
|
BlazeSDK.playVideos(
|
|
513
537
|
dataSource = dataSource,
|
|
514
538
|
entryContentId = entryContentId,
|
|
515
539
|
videosPlayerStyle = playerStyle,
|
|
516
540
|
triggerSource = triggerSource,
|
|
517
541
|
shouldOrderContentByReadStatus = shouldOrderContentByReadStatus,
|
|
518
|
-
playbackConfiguration = playbackConfiguration
|
|
542
|
+
playbackConfiguration = playbackConfiguration,
|
|
543
|
+
videosFilterParams = videosFilterParams
|
|
519
544
|
) { result ->
|
|
520
545
|
promise.handleResult(result)
|
|
521
546
|
}
|
|
@@ -533,7 +558,13 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
533
558
|
return
|
|
534
559
|
}
|
|
535
560
|
val entryContentId = options.getString(KEY_ENTRY_POINT_CONTENT_ID)
|
|
536
|
-
|
|
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 ->
|
|
537
568
|
promise.handleResult(result)
|
|
538
569
|
}
|
|
539
570
|
} catch (e: Exception) {
|
|
@@ -642,6 +673,9 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
642
673
|
val config = BlazeSDK.getDefaultStoriesPlaybackConfiguration()
|
|
643
674
|
val result = Arguments.createMap().apply {
|
|
644
675
|
putDouble("bufferingSpinnerDelayMs", config.bufferingSpinnerDelayMs.toDouble())
|
|
676
|
+
putMap("ads", Arguments.createMap().apply {
|
|
677
|
+
putBoolean("enablePreroll", config.ads.enablePreroll)
|
|
678
|
+
})
|
|
645
679
|
}
|
|
646
680
|
promise.resolve(result)
|
|
647
681
|
} catch (e: Exception) {
|
|
@@ -877,6 +911,7 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
877
911
|
const val KEY_INIT_GEO_LOCATION = "geoLocation"
|
|
878
912
|
const val KEY_INIT_CACHING_SIZE = "cachingSize"
|
|
879
913
|
const val KEY_INIT_CACHING_LEVEL = "cachingLevel"
|
|
914
|
+
const val KEY_INIT_FORCE_LAYOUT_DIRECTION = "forceLayoutDirection"
|
|
880
915
|
const val KEY_INIT_APP_OVERRIDES_CTA_HANDLING = "appOverridesCTAHandling"
|
|
881
916
|
const val KEY_INIT_DEFAULT_STORY_PLAYER_STYLE = "defaultStoryPlayerStyle"
|
|
882
917
|
const val KEY_INIT_DEFAULT_MOMENT_PLAYER_STYLE = "defaultMomentsPlayerStyle"
|
|
@@ -890,6 +925,7 @@ class BlazeSdkModule(private val context: ReactApplicationContext): ReactContext
|
|
|
890
925
|
const val KEY_ENTRY_POINT_SOURCE_ID = "sourceId"
|
|
891
926
|
const val KEY_ENTRY_POINT_CONTENT_ID = "entryContentId"
|
|
892
927
|
const val KEY_ENTRY_POINT_PLAYBACK_CONFIGURATION = "playbackConfiguration"
|
|
928
|
+
const val KEY_ENTRY_POINT_VIDEOS_FILTER_PARAMS = "videosFilterParams"
|
|
893
929
|
private const val PLAYBACK_MODIFICATION_METHOD_NAME = "Blaze.GlobalDelegate.playbackModificationHandler"
|
|
894
930
|
}
|
|
895
931
|
|
|
@@ -11,6 +11,7 @@ import com.blaze.blazesdk.delegates.BlazeWidgetDelegate
|
|
|
11
11
|
import com.blaze.blazesdk.delegates.models.BlazeCTAActionType
|
|
12
12
|
import com.blaze.blazesdk.delegates.models.BlazePlayerEvent
|
|
13
13
|
import com.blaze.blazesdk.delegates.models.BlazePlayerType
|
|
14
|
+
import com.blaze.blazesdk.delegates.models.BlazeShareParams
|
|
14
15
|
import com.blaze.blazesdk.extentions.blazeDeepCopy
|
|
15
16
|
import com.blaze.blazesdk.features.shared.models.ui_shared.BlazeLinkActionHandleType
|
|
16
17
|
import com.blaze.blazesdk.prefetch.models.BlazeCachingLevel
|
|
@@ -34,6 +35,7 @@ import com.blaze.rtnblazesdk.events.WidgetOnPlayerEventTriggered
|
|
|
34
35
|
import com.blaze.rtnblazesdk.events.WidgetOnTriggerPlayerBodyTextLinkEvent
|
|
35
36
|
import com.blaze.rtnblazesdk.events.WidgetPlayerDidAppearEvent
|
|
36
37
|
import com.blaze.rtnblazesdk.events.WidgetPlayerDismissedEvent
|
|
38
|
+
import com.blaze.rtnblazesdk.events.WidgetShareClickedEvent
|
|
37
39
|
import com.blaze.blazesdk.style.shared.models.BlazePlayerCustomActionButtonParams
|
|
38
40
|
import com.blaze.rtnblazesdk.utils.EventParamsBuilder
|
|
39
41
|
import com.blaze.rtnblazesdk.utils.extractCachingLevel
|
|
@@ -61,6 +63,20 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
61
63
|
|
|
62
64
|
private var dataSourceType: BlazeDataSourceType? = null
|
|
63
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
|
|
64
80
|
var perItemStyleOverridesReadableMap: ReadableMap? = null
|
|
65
81
|
var presetWidgetLayoutString: String? = null
|
|
66
82
|
var appOverridesCTAHandling: Boolean = false
|
|
@@ -76,6 +92,12 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
76
92
|
*/
|
|
77
93
|
var reactTabsContainerMap: ReadableMap? = null
|
|
78
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
|
+
|
|
79
101
|
val cachingLevel: BlazeCachingLevel
|
|
80
102
|
get() = reactCachingLevel?.extractCachingLevel() ?: BlazeSdkModuleRepo.cachingLevel ?: BlazeCachingLevel.DEFAULT
|
|
81
103
|
|
|
@@ -212,6 +234,24 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
212
234
|
)
|
|
213
235
|
)
|
|
214
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
|
+
}
|
|
215
255
|
}
|
|
216
256
|
|
|
217
257
|
/**
|
|
@@ -313,8 +353,20 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
313
353
|
)
|
|
314
354
|
}
|
|
315
355
|
|
|
316
|
-
|
|
317
|
-
|
|
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.
|
|
318
370
|
}
|
|
319
371
|
|
|
320
372
|
private fun dispatchTabsEvent(name: String, data: WritableMap) {
|
|
@@ -339,6 +391,19 @@ abstract class BaseWidgetView @JvmOverloads constructor(
|
|
|
339
391
|
abstract fun updateWidgetsUi()
|
|
340
392
|
abstract fun play()
|
|
341
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
|
+
|
|
342
407
|
override fun onHeightChanged(height: Int) {
|
|
343
408
|
dispatchEvent(
|
|
344
409
|
WidgetHeightChangedEvent(
|
|
@@ -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
|
|
@@ -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
|
|
package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactMomentsPlayerStyle.kt
CHANGED
|
@@ -25,7 +25,8 @@ data class BlazeReactMomentsPlayerStyle(
|
|
|
25
25
|
val seekBar: BlazeReactMomentsPlayerSeekBarStyle?,
|
|
26
26
|
val bottomComponentsAlignment: BlazeReactBottomComponentsAlignment?,
|
|
27
27
|
val playerDisplayMode: BlazeReactPlayerDisplayMode?,
|
|
28
|
-
val followEntity: BlazeReactMomentsPlayerFollowEntityStyle
|
|
28
|
+
val followEntity: BlazeReactMomentsPlayerFollowEntityStyle?,
|
|
29
|
+
val captions: BlazeReactCaptionsStyle?
|
|
29
30
|
)
|
|
30
31
|
|
|
31
32
|
@Keep
|
|
@@ -76,10 +77,12 @@ data class BlazeReactMomentsPlayerButtonsStyle(
|
|
|
76
77
|
val share: BlazeReactPlayerButtonStyle?,
|
|
77
78
|
val like: BlazeReactPlayerButtonStyle?,
|
|
78
79
|
val play: BlazeReactPlayerButtonStyle?,
|
|
80
|
+
val captions: BlazeReactPlayerButtonStyle?,
|
|
79
81
|
val seekForward: BlazeReactPlayerButtonStyle?,
|
|
80
82
|
val seekBackward: BlazeReactPlayerButtonStyle?,
|
|
81
83
|
val search: BlazeReactPlayerButtonStyle?,
|
|
82
|
-
val customActionButtons: List<BlazeReactCustomActionButton
|
|
84
|
+
val customActionButtons: List<BlazeReactCustomActionButton>?,
|
|
85
|
+
val shouldPreserveLikesCountBelowThreshold: Boolean?
|
|
83
86
|
)
|
|
84
87
|
|
|
85
88
|
@Keep
|
|
@@ -106,7 +109,9 @@ data class BlazeReactMomentsPlayerCtaStyle(
|
|
|
106
109
|
val icon: BlazeReactMomentsPlayerCtaIconStyle?,
|
|
107
110
|
val layoutPositioning: CTAPositioning?,
|
|
108
111
|
val horizontalAlignment: CTAHorizontalAlignment?,
|
|
109
|
-
val isVisible: Boolean
|
|
112
|
+
val isVisible: Boolean?,
|
|
113
|
+
val borderColor: String?, // Hex
|
|
114
|
+
val borderWidth: Int?
|
|
110
115
|
) {
|
|
111
116
|
@Keep
|
|
112
117
|
enum class CTAPositioning(override val rawValue: String): BlazeEnumMapper<BlazeMomentsPlayerCtaStyle.BlazeCTAPositioning> {
|
package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactPlayerTabsStyle.kt
CHANGED
|
@@ -12,6 +12,15 @@ data class BlazeReactPlayerTabsStyle(
|
|
|
12
12
|
val icon: BlazeReactPlayerTabItemIconStyle?,
|
|
13
13
|
val selectedTabState: BlazeReactPlayerTabItemStyle?,
|
|
14
14
|
val unselectedTabState: BlazeReactPlayerTabItemStyle?,
|
|
15
|
+
val activeTabIndicator: BlazeReactPlayerActiveTabIndicatorStyle?,
|
|
16
|
+
val isTabTitleVisibleWhenSingleTab: Boolean?,
|
|
17
|
+
val isTabVisibleWhenEmpty: Boolean?,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
@Keep
|
|
21
|
+
data class BlazeReactPlayerActiveTabIndicatorStyle(
|
|
22
|
+
val isVisible: Boolean?,
|
|
23
|
+
val height: Int?,
|
|
15
24
|
)
|
|
16
25
|
|
|
17
26
|
@Keep
|
package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactPlayerTabsStyleMerger.kt
CHANGED
|
@@ -39,6 +39,14 @@ fun BlazePlayerTabsStyle.mergedWith(
|
|
|
39
39
|
merged.selectedTabState.mergedWith(customization.selectedTabState, context)
|
|
40
40
|
merged.unselectedTabState.mergedWith(customization.unselectedTabState, context)
|
|
41
41
|
|
|
42
|
+
customization.activeTabIndicator?.let { activeTabIndicator ->
|
|
43
|
+
activeTabIndicator.isVisible?.let { merged.activeTabIndicator.isVisible = it }
|
|
44
|
+
activeTabIndicator.height?.let { merged.activeTabIndicator.height = it.blazeDp }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
customization.isTabTitleVisibleWhenSingleTab?.let { merged.isTabTitleVisibleWhenSingleTab = it }
|
|
48
|
+
customization.isTabVisibleWhenEmpty?.let { merged.isTabVisibleWhenEmpty = it }
|
|
49
|
+
|
|
42
50
|
return merged
|
|
43
51
|
}
|
|
44
52
|
|
|
@@ -51,6 +51,7 @@ fun BlazeStoryPlayerStyle.mergedWith(
|
|
|
51
51
|
merged.headerGradient = this.headerGradient.mergedWith(customization.headerGradient)
|
|
52
52
|
merged.firstTimeSlide.mergedWith(customization.firstTimeSlide,context)
|
|
53
53
|
merged.progressBar = this.progressBar.mergedWith(customization.progressBar)
|
|
54
|
+
merged.captions = this.captions.mergedWith(customization.captions, context)
|
|
54
55
|
return merged
|
|
55
56
|
|
|
56
57
|
}
|
|
@@ -183,6 +184,8 @@ fun BlazeStoryPlayerButtonsStyle.mergedWith(
|
|
|
183
184
|
merged.exit.mergeButtonThemes(customization.exit, context)
|
|
184
185
|
merged.share =
|
|
185
186
|
merged.share.mergeButtonThemes(customization.share, context)
|
|
187
|
+
merged.captions =
|
|
188
|
+
merged.captions.mergeButtonThemes(customization.captions, context)
|
|
186
189
|
|
|
187
190
|
mergeCustomActionButtons(customization.customActionButtons, context)?.let {
|
|
188
191
|
merged.setTopStackCustomActionButtons(it)
|
|
@@ -216,6 +219,8 @@ fun BlazeStoryPlayerCtaStyle.mergedWith(
|
|
|
216
219
|
merged.textSize = customization.textSize ?: this.textSize
|
|
217
220
|
merged.fontResId = customization.font?.toFontResId(context)
|
|
218
221
|
merged.isVisible = customization.isVisible ?: this.isVisible
|
|
222
|
+
merged.borderColor = safeParseColor(customization.borderColor) ?: this.borderColor
|
|
223
|
+
merged.borderWidth = customization.borderWidth?.blazeDp ?: this.borderWidth
|
|
219
224
|
|
|
220
225
|
return merged
|
|
221
226
|
}
|
package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactStoryPlayerStyle.kt
CHANGED
|
@@ -15,7 +15,8 @@ data class BlazeReactStoryPlayerStyle(
|
|
|
15
15
|
val cta: BlazeReactStoryPlayerCtaStyle?,
|
|
16
16
|
val headerGradient: BlazeReactStoryPlayerHeaderGradientStyle?,
|
|
17
17
|
val progressBar: BlazeReactStoryPlayerProgressBarStyle?,
|
|
18
|
-
val firstTimeSlide: BlazeReactStoryPlayerFirstTimeSlideStyle
|
|
18
|
+
val firstTimeSlide: BlazeReactStoryPlayerFirstTimeSlideStyle?,
|
|
19
|
+
val captions: BlazeReactCaptionsStyle?
|
|
19
20
|
)
|
|
20
21
|
|
|
21
22
|
@Keep
|
|
@@ -62,6 +63,7 @@ data class BlazeReactStoryPlayerButtonsStyle(
|
|
|
62
63
|
val mute: BlazeReactPlayerButtonStyle?,
|
|
63
64
|
val exit: BlazeReactPlayerButtonStyle?,
|
|
64
65
|
val share: BlazeReactPlayerButtonStyle?,
|
|
66
|
+
val captions: BlazeReactPlayerButtonStyle?,
|
|
65
67
|
val customActionButtons: List<BlazeReactCustomActionButton>?
|
|
66
68
|
)
|
|
67
69
|
|
|
@@ -85,7 +87,9 @@ data class BlazeReactStoryPlayerCtaStyle(
|
|
|
85
87
|
val cornerRadius: Int?,
|
|
86
88
|
val textSize: Float?,
|
|
87
89
|
val font: BlazeReactTitleFont?,
|
|
88
|
-
val isVisible: Boolean
|
|
90
|
+
val isVisible: Boolean?,
|
|
91
|
+
val borderColor: String?, // Hex
|
|
92
|
+
val borderWidth: Int?
|
|
89
93
|
)
|
|
90
94
|
|
|
91
95
|
@Keep
|
package/android/src/main/java/com/blaze/rtnblazesdk/customization/BlazeReactVideosPlayerStyle.kt
CHANGED
|
@@ -11,6 +11,8 @@ data class BlazeReactVideosPlayerStyle(
|
|
|
11
11
|
val backgroundColor: String?, // Hex
|
|
12
12
|
val cta: BlazeReactVideosPlayerCtaStyle?,
|
|
13
13
|
val seekBar: BlazeReactVideosPlayerSeekBarStyle?,
|
|
14
|
+
val overlayVisibilityThresholdMs: Long?,
|
|
15
|
+
val captions: BlazeReactCaptionsStyle?,
|
|
14
16
|
)
|
|
15
17
|
|
|
16
18
|
@Keep
|
|
@@ -55,7 +57,9 @@ data class BlazeReactVideosPlayerCtaStyle(
|
|
|
55
57
|
val width: Int?,
|
|
56
58
|
val height: Int?,
|
|
57
59
|
val icon: BlazeReactVideosPlayerCtaIconStyle?,
|
|
58
|
-
val isVisible: Boolean
|
|
60
|
+
val isVisible: Boolean?,
|
|
61
|
+
val borderColor: String?, // Hex
|
|
62
|
+
val borderWidth: Int?
|
|
59
63
|
)
|
|
60
64
|
|
|
61
65
|
@Keep
|
|
@@ -28,7 +28,9 @@ fun BlazeVideosPlayerStyle.mergedWith(
|
|
|
28
28
|
merged.cta = this.cta.mergedWith(customization.cta, context)
|
|
29
29
|
safeParseColor(customization.backgroundColor)?.let { merged.backgroundColor = it }
|
|
30
30
|
merged.seekBar = this.seekBar.mergedWith(customization.seekBar, context)
|
|
31
|
-
|
|
31
|
+
merged.overlayVisibilityThreshold = customization.overlayVisibilityThresholdMs ?: this.overlayVisibilityThreshold
|
|
32
|
+
merged.captions = this.captions.mergedWith(customization.captions, context)
|
|
33
|
+
|
|
32
34
|
// BlazeVideosPlayerCastButtonStyle doesn't implement IPlayerItemButtonStyle so we need to merge it manually
|
|
33
35
|
customization.buttons?.casting?.let { castCustom ->
|
|
34
36
|
castCustom.isVisible?.let { merged.cast.isVisible = it }
|
|
@@ -93,6 +95,8 @@ fun BlazeVideosPlayerCtaStyle.mergedWith(
|
|
|
93
95
|
merged.height = customization.height?.blazeDp ?: this.height
|
|
94
96
|
customization.icon?.let { this.icon = this.icon.mergeWith(it, context) }
|
|
95
97
|
merged.isVisible = customization.isVisible ?: this.isVisible
|
|
98
|
+
merged.borderColor = safeParseColor(customization.borderColor) ?: this.borderColor
|
|
99
|
+
merged.borderWidth = customization.borderWidth?.blazeDp ?: this.borderWidth
|
|
96
100
|
return merged
|
|
97
101
|
}
|
|
98
102
|
|
|
@@ -60,6 +60,23 @@ data class BlazeReactTitleFont(
|
|
|
60
60
|
val fontFileName: String?
|
|
61
61
|
)
|
|
62
62
|
|
|
63
|
+
// Shared across the Videos, Moments, and Stories player styles — one `captions` field per
|
|
64
|
+
// player style, all backed by the same native BlazeCaptionsStyle type.
|
|
65
|
+
@Keep
|
|
66
|
+
data class BlazeReactCaptionsStyle(
|
|
67
|
+
val font: BlazeReactTitleFont?,
|
|
68
|
+
val textSize: Float?,
|
|
69
|
+
val positioning: BlazeReactCaptionsPositioning?
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
@Keep
|
|
73
|
+
data class BlazeReactCaptionsPositioning(
|
|
74
|
+
val xPosition: String?, // "Start" | "Center" | "Custom"
|
|
75
|
+
val xOffsetPercent: Int?,
|
|
76
|
+
val yPosition: String?, // "Top" | "Center" | "Bottom" | "Custom"
|
|
77
|
+
val yOffsetPercent: Int?
|
|
78
|
+
)
|
|
79
|
+
|
|
63
80
|
@Keep
|
|
64
81
|
data class BlazeReactCustomActionButtonParams(
|
|
65
82
|
val id: String?,
|
|
@@ -42,6 +42,7 @@ object MomentsContainerTabsEventNames {
|
|
|
42
42
|
const val TRIGGER_PLAYER_BODY_TEXT_LINK = "Blaze.MomentsContainerTabsTriggerPlayerBodyTextLinkEvent"
|
|
43
43
|
const val PLAYER_EVENT_TRIGGERED = "Blaze.MomentsContainerTabsPlayerEventTriggeredEvent"
|
|
44
44
|
const val TRIGGER_CUSTOM_ACTION_BUTTON = "Blaze.MomentsContainerTabsTriggerCustomActionButtonEvent"
|
|
45
|
+
const val SHARE_CLICKED = "Blaze.MomentsContainerTabsShareClickedEvent"
|
|
45
46
|
|
|
46
47
|
val registrationMap: Map<String, String> = mapOf(
|
|
47
48
|
TAB_SELECTED to "onMomentsContainerTabsTabSelectedInternal",
|
|
@@ -53,5 +54,6 @@ object MomentsContainerTabsEventNames {
|
|
|
53
54
|
TRIGGER_PLAYER_BODY_TEXT_LINK to "onMomentsContainerTabsTriggerPlayerBodyTextLinkInternal",
|
|
54
55
|
PLAYER_EVENT_TRIGGERED to "onMomentsContainerTabsPlayerEventTriggeredInternal",
|
|
55
56
|
TRIGGER_CUSTOM_ACTION_BUTTON to "onMomentsContainerTabsTriggerCustomActionButtonInternal",
|
|
57
|
+
SHARE_CLICKED to "onMomentsContainerTabsShareClickedInternal",
|
|
56
58
|
)
|
|
57
59
|
}
|
|
@@ -5,6 +5,7 @@ import com.blaze.blazesdk.delegates.models.BlazeCTAActionType
|
|
|
5
5
|
import com.blaze.blazesdk.style.shared.models.BlazePlayerCustomActionButtonParams
|
|
6
6
|
import com.blaze.blazesdk.delegates.models.BlazePlayerEvent
|
|
7
7
|
import com.blaze.blazesdk.delegates.models.BlazePlayerType
|
|
8
|
+
import com.blaze.blazesdk.delegates.models.BlazeShareParams
|
|
8
9
|
import com.blaze.blazesdk.delegates.BlazeCastingState
|
|
9
10
|
import com.blaze.blazesdk.delegates.BlazePipState
|
|
10
11
|
import com.blaze.blazesdk.shared.results.BlazeResult
|
|
@@ -119,6 +120,16 @@ sealed interface SdkModuleJsEvent {
|
|
|
119
120
|
EventParamsBuilder.buildTriggerCustomActionButtonParams(playerType, sourceId, customParams)
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
data class ShareClicked(
|
|
124
|
+
val playerType: BlazePlayerType,
|
|
125
|
+
val sourceId: String?,
|
|
126
|
+
val shareParams: BlazeShareParams
|
|
127
|
+
) : SdkModuleJsEvent {
|
|
128
|
+
override val eventName = KEY_EVENT_NAME_SHARE_CLICKED
|
|
129
|
+
override val params: WritableMap =
|
|
130
|
+
EventParamsBuilder.buildShareClickedParams(playerType, sourceId, shareParams)
|
|
131
|
+
}
|
|
132
|
+
|
|
122
133
|
data class ReadStatusChanged(
|
|
123
134
|
val playerType: BlazePlayerType,
|
|
124
135
|
val sourceId: String?,
|
|
@@ -186,6 +197,7 @@ sealed interface SdkModuleJsEvent {
|
|
|
186
197
|
private const val KEY_EVENT_NAME_TRIGGER_PLAYER_BODY_TEXT_LINK = "Blaze.onTriggerPlayerBodyTextLink"
|
|
187
198
|
private const val KEY_EVENT_NAME_TRIGGER_PLAYER_EVENT_TRIGGERED = "Blaze.onPlayerEventTriggered"
|
|
188
199
|
private const val KEY_EVENT_NAME_TRIGGER_CUSTOM_ACTION_BUTTON = "Blaze.onTriggerCustomActionButton"
|
|
200
|
+
private const val KEY_EVENT_NAME_SHARE_CLICKED = "Blaze.onShareClicked"
|
|
189
201
|
private const val KEY_EVENT_NAME_READ_STATUS_CHANGED = "Blaze.onReadStatusChanged"
|
|
190
202
|
private const val KEY_EVENT_NAME_FOLLOW_ENTITY_CLICKED = "Blaze.onFollowEntityClicked"
|
|
191
203
|
private const val KEY_EVENT_NAME_CASTING_STATE_CHANGED = "Blaze.onCastingStateChanged"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package com.blaze.rtnblazesdk.events
|
|
2
|
+
|
|
3
|
+
import com.blaze.blazesdk.delegates.models.BlazePlayerType
|
|
4
|
+
import com.blaze.blazesdk.delegates.models.BlazeShareParams
|
|
5
|
+
import com.blaze.rtnblazesdk.utils.EventParamsBuilder
|
|
6
|
+
import com.facebook.react.bridge.WritableMap
|
|
7
|
+
import com.facebook.react.uimanager.events.Event
|
|
8
|
+
|
|
9
|
+
class WidgetShareClickedEvent(
|
|
10
|
+
surfaceId: Int,
|
|
11
|
+
viewTag: Int,
|
|
12
|
+
val playerType: BlazePlayerType,
|
|
13
|
+
val sourceId: String?,
|
|
14
|
+
val shareParams: BlazeShareParams
|
|
15
|
+
) : Event<WidgetShareClickedEvent>(surfaceId, viewTag) {
|
|
16
|
+
companion object {
|
|
17
|
+
const val EVENT_NAME = "Blaze.WidgetShareClickedEvent"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
override fun getEventName(): String {
|
|
21
|
+
return EVENT_NAME
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
override fun getEventData(): WritableMap? {
|
|
25
|
+
return EventParamsBuilder.buildShareClickedParams(
|
|
26
|
+
playerType,
|
|
27
|
+
sourceId,
|
|
28
|
+
shareParams
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|