react-native-firework-sdk 2.11.0 → 2.11.2
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/gradle.properties +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +3 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWCountdownTimerConfigurationModel.kt +8 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWCountdownTimerConfigurationModelDeserializer.kt +22 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWCountdownTimerConfigurationModelSerializer.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModel.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +3 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWAppearanceMode.kt +18 -0
- package/ios/Components/CountdownTimerConfiguration.swift +43 -0
- package/ios/Components/StoryBlock.swift +6 -0
- package/ios/Components/StoryBlockConfiguration.swift +1 -0
- package/ios/Components/VideoFeed.swift +5 -0
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +12 -0
- package/lib/commonjs/components/StoryBlock.js +2 -0
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +2 -0
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +7 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/CountdownTimerConfiguration.js +2 -0
- package/lib/commonjs/models/CountdownTimerConfiguration.js.map +1 -0
- package/lib/module/components/StoryBlock.js +2 -0
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +2 -0
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +5 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/CountdownTimerConfiguration.js +2 -0
- package/lib/module/models/CountdownTimerConfiguration.js.map +1 -0
- package/lib/typescript/index.d.ts +15 -13
- package/lib/typescript/models/CountdownTimerConfiguration.d.ts +12 -0
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +7 -0
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/StoryBlock.tsx +4 -0
- package/src/components/VideoFeed.tsx +4 -0
- package/src/index.ts +34 -30
- package/src/models/CountdownTimerConfiguration.ts +12 -0
- package/src/models/StoryBlockConfiguration.ts +7 -0
- package/src/models/VideoPlayerConfiguration.ts +6 -0
package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt
CHANGED
|
@@ -114,11 +114,13 @@ class StoryBlockFragment : FWBaseFragment() {
|
|
|
114
114
|
|
|
115
115
|
private fun initStoryBlock() {
|
|
116
116
|
val viewOptionsBuilder = FWConfigUtil.generateViewOptionsBuilder(context, videoFeedPropsModel)
|
|
117
|
+
|
|
117
118
|
fwStoryBlockView?.init(
|
|
118
119
|
childFragmentManager,
|
|
119
120
|
viewLifecycleOwner,
|
|
120
121
|
viewOptionsBuilder.build(),
|
|
121
|
-
FWGlobalDataUtil.pauseWhenNotVisible
|
|
122
|
+
FWGlobalDataUtil.pauseWhenNotVisible,
|
|
123
|
+
videoFeedPropsModel?.videoPlayerConfiguration?.countdownTimerConfiguration?.isHidden == false
|
|
122
124
|
)
|
|
123
125
|
isStoryBlockInitializer = true
|
|
124
126
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import com.fireworksdk.bridge.models.enums.FWAppearanceMode
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
|
|
6
|
+
object FWCountdownTimerConfigurationModelDeserializer {
|
|
7
|
+
|
|
8
|
+
private const val IS_HIDDEN_KEY = "isHidden"
|
|
9
|
+
private const val APPEARANCE_KEY = "appearance"
|
|
10
|
+
|
|
11
|
+
fun deserialize(responseJson: JSONObject?): FWCountdownTimerConfigurationModel? {
|
|
12
|
+
responseJson ?: return null
|
|
13
|
+
|
|
14
|
+
val isHidden = responseJson.optBoolean(IS_HIDDEN_KEY, true)
|
|
15
|
+
val appearance = if (responseJson.has(APPEARANCE_KEY)) responseJson.optString(APPEARANCE_KEY) else null
|
|
16
|
+
|
|
17
|
+
return FWCountdownTimerConfigurationModel(
|
|
18
|
+
isHidden = isHidden,
|
|
19
|
+
appearance = if (!appearance.isNullOrBlank()) FWAppearanceMode.deserialize(appearance) else null,
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import com.fireworksdk.bridge.models.enums.FWAppearanceMode
|
|
4
|
+
import org.json.JSONObject
|
|
5
|
+
|
|
6
|
+
object FWCountdownTimerConfigurationModelSerializer {
|
|
7
|
+
|
|
8
|
+
private const val IS_HIDDEN_KEY = "isHidden"
|
|
9
|
+
private const val APPEARANCE_KEY = "appearance"
|
|
10
|
+
|
|
11
|
+
fun serialize(model: FWCountdownTimerConfigurationModel?): JSONObject? {
|
|
12
|
+
model ?: return null
|
|
13
|
+
val jsonObject = JSONObject()
|
|
14
|
+
jsonObject.put(IS_HIDDEN_KEY, model.isHidden)
|
|
15
|
+
jsonObject.put(APPEARANCE_KEY, FWAppearanceMode.serialize(model.appearance))
|
|
16
|
+
return jsonObject
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -3,6 +3,6 @@ package com.fireworksdk.bridge.models
|
|
|
3
3
|
import com.fireworksdk.bridge.models.enums.FWSystemTypeface
|
|
4
4
|
|
|
5
5
|
data class FWFontInfoModel(
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
val isCustom: Boolean? = null,
|
|
7
|
+
val typefaceName: FWSystemTypeface? = null,
|
|
8
8
|
)
|
|
@@ -21,6 +21,7 @@ data class FWVideoPlayerConfigModel(
|
|
|
21
21
|
val showVideoDetailTitle: Boolean? = null,
|
|
22
22
|
val buttonConfiguration: FWPlayerButtonConfigurationModel? = null,
|
|
23
23
|
val videoPlayerLogoConfiguration: FWVideoPlayerLogoConfigurationModel? = null,
|
|
24
|
+
val countdownTimerConfiguration: FWCountdownTimerConfigurationModel? = null,
|
|
24
25
|
) {
|
|
25
26
|
|
|
26
27
|
data class FWCtaButtonStyleModel(
|
package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt
CHANGED
|
@@ -23,6 +23,7 @@ object FWVideoPlayerConfigModelDeserializer {
|
|
|
23
23
|
private const val SHOW_VIDEO_DETAIL_TITLE_KEY = "showVideoDetailTitle"
|
|
24
24
|
private const val BUTTON_CONFIGURATION_KEY = "buttonConfiguration"
|
|
25
25
|
private const val VIDEO_PLAYER_LOGO_CONFIGURATION_KEY = "videoPlayerLogoConfiguration"
|
|
26
|
+
private const val COUNT_DOWN_TIMER_CONFIGURATION_KEY = "countdownTimerConfiguration"
|
|
26
27
|
|
|
27
28
|
private const val BACKGROUND_COLOR_KEY = "backgroundColor"
|
|
28
29
|
private const val FONT_SIZE_KEY = "fontSize"
|
|
@@ -49,6 +50,7 @@ object FWVideoPlayerConfigModelDeserializer {
|
|
|
49
50
|
val showVideoDetailTitle = if (responseJson.has(SHOW_VIDEO_DETAIL_TITLE_KEY)) responseJson.optBoolean(SHOW_VIDEO_DETAIL_TITLE_KEY) else null
|
|
50
51
|
val buttonConfigurationJsonObject = responseJson.optJSONObject(BUTTON_CONFIGURATION_KEY)
|
|
51
52
|
val videoPlayerLogoConfigurationJsonObject = responseJson.optJSONObject(VIDEO_PLAYER_LOGO_CONFIGURATION_KEY)
|
|
53
|
+
val countdownTimerConfigurationJsonObject = responseJson.optJSONObject(COUNT_DOWN_TIMER_CONFIGURATION_KEY)
|
|
52
54
|
|
|
53
55
|
return FWVideoPlayerConfigModel(
|
|
54
56
|
playerStyle = if (!playerStyle.isNullOrBlank()) FWPlayerStyle.deserialize(playerStyle) else null,
|
|
@@ -66,6 +68,7 @@ object FWVideoPlayerConfigModelDeserializer {
|
|
|
66
68
|
showVideoDetailTitle = showVideoDetailTitle,
|
|
67
69
|
buttonConfiguration = FWPlayerButtonConfigurationDeserializer.deserialize(buttonConfigurationJsonObject),
|
|
68
70
|
videoPlayerLogoConfiguration = FWVideoPlayerLogoConfigurationModelDeserializer.deserialize(videoPlayerLogoConfigurationJsonObject),
|
|
71
|
+
countdownTimerConfiguration = FWCountdownTimerConfigurationModelDeserializer.deserialize(countdownTimerConfigurationJsonObject),
|
|
69
72
|
)
|
|
70
73
|
}
|
|
71
74
|
|
package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt
CHANGED
|
@@ -23,6 +23,7 @@ object FWVideoPlayerConfigModelSerializer {
|
|
|
23
23
|
private const val SHOW_VIDEO_DETAIL_TITLE_KEY = "showVideoDetailTitle"
|
|
24
24
|
private const val BUTTON_CONFIGURATION_KEY = "buttonConfiguration"
|
|
25
25
|
private const val VIDEO_PLAYER_LOGO_CONFIGURATION_KEY = "videoPlayerLogoConfiguration"
|
|
26
|
+
private const val COUNT_DOWN_TIMER_CONFIGURATION_KEY = "countdownTimerConfiguration"
|
|
26
27
|
|
|
27
28
|
private const val BACKGROUND_COLOR_KEY = "backgroundColor"
|
|
28
29
|
private const val FONT_SIZE_KEY = "fontSize"
|
|
@@ -49,6 +50,7 @@ object FWVideoPlayerConfigModelSerializer {
|
|
|
49
50
|
jsonObject.put(SHOW_VIDEO_DETAIL_TITLE_KEY, model.showVideoDetailTitle)
|
|
50
51
|
jsonObject.put(BUTTON_CONFIGURATION_KEY, FWPlayerButtonConfigurationSerializer.serialize(model.buttonConfiguration))
|
|
51
52
|
jsonObject.put(VIDEO_PLAYER_LOGO_CONFIGURATION_KEY, FWVideoPlayerLogoConfigurationModelSerializer.serialize(model.videoPlayerLogoConfiguration))
|
|
53
|
+
jsonObject.put(COUNT_DOWN_TIMER_CONFIGURATION_KEY, FWCountdownTimerConfigurationModelSerializer.serialize(model.countdownTimerConfiguration))
|
|
52
54
|
return jsonObject
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models.enums
|
|
2
|
+
|
|
3
|
+
enum class FWAppearanceMode(val rawValue: String) {
|
|
4
|
+
Dark("dark"),
|
|
5
|
+
Light("light");
|
|
6
|
+
|
|
7
|
+
companion object {
|
|
8
|
+
fun deserialize(rawValue: String?): FWAppearanceMode? {
|
|
9
|
+
rawValue ?: return null
|
|
10
|
+
return FWAppearanceMode.values().first { it.rawValue == rawValue }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fun serialize(model: FWAppearanceMode?): String? {
|
|
14
|
+
model ?: return null
|
|
15
|
+
return model.rawValue
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CountdownTimerConfiguration.swift
|
|
3
|
+
// react-native-firework-sdk
|
|
4
|
+
//
|
|
5
|
+
// Created by linjie jiang on 1/26/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import FireworkVideo
|
|
10
|
+
|
|
11
|
+
public struct CountdownTimerConfiguration: Codable, Equatable {
|
|
12
|
+
var isHidden: Bool?
|
|
13
|
+
var appearance: AppearanceMode?
|
|
14
|
+
|
|
15
|
+
enum AppearanceMode: String, Codable {
|
|
16
|
+
/// Light Mode
|
|
17
|
+
case light
|
|
18
|
+
/// Dark Mode
|
|
19
|
+
case dark
|
|
20
|
+
|
|
21
|
+
func fwAppearanceMode() -> FireworkVideo.CountdownTimerConfiguration.AppearanceMode {
|
|
22
|
+
switch self {
|
|
23
|
+
case .dark:
|
|
24
|
+
return .dark
|
|
25
|
+
case .light:
|
|
26
|
+
return .light
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
func fwCountdownTimerConfiguration() -> FireworkVideo.CountdownTimerConfiguration {
|
|
32
|
+
var result = FireworkVideo.CountdownTimerConfiguration()
|
|
33
|
+
if let isHidden = isHidden {
|
|
34
|
+
result.isHidden = isHidden
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if let appearance = appearance {
|
|
38
|
+
result.appearance = appearance.fwAppearanceMode()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return result
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -353,6 +353,12 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate, PictureInPict
|
|
|
353
353
|
resultConfig.replayBadge.isHidden = false
|
|
354
354
|
resultConfig.fullScreenPlayerView.replayBadge.isHidden = false
|
|
355
355
|
}
|
|
356
|
+
|
|
357
|
+
if let countdownTimerConfiguration = config.countdownTimerConfiguration {
|
|
358
|
+
resultConfig.countdownTimerConfiguration = countdownTimerConfiguration.fwCountdownTimerConfiguration()
|
|
359
|
+
// swiftlint:disable:next line_length
|
|
360
|
+
resultConfig.fullScreenPlayerView.countdownTimerConfiguration = countdownTimerConfiguration.fwCountdownTimerConfiguration()
|
|
361
|
+
}
|
|
356
362
|
|
|
357
363
|
storyBlockVC.viewConfiguration = resultConfig
|
|
358
364
|
}
|
|
@@ -25,4 +25,5 @@ public class StoryBlockConfiguration: NSObject, Codable {
|
|
|
25
25
|
var showVideoDetailTitle: Bool?
|
|
26
26
|
var videoPlayerLogoConfiguration: VideoPlayerLogoConfiguration?
|
|
27
27
|
var replayBadgeConfiguration: ReplayBadgeConfiguration?
|
|
28
|
+
var countdownTimerConfiguration: CountdownTimerConfiguration?
|
|
28
29
|
}
|
|
@@ -520,6 +520,11 @@ extension VideoFeed {
|
|
|
520
520
|
} else {
|
|
521
521
|
vpcConfig.replayBadge.isHidden = false
|
|
522
522
|
}
|
|
523
|
+
|
|
524
|
+
if let countdownTimerConfiguration = config.countdownTimerConfiguration {
|
|
525
|
+
vpcConfig.countdownTimerConfiguration = countdownTimerConfiguration.fwCountdownTimerConfiguration()
|
|
526
|
+
}
|
|
527
|
+
|
|
523
528
|
return vpcConfig
|
|
524
529
|
}
|
|
525
530
|
|
|
@@ -74,4 +74,5 @@ public class VideoPlayerConfiguration: NSObject, Codable {
|
|
|
74
74
|
var showVideoDetailTitle: Bool?
|
|
75
75
|
var videoPlayerLogoConfiguration: VideoPlayerLogoConfiguration?
|
|
76
76
|
var replayBadgeConfiguration: ReplayBadgeConfiguration?
|
|
77
|
+
var countdownTimerConfiguration: CountdownTimerConfiguration?
|
|
77
78
|
}
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
891F4AF82A68DEDF00A9E8DA /* PushRNContainerParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891F4AF72A68DEDF00A9E8DA /* PushRNContainerParams.swift */; };
|
|
12
12
|
891F4AFA2A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891F4AF92A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift */; };
|
|
13
13
|
8930E1E22B5BED6100EB3512 /* FWReactNativeSDK.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8930E1E12B5BED6100EB3512 /* FWReactNativeSDK.swift */; };
|
|
14
|
+
8971610D2B637C6F006C3F7B /* ReplayBadgeConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8971610B2B637C6F006C3F7B /* ReplayBadgeConfiguration.swift */; };
|
|
15
|
+
8971610E2B637C6F006C3F7B /* VideoPlayerLogoConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8971610C2B637C6F006C3F7B /* VideoPlayerLogoConfiguration.swift */; };
|
|
16
|
+
897161102B637CA9006C3F7B /* CountdownTimerConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8971610F2B637CA9006C3F7B /* CountdownTimerConfiguration.swift */; };
|
|
14
17
|
897523872817DEF80070EBB6 /* (null) in Sources */ = {isa = PBXBuildFile; };
|
|
15
18
|
897523882817DEF80070EBB6 /* (null) in Sources */ = {isa = PBXBuildFile; };
|
|
16
19
|
897523892817DEF80070EBB6 /* (null) in Sources */ = {isa = PBXBuildFile; };
|
|
@@ -99,6 +102,9 @@
|
|
|
99
102
|
891F4AF92A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RCTConvert+FWNavigatorModule.swift"; sourceTree = "<group>"; };
|
|
100
103
|
8930E1E12B5BED6100EB3512 /* FWReactNativeSDK.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWReactNativeSDK.swift; sourceTree = "<group>"; };
|
|
101
104
|
894FADB229BAD571000FB51A /* libFireworkSdk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFireworkSdk.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
105
|
+
8971610B2B637C6F006C3F7B /* ReplayBadgeConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReplayBadgeConfiguration.swift; sourceTree = "<group>"; };
|
|
106
|
+
8971610C2B637C6F006C3F7B /* VideoPlayerLogoConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayerLogoConfiguration.swift; sourceTree = "<group>"; };
|
|
107
|
+
8971610F2B637CA9006C3F7B /* CountdownTimerConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CountdownTimerConfiguration.swift; sourceTree = "<group>"; };
|
|
102
108
|
897523632817DEF80070EBB6 /* react_native_firework_sdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = react_native_firework_sdk.h; sourceTree = "<group>"; };
|
|
103
109
|
898873132A0A8E7E0089CD1C /* UIViewController+AttachChild.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+AttachChild.swift"; sourceTree = "<group>"; };
|
|
104
110
|
898873142A0A8E7E0089CD1C /* UIView+Constraints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Constraints.swift"; sourceTree = "<group>"; };
|
|
@@ -282,6 +288,9 @@
|
|
|
282
288
|
8988733C2A0A8E7E0089CD1C /* Components */ = {
|
|
283
289
|
isa = PBXGroup;
|
|
284
290
|
children = (
|
|
291
|
+
8971610F2B637CA9006C3F7B /* CountdownTimerConfiguration.swift */,
|
|
292
|
+
8971610B2B637C6F006C3F7B /* ReplayBadgeConfiguration.swift */,
|
|
293
|
+
8971610C2B637C6F006C3F7B /* VideoPlayerLogoConfiguration.swift */,
|
|
285
294
|
8988733D2A0A8E7E0089CD1C /* StoryBlock.swift */,
|
|
286
295
|
8988733E2A0A8E7E0089CD1C /* VideoFeedManager.swift */,
|
|
287
296
|
8988733F2A0A8E7E0089CD1C /* AdConfiguration.swift */,
|
|
@@ -371,6 +380,7 @@
|
|
|
371
380
|
89DF27E128A53A89003F3CCB /* (null) in Sources */,
|
|
372
381
|
898873582A0A8E7E0089CD1C /* FireworkSDKModule.swift in Sources */,
|
|
373
382
|
898873462A0A8E7E0089CD1C /* UIViewController+AttachChild.swift in Sources */,
|
|
383
|
+
897161102B637CA9006C3F7B /* CountdownTimerConfiguration.swift in Sources */,
|
|
374
384
|
898873552A0A8E7E0089CD1C /* TrackPurchaseParameters.swift in Sources */,
|
|
375
385
|
8988735C2A0A8E7E0089CD1C /* LiveStreamModule.swift in Sources */,
|
|
376
386
|
898873642A0A8E7E0089CD1C /* FireworkEventName.swift in Sources */,
|
|
@@ -378,6 +388,7 @@
|
|
|
378
388
|
8988734E2A0A8E7E0089CD1C /* FWNavigatorModule.m in Sources */,
|
|
379
389
|
898873492A0A8E7E0089CD1C /* String+Color.swift in Sources */,
|
|
380
390
|
898873662A0A8E7E0089CD1C /* VideoFeedManager.swift in Sources */,
|
|
391
|
+
8971610D2B637C6F006C3F7B /* ReplayBadgeConfiguration.swift in Sources */,
|
|
381
392
|
89D6BBF929ACE2DC00C8AA2A /* (null) in Sources */,
|
|
382
393
|
898873592A0A8E7E0089CD1C /* AdBadgeConfiguration.swift in Sources */,
|
|
383
394
|
897523972817DEF80070EBB6 /* (null) in Sources */,
|
|
@@ -398,6 +409,7 @@
|
|
|
398
409
|
897523882817DEF80070EBB6 /* (null) in Sources */,
|
|
399
410
|
897523982817DEF80070EBB6 /* (null) in Sources */,
|
|
400
411
|
898873652A0A8E7E0089CD1C /* StoryBlock.swift in Sources */,
|
|
412
|
+
8971610E2B637C6F006C3F7B /* VideoPlayerLogoConfiguration.swift in Sources */,
|
|
401
413
|
8975239C2817DEF80070EBB6 /* (null) in Sources */,
|
|
402
414
|
898873602A0A8E7E0089CD1C /* RCTConvert+FireworkSDKModule.swift in Sources */,
|
|
403
415
|
897523942817DEF80070EBB6 /* (null) in Sources */,
|
|
@@ -283,6 +283,7 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
283
283
|
const vastAttributesString = generateVastAttributesString();
|
|
284
284
|
const productInfoViewConfigurationJsonKey = (0, _FWJsonUtil.default)(_FireworkSDK.default.getInstance().shopping.productInfoViewConfiguration);
|
|
285
285
|
const replayBadgeConfigurationJsonKey = (0, _FWJsonUtil.default)(storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.replayBadgeConfiguration);
|
|
286
|
+
const countdownTimerConfigurationJsonKey = (0, _FWJsonUtil.default)(storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.countdownTimerConfiguration);
|
|
286
287
|
let key = `gShareBaseURL:${gShareBaseURL}`;
|
|
287
288
|
|
|
288
289
|
if (_reactNative.Platform.OS === 'ios') {
|
|
@@ -337,6 +338,7 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
337
338
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
338
339
|
key += `_productInfoViewConfiguration:${productInfoViewConfigurationJsonKey}`;
|
|
339
340
|
key += `_replayBadgeConfiguration:${replayBadgeConfigurationJsonKey}`;
|
|
341
|
+
key += `_countdownTimerConfiguration:${countdownTimerConfigurationJsonKey}`;
|
|
340
342
|
return key;
|
|
341
343
|
};
|
|
342
344
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["StoryBlock.tsx"],"names":["NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","sdkInitCalled","setSdkInitCalled","FWGlobalState","getInstance","loadedRef","forceUpdate","x","handleStoryBlockLoadFinished","event","FWLoggerUtil","log","nativeEvent","name","onStoryBlockLoadFinished","onStoryBlockEmpty","reason","error","current","handleStoryBlockEmpty","handleStoryBlockDidStartPictureInPicture","JSON","stringify","onStoryBlockDidStartPictureInPicture","handleStoryBlockDidStopPictureInPicture","onStoryBlockDidStopPictureInPicture","handleStoryBlockGetFeedId","onStoryBlockGetFeedId","feedId","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","generateButtonInfoString","buttonInfo","imageName","systemImageName","tintColor","getStoryBlockConfiguration","storyBlockConfiguration","enablePictureInPicture","resultStoryBlockConfiguration","generateKey","gShareBaseURL","FireworkSDK","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","hashtagFilterExpression","productIds","contentId","cornerRadius","dynamicContentParametersString","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","toFixed","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","buttonConfiguration","videoPlayerLogoConfigurationJsonKey","videoPlayerLogoConfiguration","ctaWidth","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","productInfoViewConfigurationJsonKey","shopping","productInfoViewConfiguration","replayBadgeConfigurationJsonKey","replayBadgeConfiguration","Platform","OS","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","console","sendCommand","command","nativeNodeHandle","commandId","UIManager","getViewManagerConfig","Commands","toString","reactTag","dispatchViewManagerCommand","play","pause","openFullscreen","onViewportEntered","onViewportLeft","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","subscriptionOfProductInfoViewConfigurationUpdated","ProductInfoViewConfigurationUpdated","remove","setTimeout","viewId","create","sdkInitCalledPromise","then","style","otherProps","assign","borderRadius","undefined"],"mappings":";;;;;;;AACA;;AASA;;AASA;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,cAA5B;;AAgHA,MAAMC,UAGL,GAAG,CAACC,KAAD,EAA0BC,YAA1B,KAA2C;AAC7C,QAAMC,kBAAkB,GAAG,mBAAO,IAAP,CAA3B;AACA,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxCC,uBAAcC,WAAd,GAA4BH,aADY,CAA1C;AAGA,QAAMI,SAAS,GAAG,mBAAgB,KAAhB,CAAlB;AACA,QAAM,GAAGC,WAAH,IAAkB,uBAAYC,CAAD,IAAOA,CAAC,GAAG,CAAtB,EAAyB,CAAzB,CAAxB;;AAEA,QAAMC,4BAA4B,GAAIC,KAAD,IAAsC;AACzEC,0BAAa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BE,IAAA,qBAAqB,EAAEE;AAhBzB,KADF;AAoBD,CAxcD;;4BA0ce,uBAAW7B,UAAX,C","sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useReducer,\n useRef,\n useState,\n} from 'react';\n\nimport {\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type { StoryBlockConfiguration } from '../models/StoryBlockConfiguration';\nimport type StoryBlockNativeConfiguration from '../models/StoryBlockNativeConfiguration';\nimport type { StoryBlockSource } from '../models/StoryBlockSource';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWStoryBlock from './FWStoryBlock';\nimport type ButtonInfo from '../models/ButtonInfo';\nimport gennerateJsonKey from '../utils/FWJsonUtil';\n\nconst NativeComponentName = 'FWStoryBlock';\n\nexport interface IStoryBlockMethods {\n /**\n * Play the story block.\n */\n play: () => void;\n /**\n * Pause the story block.\n */\n pause: () => void;\n /**\n * Open the fullscreen story block.\n * Only supported on Android.\n */\n openFullscreen: () => void;\n /**\n * Triggered when the story block enters the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportEntered: () => void;\n /**\n * Triggered when the story block leaves the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportLeft: () => void;\n}\n\n/**\n * The props type of StoryBlock component.\n */\nexport interface IStoryBlockProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of four available story block sources.\n */\n source: StoryBlockSource;\n /**\n * Channel id of the story block. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the story block. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * The dynamic content parameters of the story block. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.\n * Queries are specified with boolean predicates on what hashtags are there on the video.\n * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.\n * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.\n */\n hashtagFilterExpression?: string;\n /**\n * Product ids used to generate the sku feed\n */\n productIds?: string[];\n /**\n * The video or live stream id.\n */\n contentId?: string;\n /**\n * Specifies if Picture in Picture is enabled. Only supported on iOS.\n */\n enablePictureInPicture?: boolean;\n /**\n * The corner radius of story block.\n */\n cornerRadius?: number;\n /**\n * Ad configuration of the feed.\n */\n adConfiguration?: AdConfiguration;\n\n /* The configuration of the story block. */\n storyBlockConfiguration?: StoryBlockConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onStoryBlockLoadFinished?: (error?: FWError) => void;\n /**\n * The callback is triggered when there are no items in the story block.\n * The callback is triggered in the following cases:\n * 1. Loading successfully but the back end returns an empty list.\n * 2. The load failed and list is empty.\n * onStoryBlockLoadFinished will also be triggered when onStoryBlockEmpty is triggered.\n */\n onStoryBlockEmpty?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStopPictureInPicture?: (error?: FWError) => void;\n /**\n *\n * The host app could use this callback to get feed id.\n * The feed id can be used for conversion tracking.\n */\n onStoryBlockGetFeedId?: (feedId: string) => void;\n}\n\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [sdkInitCalled, setSdkInitCalled] = useState<boolean>(\n FWGlobalState.getInstance().sdkInitCalled\n );\n const loadedRef = useRef<boolean>(false);\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n\n const handleStoryBlockLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`\n );\n\n const { onStoryBlockLoadFinished, onStoryBlockEmpty } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n let error: FWError = { name };\n if (reason) {\n error.reason = reason;\n }\n\n onStoryBlockLoadFinished(error);\n if (!loadedRef.current) {\n onStoryBlockEmpty?.(error);\n }\n } else {\n onStoryBlockLoadFinished();\n loadedRef.current = true;\n }\n }\n };\n\n const handleStoryBlockEmpty = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(`StoryBlock handleStoryBlockEmpty ${event.nativeEvent}`);\n\n const { onStoryBlockEmpty } = props;\n\n if (onStoryBlockEmpty) {\n onStoryBlockEmpty();\n }\n };\n\n const handleStoryBlockDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStartPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStartPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStartPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStartPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStopPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStopPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStopPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStopPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockGetFeedId = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockGetFeedId ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockGetFeedId } = props;\n\n const { feedId } = event.nativeEvent;\n\n if (onStoryBlockGetFeedId) {\n onStoryBlockGetFeedId(feedId ?? '');\n }\n };\n\n const generateDynamicContentParametersString = (): string => {\n const { dynamicContentParameters } = props;\n\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n };\n\n const generateVastAttributesString = () => {\n const { adConfiguration } = props;\n const vastAttributes = adConfiguration?.vastAttributes;\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name ?? ''}:${attribute.value}`;\n }\n\n return resultString;\n };\n\n const generateButtonInfoString = (buttonInfo?: ButtonInfo) => {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\n };\n\n const getStoryBlockConfiguration: () =>\n | StoryBlockNativeConfiguration\n | undefined = () => {\n const { storyBlockConfiguration, enablePictureInPicture } = props;\n let resultStoryBlockConfiguration:\n | StoryBlockNativeConfiguration\n | undefined = storyBlockConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultStoryBlockConfiguration) {\n resultStoryBlockConfiguration = {};\n }\n resultStoryBlockConfiguration = {\n ...resultStoryBlockConfiguration,\n enablePictureInPicture,\n };\n }\n return resultStoryBlockConfiguration;\n };\n const storyBlockConfiguration = getStoryBlockConfiguration();\n\n const generateKey = (): string => {\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL;\n const appLanguage = FireworkSDK.getInstance().appLanguage;\n const videoLaunchBehavior = FireworkSDK.getInstance().videoLaunchBehavior;\n const adBadgeConfiguration = FireworkSDK.getInstance().adBadgeConfiguration;\n const adBadgeTextType = adBadgeConfiguration?.badgeTextType;\n const backgroundColorOfAdBadge = adBadgeConfiguration?.backgroundColor;\n const textColorOfAdBadge = adBadgeConfiguration?.textColor;\n const androidFontIsCustomOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.isCustom;\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n hashtagFilterExpression,\n productIds,\n contentId,\n enablePictureInPicture,\n cornerRadius,\n adConfiguration,\n } = props;\n const dynamicContentParametersString =\n generateDynamicContentParametersString();\n\n const playerStyle = storyBlockConfiguration?.playerStyle;\n const videoCompleteAction = storyBlockConfiguration?.videoCompleteAction;\n const showShareButton = storyBlockConfiguration?.showShareButton;\n const showPlaybackButton = storyBlockConfiguration?.showPlaybackButton;\n const showMuteButton = storyBlockConfiguration?.showMuteButton;\n const showBranding = storyBlockConfiguration?.showBranding;\n const ctaDelayType = storyBlockConfiguration?.ctaDelay?.type;\n const ctaDelayValue = storyBlockConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n storyBlockConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = storyBlockConfiguration?.shareBaseURL;\n const buttonConfiguration = storyBlockConfiguration?.buttonConfiguration;\n const videoPlayerLogoConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.videoPlayerLogoConfiguration\n );\n const ctaWidth = storyBlockConfiguration?.ctaWidth;\n const showVideoDetailTitle = storyBlockConfiguration?.showVideoDetailTitle;\n\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = generateVastAttributesString();\n const productInfoViewConfigurationJsonKey = gennerateJsonKey(\n FireworkSDK.getInstance().shopping.productInfoViewConfiguration\n );\n const replayBadgeConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.replayBadgeConfiguration\n );\n\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n if (Platform.OS === 'android') {\n key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;\n key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;\n }\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `productIds:${productIds?.join(',')}`;\n key += `_contentId:${contentId}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_cornerRadius:${cornerRadius}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n if (Platform.OS === 'android') {\n key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;\n }\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_productInfoViewConfiguration:${productInfoViewConfigurationJsonKey}`;\n key += `_replayBadgeConfiguration:${replayBadgeConfigurationJsonKey}`;\n\n return key;\n };\n\n const key = generateKey();\n\n console.log('story block key', key);\n\n useImperativeHandle(\n forwardedRef,\n () => {\n const sendCommand = (command: string) => {\n const nativeNodeHandle = findNodeHandle(nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands[command];\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n let reactTag: number | null = findNodeHandle(nativeNodeHandle);\n FWLoggerUtil.log(\n `StoryBlock sendCommand: ${command} commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`\n );\n if (!nativeNodeHandle || !reactTag) {\n return;\n }\n UIManager.dispatchViewManagerCommand(reactTag, commandId, []);\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\n },\n openFullscreen: () => {\n sendCommand('openFullscreen');\n },\n onViewportEntered: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportEntered');\n },\n onViewportLeft: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportLeft');\n },\n };\n },\n []\n );\n\n useEffect(() => {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n forceUpdate();\n }\n );\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfProductInfoViewConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ProductInfoViewConfigurationUpdated,\n () => {\n FWLoggerUtil.log(\n 'Receive FWEventName.ProductInfoViewConfigurationUpdated'\n );\n forceUpdate();\n }\n );\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.remove();\n subscriptionOfProductInfoViewConfigurationUpdated.remove();\n };\n }, []);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n setTimeout(() => {\n const viewId = findNodeHandle(nativeComponentRef.current);\n FWLoggerUtil.log(`StoryBlock createFragment viewId: ${viewId}`);\n if (!viewId) {\n return;\n }\n UIManager.dispatchViewManagerCommand(\n viewId,\n UIManager.getViewManagerConfig(\n NativeComponentName\n ).Commands.create.toString(),\n [viewId]\n );\n }, 500);\n }\n }, [key]);\n\n useEffect(() => {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n setSdkInitCalled(true);\n });\n }, []);\n\n if (!sdkInitCalled) {\n return null;\n }\n const { style, cornerRadius, ...otherProps } = props;\n return (\n <FWStoryBlock\n ref={nativeComponentRef}\n key={key}\n {...otherProps}\n cornerRadius={cornerRadius}\n style={Object.assign({ borderRadius: cornerRadius }, style)}\n storyBlockConfiguration={storyBlockConfiguration}\n enablePictureInPicture={undefined}\n onStoryBlockLoadFinished={handleStoryBlockLoadFinished}\n onStoryBlockEmpty={handleStoryBlockEmpty}\n onStoryBlockDidStartPictureInPicture={\n handleStoryBlockDidStartPictureInPicture\n }\n onStoryBlockDidStopPictureInPicture={\n handleStoryBlockDidStopPictureInPicture\n }\n onStoryBlockGetFeedId={handleStoryBlockGetFeedId}\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
|
|
1
|
+
{"version":3,"sources":["StoryBlock.tsx"],"names":["NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","sdkInitCalled","setSdkInitCalled","FWGlobalState","getInstance","loadedRef","forceUpdate","x","handleStoryBlockLoadFinished","event","FWLoggerUtil","log","nativeEvent","name","onStoryBlockLoadFinished","onStoryBlockEmpty","reason","error","current","handleStoryBlockEmpty","handleStoryBlockDidStartPictureInPicture","JSON","stringify","onStoryBlockDidStartPictureInPicture","handleStoryBlockDidStopPictureInPicture","onStoryBlockDidStopPictureInPicture","handleStoryBlockGetFeedId","onStoryBlockGetFeedId","feedId","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","generateButtonInfoString","buttonInfo","imageName","systemImageName","tintColor","getStoryBlockConfiguration","storyBlockConfiguration","enablePictureInPicture","resultStoryBlockConfiguration","generateKey","gShareBaseURL","FireworkSDK","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","hashtagFilterExpression","productIds","contentId","cornerRadius","dynamicContentParametersString","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","toFixed","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","buttonConfiguration","videoPlayerLogoConfigurationJsonKey","videoPlayerLogoConfiguration","ctaWidth","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","productInfoViewConfigurationJsonKey","shopping","productInfoViewConfiguration","replayBadgeConfigurationJsonKey","replayBadgeConfiguration","countdownTimerConfigurationJsonKey","countdownTimerConfiguration","Platform","OS","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","console","sendCommand","command","nativeNodeHandle","commandId","UIManager","getViewManagerConfig","Commands","toString","reactTag","dispatchViewManagerCommand","play","pause","openFullscreen","onViewportEntered","onViewportLeft","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","subscriptionOfProductInfoViewConfigurationUpdated","ProductInfoViewConfigurationUpdated","remove","setTimeout","viewId","create","sdkInitCalledPromise","then","style","otherProps","assign","borderRadius","undefined"],"mappings":";;;;;;;AACA;;AASA;;A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,GAJD,EAIG,EAJH;;AAMA,MAAI,CAACD,aAAL,EAAoB;AAClB,WAAO,IAAP;AACD;;AACD,QAAM;AAAEuJ,IAAAA,KAAF;AAAS1E,IAAAA,YAAT;AAAuB,OAAG2E;AAA1B,MAAyC3J,KAA/C;AACA,sBACE,6BAAC,qBAAD;AACE,IAAA,GAAG,EAAEE,kBADP;AAEE,IAAA,GAAG,EAAEoC;AAFP,KAGMqH,UAHN;AAIE,IAAA,YAAY,EAAE3E,YAJhB;AAKE,IAAA,KAAK,EAAE7C,MAAM,CAACyH,MAAP,CAAc;AAAEC,MAAAA,YAAY,EAAE7E;AAAhB,KAAd,EAA8C0E,KAA9C,CALT;AAME,IAAA,uBAAuB,EAAErG,uBAN3B;AAOE,IAAA,sBAAsB,EAAEyG,SAP1B;AAQE,IAAA,wBAAwB,EAAEpJ,4BAR5B;AASE,IAAA,iBAAiB,EAAEW,qBATrB;AAUE,IAAA,oCAAoC,EAClCC,wCAXJ;AAaE,IAAA,mCAAmC,EACjCI,uCAdJ;AAgBE,IAAA,qBAAqB,EAAEE;AAhBzB,KADF;AAoBD,CA5cD;;4BA8ce,uBAAW7B,UAAX,C","sourcesContent":["import type { ForwardRefRenderFunction } from 'react';\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useReducer,\n useRef,\n useState,\n} from 'react';\n\nimport {\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type { StoryBlockConfiguration } from '../models/StoryBlockConfiguration';\nimport type StoryBlockNativeConfiguration from '../models/StoryBlockNativeConfiguration';\nimport type { StoryBlockSource } from '../models/StoryBlockSource';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWStoryBlock from './FWStoryBlock';\nimport type ButtonInfo from '../models/ButtonInfo';\nimport gennerateJsonKey from '../utils/FWJsonUtil';\n\nconst NativeComponentName = 'FWStoryBlock';\n\nexport interface IStoryBlockMethods {\n /**\n * Play the story block.\n */\n play: () => void;\n /**\n * Pause the story block.\n */\n pause: () => void;\n /**\n * Open the fullscreen story block.\n * Only supported on Android.\n */\n openFullscreen: () => void;\n /**\n * Triggered when the story block enters the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportEntered: () => void;\n /**\n * Triggered when the story block leaves the viewport.\n * Only supported on iOS.\n * It is recommended that the host app is triggered when listening for scrolling.\n */\n onViewportLeft: () => void;\n}\n\n/**\n * The props type of StoryBlock component.\n */\nexport interface IStoryBlockProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of four available story block sources.\n */\n source: StoryBlockSource;\n /**\n * Channel id of the story block. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the story block. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * The dynamic content parameters of the story block. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.\n * Queries are specified with boolean predicates on what hashtags are there on the video.\n * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.\n * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.\n */\n hashtagFilterExpression?: string;\n /**\n * Product ids used to generate the sku feed\n */\n productIds?: string[];\n /**\n * The video or live stream id.\n */\n contentId?: string;\n /**\n * Specifies if Picture in Picture is enabled. Only supported on iOS.\n */\n enablePictureInPicture?: boolean;\n /**\n * The corner radius of story block.\n */\n cornerRadius?: number;\n /**\n * Ad configuration of the feed.\n */\n adConfiguration?: AdConfiguration;\n\n /* The configuration of the story block. */\n storyBlockConfiguration?: StoryBlockConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onStoryBlockLoadFinished?: (error?: FWError) => void;\n /**\n * The callback is triggered when there are no items in the story block.\n * The callback is triggered in the following cases:\n * 1. Loading successfully but the back end returns an empty list.\n * 2. The load failed and list is empty.\n * onStoryBlockLoadFinished will also be triggered when onStoryBlockEmpty is triggered.\n */\n onStoryBlockEmpty?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onStoryBlockDidStopPictureInPicture?: (error?: FWError) => void;\n /**\n *\n * The host app could use this callback to get feed id.\n * The feed id can be used for conversion tracking.\n */\n onStoryBlockGetFeedId?: (feedId: string) => void;\n}\n\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [sdkInitCalled, setSdkInitCalled] = useState<boolean>(\n FWGlobalState.getInstance().sdkInitCalled\n );\n const loadedRef = useRef<boolean>(false);\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n\n const handleStoryBlockLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`\n );\n\n const { onStoryBlockLoadFinished, onStoryBlockEmpty } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n let error: FWError = { name };\n if (reason) {\n error.reason = reason;\n }\n\n onStoryBlockLoadFinished(error);\n if (!loadedRef.current) {\n onStoryBlockEmpty?.(error);\n }\n } else {\n onStoryBlockLoadFinished();\n loadedRef.current = true;\n }\n }\n };\n\n const handleStoryBlockEmpty = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(`StoryBlock handleStoryBlockEmpty ${event.nativeEvent}`);\n\n const { onStoryBlockEmpty } = props;\n\n if (onStoryBlockEmpty) {\n onStoryBlockEmpty();\n }\n };\n\n const handleStoryBlockDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStartPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStartPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStartPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStartPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockDidStopPictureInPicture } = props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onStoryBlockDidStopPictureInPicture({ name, reason });\n } else {\n onStoryBlockDidStopPictureInPicture({ name });\n }\n } else {\n onStoryBlockDidStopPictureInPicture();\n }\n }\n };\n\n const handleStoryBlockGetFeedId = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockGetFeedId ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onStoryBlockGetFeedId } = props;\n\n const { feedId } = event.nativeEvent;\n\n if (onStoryBlockGetFeedId) {\n onStoryBlockGetFeedId(feedId ?? '');\n }\n };\n\n const generateDynamicContentParametersString = (): string => {\n const { dynamicContentParameters } = props;\n\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n };\n\n const generateVastAttributesString = () => {\n const { adConfiguration } = props;\n const vastAttributes = adConfiguration?.vastAttributes;\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name ?? ''}:${attribute.value}`;\n }\n\n return resultString;\n };\n\n const generateButtonInfoString = (buttonInfo?: ButtonInfo) => {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\n };\n\n const getStoryBlockConfiguration: () =>\n | StoryBlockNativeConfiguration\n | undefined = () => {\n const { storyBlockConfiguration, enablePictureInPicture } = props;\n let resultStoryBlockConfiguration:\n | StoryBlockNativeConfiguration\n | undefined = storyBlockConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultStoryBlockConfiguration) {\n resultStoryBlockConfiguration = {};\n }\n resultStoryBlockConfiguration = {\n ...resultStoryBlockConfiguration,\n enablePictureInPicture,\n };\n }\n return resultStoryBlockConfiguration;\n };\n const storyBlockConfiguration = getStoryBlockConfiguration();\n\n const generateKey = (): string => {\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL;\n const appLanguage = FireworkSDK.getInstance().appLanguage;\n const videoLaunchBehavior = FireworkSDK.getInstance().videoLaunchBehavior;\n const adBadgeConfiguration = FireworkSDK.getInstance().adBadgeConfiguration;\n const adBadgeTextType = adBadgeConfiguration?.badgeTextType;\n const backgroundColorOfAdBadge = adBadgeConfiguration?.backgroundColor;\n const textColorOfAdBadge = adBadgeConfiguration?.textColor;\n const androidFontIsCustomOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.isCustom;\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n hashtagFilterExpression,\n productIds,\n contentId,\n enablePictureInPicture,\n cornerRadius,\n adConfiguration,\n } = props;\n const dynamicContentParametersString =\n generateDynamicContentParametersString();\n\n const playerStyle = storyBlockConfiguration?.playerStyle;\n const videoCompleteAction = storyBlockConfiguration?.videoCompleteAction;\n const showShareButton = storyBlockConfiguration?.showShareButton;\n const showPlaybackButton = storyBlockConfiguration?.showPlaybackButton;\n const showMuteButton = storyBlockConfiguration?.showMuteButton;\n const showBranding = storyBlockConfiguration?.showBranding;\n const ctaDelayType = storyBlockConfiguration?.ctaDelay?.type;\n const ctaDelayValue = storyBlockConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n storyBlockConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = storyBlockConfiguration?.shareBaseURL;\n const buttonConfiguration = storyBlockConfiguration?.buttonConfiguration;\n const videoPlayerLogoConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.videoPlayerLogoConfiguration\n );\n const ctaWidth = storyBlockConfiguration?.ctaWidth;\n const showVideoDetailTitle = storyBlockConfiguration?.showVideoDetailTitle;\n\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = generateVastAttributesString();\n const productInfoViewConfigurationJsonKey = gennerateJsonKey(\n FireworkSDK.getInstance().shopping.productInfoViewConfiguration\n );\n const replayBadgeConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.replayBadgeConfiguration\n );\n const countdownTimerConfigurationJsonKey = gennerateJsonKey(\n storyBlockConfiguration?.countdownTimerConfiguration\n );\n\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n if (Platform.OS === 'android') {\n key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;\n key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;\n }\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `productIds:${productIds?.join(',')}`;\n key += `_contentId:${contentId}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_cornerRadius:${cornerRadius}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n if (Platform.OS === 'android') {\n key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;\n }\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_productInfoViewConfiguration:${productInfoViewConfigurationJsonKey}`;\n key += `_replayBadgeConfiguration:${replayBadgeConfigurationJsonKey}`;\n key += `_countdownTimerConfiguration:${countdownTimerConfigurationJsonKey}`;\n\n return key;\n };\n\n const key = generateKey();\n\n console.log('story block key', key);\n\n useImperativeHandle(\n forwardedRef,\n () => {\n const sendCommand = (command: string) => {\n const nativeNodeHandle = findNodeHandle(nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands[command];\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n let reactTag: number | null = findNodeHandle(nativeNodeHandle);\n FWLoggerUtil.log(\n `StoryBlock sendCommand: ${command} commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`\n );\n if (!nativeNodeHandle || !reactTag) {\n return;\n }\n UIManager.dispatchViewManagerCommand(reactTag, commandId, []);\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\n },\n openFullscreen: () => {\n sendCommand('openFullscreen');\n },\n onViewportEntered: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportEntered');\n },\n onViewportLeft: () => {\n if (Platform.OS !== 'ios') {\n return;\n }\n sendCommand('onViewportLeft');\n },\n };\n },\n []\n );\n\n useEffect(() => {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n forceUpdate();\n }\n );\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n forceUpdate();\n }\n );\n\n const subscriptionOfProductInfoViewConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ProductInfoViewConfigurationUpdated,\n () => {\n FWLoggerUtil.log(\n 'Receive FWEventName.ProductInfoViewConfigurationUpdated'\n );\n forceUpdate();\n }\n );\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.remove();\n subscriptionOfProductInfoViewConfigurationUpdated.remove();\n };\n }, []);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n setTimeout(() => {\n const viewId = findNodeHandle(nativeComponentRef.current);\n FWLoggerUtil.log(`StoryBlock createFragment viewId: ${viewId}`);\n if (!viewId) {\n return;\n }\n UIManager.dispatchViewManagerCommand(\n viewId,\n UIManager.getViewManagerConfig(\n NativeComponentName\n ).Commands.create.toString(),\n [viewId]\n );\n }, 500);\n }\n }, [key]);\n\n useEffect(() => {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n setSdkInitCalled(true);\n });\n }, []);\n\n if (!sdkInitCalled) {\n return null;\n }\n const { style, cornerRadius, ...otherProps } = props;\n return (\n <FWStoryBlock\n ref={nativeComponentRef}\n key={key}\n {...otherProps}\n cornerRadius={cornerRadius}\n style={Object.assign({ borderRadius: cornerRadius }, style)}\n storyBlockConfiguration={storyBlockConfiguration}\n enablePictureInPicture={undefined}\n onStoryBlockLoadFinished={handleStoryBlockLoadFinished}\n onStoryBlockEmpty={handleStoryBlockEmpty}\n onStoryBlockDidStartPictureInPicture={\n handleStoryBlockDidStartPictureInPicture\n }\n onStoryBlockDidStopPictureInPicture={\n handleStoryBlockDidStopPictureInPicture\n }\n onStoryBlockGetFeedId={handleStoryBlockGetFeedId}\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
|
|
@@ -334,6 +334,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
334
334
|
const ctaWidth = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.ctaWidth;
|
|
335
335
|
const buttonConfiguration = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.buttonConfiguration;
|
|
336
336
|
const videoPlayerLogoConfigurationJsonKey = (0, _FWJsonUtil.default)(videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.videoPlayerLogoConfiguration);
|
|
337
|
+
const countdownTimerConfigurationJsonKey = (0, _FWJsonUtil.default)(videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.countdownTimerConfiguration);
|
|
337
338
|
const showVideoDetailTitle = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.showVideoDetailTitle;
|
|
338
339
|
const requiresAds = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.requiresAds;
|
|
339
340
|
const adsFetchTimeout = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.adsFetchTimeout;
|
|
@@ -414,6 +415,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
414
415
|
key += `_buttonConfiguration.playButton:${this._generateButtonInfoString(buttonConfiguration === null || buttonConfiguration === void 0 ? void 0 : buttonConfiguration.playButton)}`;
|
|
415
416
|
key += `_buttonConfiguration.pauseButton:${this._generateButtonInfoString(buttonConfiguration === null || buttonConfiguration === void 0 ? void 0 : buttonConfiguration.pauseButton)}`;
|
|
416
417
|
key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;
|
|
418
|
+
key += `_countdownTimerConfiguration:${countdownTimerConfigurationJsonKey}`;
|
|
417
419
|
key += `_showVideoDetailTitle:${showVideoDetailTitle}`;
|
|
418
420
|
}
|
|
419
421
|
|