react-native-firework-sdk 2.2.4 → 2.3.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/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +2 -9
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +2 -9
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +2 -9
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +9 -9
- package/android/build.gradle +9 -39
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradle.properties +7 -5
- package/android/proguard-rules.pro +5 -26
- package/android/src/main/AndroidManifest.xml +0 -3
- package/android/src/main/java/com/fireworksdk/bridge/FireworkSDKPackage.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/components/base/FWBaseFragment.kt +10 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +157 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFrameLayout.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +15 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +6 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +5 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelSerializer.kt +22 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModel.kt +3 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelSerializer.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModel.kt +8 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModelDeserializer.kt +35 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModelSerializer.kt +27 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +5 -15
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +2 -9
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationSerializer.kt +42 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModel.kt +3 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelSerializer.kt +20 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResult.kt +3 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +2 -13
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultSerializer.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +8 -9
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +17 -6
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelSerializer.kt +59 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +14 -15
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +14 -4
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt +56 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +11 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +11 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +11 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +63 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProduct.kt +4 -11
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductSerializer.kt +82 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWBadgeTextType.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWCtaButtonTextValue.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWCtaDelayType.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/{FWEventName.kt → enums/FWEventName.kt} +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWGradientDrawableOrientation.kt +24 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWPlayerLaunchBehavior.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWPlayerStyle.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWShoppingCtaResultRes.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWSystemTypeface.kt +21 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoCompleteAction.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedMode.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedSource.kt +22 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedTitlePosition.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoPlayerCTAWidth.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +22 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +61 -32
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +3 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +0 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +0 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +0 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +0 -6
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +25 -32
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +24 -47
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +17 -44
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWBundleUtils.kt +46 -21
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +165 -86
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWFragmentUtil.kt +51 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +1 -5
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +77 -80
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLiveStreamUtil.kt +17 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWSingletonHolder.kt +25 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWStatusBarUtil.kt +28 -0
- package/android/src/main/res/layout/fw_bridge_story_block.xml +5 -12
- package/ios/Components/VideoFeed.swift +39 -19
- package/ios/Components/VideoFeedConfiguration.swift +4 -5
- package/ios/Components/VideoFeedManager.swift +1 -1
- package/ios/Components/VideoPlayerConfiguration.swift +17 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +197 -205
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +23 -8
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +1 -18
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +4 -1
- package/ios/Models/NativeToRN/FireworkEventName.swift +0 -1
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +1 -1
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +6 -157
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +1 -21
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -2
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +1 -12
- package/ios/Modules/LiveStream/LiveStreamModule.m +1 -1
- package/ios/Modules/LiveStream/LiveStreamModule.swift +4 -2
- package/ios/Modules/Shopping/FWCartViewController.swift +0 -75
- package/ios/Modules/Shopping/ShoppingModule.m +1 -3
- package/ios/Modules/Shopping/ShoppingModule.swift +12 -47
- package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +1 -1
- package/lib/commonjs/FireworkSDK.js +31 -15
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +43 -30
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +124 -82
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +112 -24
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/GradientDrawable.js +2 -0
- package/lib/commonjs/models/GradientDrawable.js.map +1 -0
- package/lib/commonjs/models/StoryBlockConfiguration.js +6 -0
- package/lib/commonjs/models/StoryBlockConfiguration.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCTADelay.js +2 -0
- package/lib/commonjs/models/VideoPlayerCTADelay.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCTAStyle.js +6 -0
- package/lib/commonjs/models/VideoPlayerCTAStyle.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCTAWidth.js +2 -0
- package/lib/commonjs/models/VideoPlayerCTAWidth.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerCompleteAction.js +2 -0
- package/lib/commonjs/models/VideoPlayerCompleteAction.js.map +1 -0
- package/lib/commonjs/models/VideoPlayerStyle.js +2 -0
- package/lib/commonjs/models/VideoPlayerStyle.js.map +1 -0
- package/lib/commonjs/modules/LiveStreamModule.js.map +1 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/commonjs/utils/FWGlobalState.js +47 -0
- package/lib/commonjs/utils/FWGlobalState.js.map +1 -0
- package/lib/module/FireworkSDK.js +30 -14
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +43 -29
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +113 -73
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +113 -24
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/GradientDrawable.js +2 -0
- package/lib/module/models/GradientDrawable.js.map +1 -0
- package/lib/module/models/StoryBlockConfiguration.js +2 -0
- package/lib/module/models/StoryBlockConfiguration.js.map +1 -0
- package/lib/module/models/VideoPlayerCTADelay.js +2 -0
- package/lib/module/models/VideoPlayerCTADelay.js.map +1 -0
- package/lib/module/models/VideoPlayerCTAStyle.js +2 -0
- package/lib/module/models/VideoPlayerCTAStyle.js.map +1 -0
- package/lib/module/models/VideoPlayerCTAWidth.js +2 -0
- package/lib/module/models/VideoPlayerCTAWidth.js.map +1 -0
- package/lib/module/models/VideoPlayerCompleteAction.js +2 -0
- package/lib/module/models/VideoPlayerCompleteAction.js.map +1 -0
- package/lib/module/models/VideoPlayerStyle.js +2 -0
- package/lib/module/models/VideoPlayerStyle.js.map +1 -0
- package/lib/module/modules/LiveStreamModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/module/utils/FWGlobalState.js +39 -0
- package/lib/module/utils/FWGlobalState.js.map +1 -0
- package/lib/typescript/FireworkSDK.d.ts +7 -7
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +17 -18
- package/lib/typescript/components/StoryBlock.d.ts +2 -0
- package/lib/typescript/components/VideoFeed.d.ts +7 -3
- package/lib/typescript/index.d.ts +10 -3
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +9 -2
- package/lib/typescript/models/FWEvents.d.ts +9 -9
- package/lib/typescript/models/GradientDrawable.d.ts +5 -0
- package/lib/typescript/models/IOSFontInfo.d.ts +2 -0
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +1 -1
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +37 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +25 -4
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +1 -0
- package/lib/typescript/models/VideoPlayerCTADelay.d.ts +11 -0
- package/lib/typescript/models/VideoPlayerCTAStyle.d.ts +21 -0
- package/lib/typescript/models/VideoPlayerCTAWidth.d.ts +1 -0
- package/lib/typescript/models/VideoPlayerCompleteAction.d.ts +1 -0
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +9 -34
- package/lib/typescript/models/VideoPlayerStyle.d.ts +1 -0
- package/lib/typescript/modules/LiveStreamModule.d.ts +1 -1
- package/lib/typescript/modules/ShoppingModule.d.ts +2 -3
- package/lib/typescript/utils/FWGlobalState.d.ts +10 -0
- package/package.json +5 -3
- package/react-native-firework-sdk.podspec +2 -1
- package/src/FireworkSDK.ts +47 -19
- package/src/LiveStream.ts +4 -2
- package/src/VideoShopping.ts +47 -39
- package/src/components/StoryBlock.tsx +161 -98
- package/src/components/VideoFeed.tsx +147 -23
- package/src/index.ts +14 -6
- package/src/models/AdBadgeConfiguration.ts +10 -2
- package/src/models/FWEvents.ts +11 -11
- package/src/models/GradientDrawable.ts +14 -0
- package/src/models/IOSFontInfo.ts +2 -0
- package/src/models/ProductInfoViewConfiguration.ts +1 -1
- package/src/models/StoryBlockConfiguration.ts +38 -0
- package/src/models/VideoFeedConfiguration.ts +25 -4
- package/src/models/VideoPlaybackDetails.ts +1 -0
- package/src/models/VideoPlayerCTADelay.ts +11 -0
- package/src/models/VideoPlayerCTAStyle.ts +22 -0
- package/src/models/VideoPlayerCTAWidth.ts +1 -0
- package/src/models/VideoPlayerCompleteAction.ts +1 -0
- package/src/models/VideoPlayerConfiguration.ts +9 -36
- package/src/models/VideoPlayerStyle.ts +1 -0
- package/src/modules/LiveStreamModule.ts +1 -1
- package/src/modules/ShoppingModule.ts +2 -3
- package/src/utils/FWGlobalState.ts +31 -0
- package/android/publish.gradle +0 -66
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFragment.kt +0 -129
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +0 -90
- package/android/src/main/java/com/fireworksdk/bridge/constants/FWVideoPlayerConstant.kt +0 -39
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSystemTypeface.kt +0 -9
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedModel.kt +0 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +0 -10
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedTitlePosition.kt +0 -7
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContainerActivity.kt +0 -53
- package/android/src/main/res/layout/fw_bridge_fragment_container.xml +0 -8
- package/ios/Modules/FWNavigatorModule/FWNavigatorContainerViewController.swift +0 -33
- package/ios/Modules/FWNavigatorModule/FWNavigatorProtocol.swift +0 -18
|
@@ -15,6 +15,8 @@ var _FWEventName = require("../models/FWEventName");
|
|
|
15
15
|
|
|
16
16
|
var _FireworkSDKModule = require("../modules/FireworkSDKModule");
|
|
17
17
|
|
|
18
|
+
var _FWGlobalState = _interopRequireDefault(require("../utils/FWGlobalState"));
|
|
19
|
+
|
|
18
20
|
var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
|
|
19
21
|
|
|
20
22
|
var _FWStoryBlock = _interopRequireDefault(require("./FWStoryBlock"));
|
|
@@ -32,73 +34,8 @@ const NativeComponentName = 'FWStoryBlock';
|
|
|
32
34
|
const StoryBlock = (props, forwardedRef) => {
|
|
33
35
|
const nativeComponentRef = (0, _react.useRef)(null);
|
|
34
36
|
const [isFullscreenState, setIsFullscreenState] = (0, _react.useState)(false);
|
|
37
|
+
const [sdkInitCalled, setSdkInitCalled] = (0, _react.useState)(_FWGlobalState.default.getInstance().sdkInitCalled);
|
|
35
38
|
const [, forceUpdate] = (0, _react.useReducer)(x => x + 1, 0);
|
|
36
|
-
(0, _react.useImperativeHandle)(forwardedRef, () => {
|
|
37
|
-
const sendCommand = command => {
|
|
38
|
-
const nativeNodeHandle = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
|
|
39
|
-
|
|
40
|
-
let commandId = _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands[command];
|
|
41
|
-
|
|
42
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
43
|
-
commandId = commandId.toString();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
_reactNative.UIManager.dispatchViewManagerCommand((0, _reactNative.findNodeHandle)(nativeNodeHandle), commandId, []);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
play: () => {
|
|
51
|
-
sendCommand('play');
|
|
52
|
-
},
|
|
53
|
-
pause: () => {
|
|
54
|
-
sendCommand('pause');
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}, []);
|
|
58
|
-
(0, _react.useEffect)(() => {
|
|
59
|
-
const subscriptionOfShareBaseURLUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.ShareBaseURLUpdated, () => {
|
|
60
|
-
_FWLoggerUtil.default.log('Receive FWEventName.ShareBaseURLUpdated');
|
|
61
|
-
|
|
62
|
-
forceUpdate();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const subscriptionOfAdBadgeConfigurationUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AdBadgeConfigurationUpdated, () => {
|
|
66
|
-
_FWLoggerUtil.default.log('Receive FWEventName.AdBadgeConfigurationUpdated');
|
|
67
|
-
|
|
68
|
-
forceUpdate();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const subscriptionOfVideoLaunchBehaviorUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.VideoLaunchBehaviorUpdated, () => {
|
|
72
|
-
_FWLoggerUtil.default.log('Receive FWEventName.VideoLaunchBehaviorUpdated');
|
|
73
|
-
|
|
74
|
-
forceUpdate();
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const subscriptionOfAppLanguageUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AppLanguageUpdated, () => {
|
|
78
|
-
_FWLoggerUtil.default.log('Receive FWEventName.AppLanguageUpdated');
|
|
79
|
-
|
|
80
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
81
|
-
forceUpdate();
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
86
|
-
setTimeout(() => {
|
|
87
|
-
const viewId = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
|
|
88
|
-
|
|
89
|
-
_FWLoggerUtil.default.log(`StoryBlock createFragment viewId: ${viewId}`);
|
|
90
|
-
|
|
91
|
-
_reactNative.UIManager.dispatchViewManagerCommand(viewId, _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands.create.toString(), [viewId]);
|
|
92
|
-
}, 500);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return () => {
|
|
96
|
-
subscriptionOfShareBaseURLUpdated.remove();
|
|
97
|
-
subscriptionOfAdBadgeConfigurationUpdated.remove();
|
|
98
|
-
subscriptionOfVideoLaunchBehaviorUpdated.remove();
|
|
99
|
-
subscriptionOfAppLanguageUpdated.remove();
|
|
100
|
-
};
|
|
101
|
-
}, []);
|
|
102
39
|
|
|
103
40
|
const handleStoryBlockLoadFinished = event => {
|
|
104
41
|
_FWLoggerUtil.default.log(`StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`);
|
|
@@ -129,8 +66,8 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
129
66
|
}
|
|
130
67
|
};
|
|
131
68
|
|
|
132
|
-
const
|
|
133
|
-
_FWLoggerUtil.default.log(`StoryBlock
|
|
69
|
+
const handleStoryBlockFullScreenStateChanged = event => {
|
|
70
|
+
_FWLoggerUtil.default.log(`StoryBlock handleStoryBlockFullScreenStateChanged ${event.nativeEvent.isFullScreen}`);
|
|
134
71
|
|
|
135
72
|
const {
|
|
136
73
|
isFullScreen
|
|
@@ -192,25 +129,38 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
192
129
|
};
|
|
193
130
|
|
|
194
131
|
const generateKey = () => {
|
|
195
|
-
var _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _FireworkSDK$getInsta3, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3,
|
|
132
|
+
var _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _FireworkSDK$getInsta3, _FireworkSDK$getInsta4, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3, _adBadgeConfiguration4, _adBadgeConfiguration5, _adBadgeConfiguration6, _adBadgeConfiguration7, _adBadgeConfiguration8, _storyBlockConfigurat, _storyBlockConfigurat2, _storyBlockConfigurat3, _storyBlockConfigurat4, _storyBlockConfigurat5, _storyBlockConfigurat6, _storyBlockConfigurat7, _storyBlockConfigurat8, _storyBlockConfigurat9, _storyBlockConfigurat10, _storyBlockConfigurat11, _storyBlockConfigurat12, _storyBlockConfigurat13, _storyBlockConfigurat14, _storyBlockConfigurat15, _storyBlockConfigurat16, _storyBlockConfigurat17, _storyBlockConfigurat18, _storyBlockConfigurat19, _adConfiguration$requ, _adConfiguration$requ2, _adConfiguration$adsF;
|
|
196
133
|
|
|
197
134
|
const gShareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
|
|
198
135
|
const appLanguage = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().appLanguage) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : '';
|
|
199
|
-
const
|
|
136
|
+
const videoLaunchBehavior = (_FireworkSDK$getInsta3 = _FireworkSDK.default.getInstance().videoLaunchBehavior) !== null && _FireworkSDK$getInsta3 !== void 0 ? _FireworkSDK$getInsta3 : '';
|
|
137
|
+
const adBadgeConfiguration = (_FireworkSDK$getInsta4 = _FireworkSDK.default.getInstance().adBadgeConfiguration) !== null && _FireworkSDK$getInsta4 !== void 0 ? _FireworkSDK$getInsta4 : {};
|
|
200
138
|
const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
|
|
201
139
|
const backgroundColorOfAdBadge = (_adBadgeConfiguration2 = adBadgeConfiguration.backgroundColor) !== null && _adBadgeConfiguration2 !== void 0 ? _adBadgeConfiguration2 : '';
|
|
202
140
|
const textColorOfAdBadge = (_adBadgeConfiguration3 = adBadgeConfiguration.textColor) !== null && _adBadgeConfiguration3 !== void 0 ? _adBadgeConfiguration3 : '';
|
|
203
|
-
const
|
|
141
|
+
const androidFontIsCustomOfAdBadge = (_adBadgeConfiguration4 = (_adBadgeConfiguration5 = adBadgeConfiguration.androidFontInfo) === null || _adBadgeConfiguration5 === void 0 ? void 0 : (_adBadgeConfiguration6 = _adBadgeConfiguration5.isCustom) === null || _adBadgeConfiguration6 === void 0 ? void 0 : _adBadgeConfiguration6.toString()) !== null && _adBadgeConfiguration4 !== void 0 ? _adBadgeConfiguration4 : '';
|
|
142
|
+
const androidFontTypefaceNameOfAdBadge = (_adBadgeConfiguration7 = (_adBadgeConfiguration8 = adBadgeConfiguration.androidFontInfo) === null || _adBadgeConfiguration8 === void 0 ? void 0 : _adBadgeConfiguration8.typefaceName) !== null && _adBadgeConfiguration7 !== void 0 ? _adBadgeConfiguration7 : '';
|
|
204
143
|
const {
|
|
205
144
|
source,
|
|
206
145
|
channel = '',
|
|
207
146
|
playlist = '',
|
|
208
147
|
hashtagFilterExpression = '',
|
|
209
148
|
enablePictureInPicture = false,
|
|
210
|
-
adConfiguration
|
|
149
|
+
adConfiguration,
|
|
150
|
+
storyBlockConfiguration
|
|
211
151
|
} = props;
|
|
212
152
|
const dynamicContentParametersString = generateDynamicContentParametersString();
|
|
213
|
-
const
|
|
153
|
+
const videoCompleteAction = (_storyBlockConfigurat = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.videoCompleteAction) !== null && _storyBlockConfigurat !== void 0 ? _storyBlockConfigurat : '';
|
|
154
|
+
const showShareButton = (_storyBlockConfigurat2 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat3 = storyBlockConfiguration.showShareButton) === null || _storyBlockConfigurat3 === void 0 ? void 0 : _storyBlockConfigurat3.toString()) !== null && _storyBlockConfigurat2 !== void 0 ? _storyBlockConfigurat2 : '';
|
|
155
|
+
const showPlaybackButton = (_storyBlockConfigurat4 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat5 = storyBlockConfiguration.showPlaybackButton) === null || _storyBlockConfigurat5 === void 0 ? void 0 : _storyBlockConfigurat5.toString()) !== null && _storyBlockConfigurat4 !== void 0 ? _storyBlockConfigurat4 : '';
|
|
156
|
+
const showBranding = (_storyBlockConfigurat6 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat7 = storyBlockConfiguration.showBranding) === null || _storyBlockConfigurat7 === void 0 ? void 0 : _storyBlockConfigurat7.toString()) !== null && _storyBlockConfigurat6 !== void 0 ? _storyBlockConfigurat6 : '';
|
|
157
|
+
const ctaDelayType = (_storyBlockConfigurat8 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat9 = storyBlockConfiguration.ctaDelay) === null || _storyBlockConfigurat9 === void 0 ? void 0 : _storyBlockConfigurat9.type) !== null && _storyBlockConfigurat8 !== void 0 ? _storyBlockConfigurat8 : '';
|
|
158
|
+
const ctaDelayValue = (_storyBlockConfigurat10 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat11 = storyBlockConfiguration.ctaDelay) === null || _storyBlockConfigurat11 === void 0 ? void 0 : (_storyBlockConfigurat12 = _storyBlockConfigurat11.value) === null || _storyBlockConfigurat12 === void 0 ? void 0 : _storyBlockConfigurat12.toFixed(5)) !== null && _storyBlockConfigurat10 !== void 0 ? _storyBlockConfigurat10 : '';
|
|
159
|
+
const ctaHighlightDelayType = (_storyBlockConfigurat13 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat14 = storyBlockConfiguration.ctaHighlightDelay) === null || _storyBlockConfigurat14 === void 0 ? void 0 : _storyBlockConfigurat14.type) !== null && _storyBlockConfigurat13 !== void 0 ? _storyBlockConfigurat13 : '';
|
|
160
|
+
const ctaHighlightDelayValue = (_storyBlockConfigurat15 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : (_storyBlockConfigurat16 = storyBlockConfiguration.ctaHighlightDelay) === null || _storyBlockConfigurat16 === void 0 ? void 0 : (_storyBlockConfigurat17 = _storyBlockConfigurat16.value) === null || _storyBlockConfigurat17 === void 0 ? void 0 : _storyBlockConfigurat17.toFixed(5)) !== null && _storyBlockConfigurat15 !== void 0 ? _storyBlockConfigurat15 : '';
|
|
161
|
+
const shareBaseURL = (_storyBlockConfigurat18 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.shareBaseURL) !== null && _storyBlockConfigurat18 !== void 0 ? _storyBlockConfigurat18 : '';
|
|
162
|
+
const ctaWidth = (_storyBlockConfigurat19 = storyBlockConfiguration === null || storyBlockConfiguration === void 0 ? void 0 : storyBlockConfiguration.ctaWidth) !== null && _storyBlockConfigurat19 !== void 0 ? _storyBlockConfigurat19 : '';
|
|
163
|
+
const requiresAds = (_adConfiguration$requ = adConfiguration === null || adConfiguration === void 0 ? void 0 : (_adConfiguration$requ2 = adConfiguration.requiresAds) === null || _adConfiguration$requ2 === void 0 ? void 0 : _adConfiguration$requ2.toString()) !== null && _adConfiguration$requ !== void 0 ? _adConfiguration$requ : '';
|
|
214
164
|
const adsFetchTimeout = (_adConfiguration$adsF = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.adsFetchTimeout) !== null && _adConfiguration$adsF !== void 0 ? _adConfiguration$adsF : 10;
|
|
215
165
|
const vastAttributesString = generateVastAttributesString();
|
|
216
166
|
let key = `gShareBaseURL:${gShareBaseURL}`;
|
|
@@ -219,22 +169,115 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
219
169
|
key += `_appLanguage:${appLanguage}`;
|
|
220
170
|
}
|
|
221
171
|
|
|
172
|
+
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
222
173
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
223
174
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
224
175
|
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
225
|
-
|
|
176
|
+
|
|
177
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
178
|
+
key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;
|
|
179
|
+
key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;
|
|
180
|
+
}
|
|
181
|
+
|
|
226
182
|
key += `_source:${source}`;
|
|
227
183
|
key += `_channel:${channel}`;
|
|
228
184
|
key += `_playlist:${playlist}`;
|
|
229
185
|
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
230
186
|
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
231
187
|
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
188
|
+
key += `_shareBaseURL:${shareBaseURL}`;
|
|
189
|
+
|
|
190
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
191
|
+
key += `_videoCompleteAction:${videoCompleteAction}`;
|
|
192
|
+
key += `_showShareButton:${showShareButton}`;
|
|
193
|
+
key += `_showPlaybackButton:${showPlaybackButton}`;
|
|
194
|
+
key += `_showBranding:${showBranding}`;
|
|
195
|
+
key += `_ctaDelayType:${ctaDelayType}`;
|
|
196
|
+
key += `_ctaDelayValue:${ctaDelayValue}`;
|
|
197
|
+
key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;
|
|
198
|
+
key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;
|
|
199
|
+
key += `_ctaWidth:${ctaWidth}`;
|
|
200
|
+
}
|
|
201
|
+
|
|
232
202
|
key += `_requiresAds:${requiresAds}`;
|
|
233
203
|
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
234
204
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
235
205
|
return key;
|
|
236
206
|
};
|
|
237
207
|
|
|
208
|
+
const key = generateKey();
|
|
209
|
+
(0, _react.useImperativeHandle)(forwardedRef, () => {
|
|
210
|
+
const sendCommand = command => {
|
|
211
|
+
const nativeNodeHandle = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
|
|
212
|
+
|
|
213
|
+
let commandId = _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands[command];
|
|
214
|
+
|
|
215
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
216
|
+
commandId = commandId.toString();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
_reactNative.UIManager.dispatchViewManagerCommand((0, _reactNative.findNodeHandle)(nativeNodeHandle), commandId, []);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
return {
|
|
223
|
+
play: () => {
|
|
224
|
+
sendCommand('play');
|
|
225
|
+
},
|
|
226
|
+
pause: () => {
|
|
227
|
+
sendCommand('pause');
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}, []);
|
|
231
|
+
(0, _react.useEffect)(() => {
|
|
232
|
+
const subscriptionOfShareBaseURLUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.ShareBaseURLUpdated, () => {
|
|
233
|
+
_FWLoggerUtil.default.log('Receive FWEventName.ShareBaseURLUpdated');
|
|
234
|
+
|
|
235
|
+
forceUpdate();
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
const subscriptionOfAdBadgeConfigurationUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AdBadgeConfigurationUpdated, () => {
|
|
239
|
+
_FWLoggerUtil.default.log('Receive FWEventName.AdBadgeConfigurationUpdated');
|
|
240
|
+
|
|
241
|
+
forceUpdate();
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
const subscriptionOfVideoLaunchBehaviorUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.VideoLaunchBehaviorUpdated, () => {
|
|
245
|
+
_FWLoggerUtil.default.log('Receive FWEventName.VideoLaunchBehaviorUpdated');
|
|
246
|
+
|
|
247
|
+
forceUpdate();
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const subscriptionOfAppLanguageUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AppLanguageUpdated, () => {
|
|
251
|
+
_FWLoggerUtil.default.log('Receive FWEventName.AppLanguageUpdated');
|
|
252
|
+
|
|
253
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
254
|
+
forceUpdate();
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
return () => {
|
|
259
|
+
subscriptionOfShareBaseURLUpdated.remove();
|
|
260
|
+
subscriptionOfAdBadgeConfigurationUpdated.remove();
|
|
261
|
+
subscriptionOfVideoLaunchBehaviorUpdated.remove();
|
|
262
|
+
subscriptionOfAppLanguageUpdated.remove();
|
|
263
|
+
};
|
|
264
|
+
}, []);
|
|
265
|
+
(0, _react.useEffect)(() => {
|
|
266
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
267
|
+
setTimeout(() => {
|
|
268
|
+
const viewId = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
|
|
269
|
+
|
|
270
|
+
_FWLoggerUtil.default.log(`StoryBlock createFragment viewId: ${viewId}`);
|
|
271
|
+
|
|
272
|
+
_reactNative.UIManager.dispatchViewManagerCommand(viewId, _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands.create.toString(), [viewId]);
|
|
273
|
+
}, 500);
|
|
274
|
+
}
|
|
275
|
+
}, [key]);
|
|
276
|
+
(0, _react.useEffect)(() => {
|
|
277
|
+
_FWGlobalState.default.getInstance().sdkInitCalledPromise.then(() => {
|
|
278
|
+
setSdkInitCalled(true);
|
|
279
|
+
});
|
|
280
|
+
}, []);
|
|
238
281
|
(0, _react.useEffect)(() => {
|
|
239
282
|
if (_reactNative.Platform.OS === 'android') {
|
|
240
283
|
const onBackPress = () => {
|
|
@@ -256,18 +299,17 @@ const StoryBlock = (props, forwardedRef) => {
|
|
|
256
299
|
|
|
257
300
|
return;
|
|
258
301
|
}, [isFullscreenState]);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
302
|
+
|
|
303
|
+
if (!sdkInitCalled) {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
|
|
262
307
|
return /*#__PURE__*/_react.default.createElement(_FWStoryBlock.default, _extends({
|
|
263
308
|
ref: nativeComponentRef,
|
|
264
|
-
key:
|
|
309
|
+
key: key
|
|
265
310
|
}, props, {
|
|
266
311
|
onStoryBlockLoadFinished: handleStoryBlockLoadFinished,
|
|
267
|
-
onStoryBlockFullScreenStateChanged:
|
|
268
|
-
style: Object.assign({}, style, {
|
|
269
|
-
zIndex: -1
|
|
270
|
-
})
|
|
312
|
+
onStoryBlockFullScreenStateChanged: handleStoryBlockFullScreenStateChanged
|
|
271
313
|
}));
|
|
272
314
|
};
|
|
273
315
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["StoryBlock.tsx"],"names":["NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","isFullscreenState","setIsFullscreenState","forceUpdate","x","sendCommand","command","nativeNodeHandle","current","commandId","UIManager","getViewManagerConfig","Commands","Platform","OS","toString","dispatchViewManagerCommand","play","pause","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","FWLoggerUtil","log","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","setTimeout","viewId","create","remove","handleStoryBlockLoadFinished","event","nativeEvent","name","onStoryBlockLoadFinished","reason","handleStoryBlockFullscreenStateChanged","isFullScreen","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","generateKey","gShareBaseURL","FireworkSDK","getInstance","shareBaseURL","appLanguage","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","videoLaunchBehavior","source","channel","playlist","hashtagFilterExpression","enablePictureInPicture","dynamicContentParametersString","requiresAds","adsFetchTimeout","vastAttributesString","onBackPress","navigator","popNativeContainer","subscription","BackHandler","addEventListener","style","assign","zIndex"],"mappings":";;;;;;;AACA;;AASA;;AAUA;;AAGA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,cAA5B;;AA0DA,MAAMC,UAGL,GAAG,CAACC,KAAD,EAA0BC,YAA1B,KAA2C;AAC7C,QAAMC,kBAAkB,GAAG,mBAAO,IAAP,CAA3B;AACA,QAAM,CAACC,iBAAD,EAAoBC,oBAApB,IAA4C,qBAAkB,KAAlB,CAAlD;AACA,QAAM,GAAGC,WAAH,IAAkB,uBAAYC,CAAD,IAAOA,CAAC,GAAG,CAAtB,EAAyB,CAAzB,CAAxB;AACA,kCACEL,YADF,EAEE,MAAM;AACJ,UAAMM,WAAW,GAAIC,OAAD,IAAqB;AACvC,YAAMC,gBAAgB,GAAG,iCAAeP,kBAAkB,CAACQ,OAAlC,CAAzB;;AAEA,UAAIC,SAA0B,GAC5BC,uBAAUC,oBAAV,CAA+Bf,mBAA/B,EAAoDgB,QAApD,CAA6DN,OAA7D,CADF;;AAEA,UAAIO,sBAASC,EAAT,KAAgB,SAApB,EAA+B;AAC7BL,QAAAA,SAAS,GAAGA,SAAS,CAACM,QAAV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,MAAM,EAAE,CAAC;AAAX,KAAzB;AART,KADF;AAYD,CA1PD;;4BA4Pe,uBAAW9F,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 BackHandler,\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 { StoryBlockSource } from '../models/StoryBlockSource';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWStoryBlock from './FWStoryBlock';\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\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 * Specifies if Picture in Picture is enabled. Only supported on iOS.\n */\n enablePictureInPicture?: boolean;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onStoryBlockLoadFinished?: (error?: FWError) => void;\n}\n\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [isFullscreenState, setIsFullscreenState] = useState<boolean>(false);\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\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\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\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 if (Platform.OS === 'android') {\n forceUpdate();\n }\n }\n );\n\n if (Platform.OS === 'android') {\n setTimeout(() => {\n const viewId = findNodeHandle(nativeComponentRef.current);\n FWLoggerUtil.log(`StoryBlock createFragment viewId: ${viewId}`);\n UIManager.dispatchViewManagerCommand(\n viewId,\n UIManager.getViewManagerConfig(\n NativeComponentName\n ).Commands.create.toString(),\n [viewId]\n );\n }, 500);\n }\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.remove();\n };\n }, []);\n\n const handleStoryBlockLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`\n );\n\n const { onStoryBlockLoadFinished } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n if (reason) {\n onStoryBlockLoadFinished({ name, reason });\n } else {\n onStoryBlockLoadFinished({ name });\n }\n } else {\n onStoryBlockLoadFinished();\n }\n }\n };\n\n const handleStoryBlockFullscreenStateChanged = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockFullscreenStateChanged ${event.nativeEvent.isFullScreen}`\n );\n const { isFullScreen } = event.nativeEvent;\n setIsFullscreenState(isFullScreen);\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 generateKey = (): string => {\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const videoLaunchBehavior =\n FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';\n\n const {\n source,\n channel = '',\n playlist = '',\n hashtagFilterExpression = '',\n enablePictureInPicture = false,\n adConfiguration,\n } = props;\n const dynamicContentParametersString =\n generateDynamicContentParametersString();\n\n const requiresAds = adConfiguration?.requiresAds ?? false;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = generateVastAttributesString();\n\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n\n return key;\n };\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const onBackPress = () => {\n if (isFullscreenState) {\n FireworkSDK.getInstance().navigator.popNativeContainer();\n return true;\n }\n return false;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n onBackPress\n );\n return () => {\n subscription.remove();\n };\n }\n\n return;\n }, [isFullscreenState]);\n\n const { style } = props;\n return (\n <FWStoryBlock\n ref={nativeComponentRef}\n key={generateKey()}\n {...props}\n onStoryBlockLoadFinished={handleStoryBlockLoadFinished}\n onStoryBlockFullScreenStateChanged={\n handleStoryBlockFullscreenStateChanged\n }\n style={Object.assign({}, style, { zIndex: -1 })}\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
|
|
1
|
+
{"version":3,"sources":["StoryBlock.tsx"],"names":["NativeComponentName","StoryBlock","props","forwardedRef","nativeComponentRef","isFullscreenState","setIsFullscreenState","sdkInitCalled","setSdkInitCalled","FWGlobalState","getInstance","forceUpdate","x","handleStoryBlockLoadFinished","event","FWLoggerUtil","log","nativeEvent","name","onStoryBlockLoadFinished","reason","handleStoryBlockFullScreenStateChanged","isFullScreen","generateDynamicContentParametersString","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","key","value","valueString","join","length","generateVastAttributesString","adConfiguration","vastAttributes","attribute","generateKey","gShareBaseURL","FireworkSDK","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","toString","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","hashtagFilterExpression","enablePictureInPicture","storyBlockConfiguration","dynamicContentParametersString","videoCompleteAction","showShareButton","showPlaybackButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","toFixed","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","ctaWidth","requiresAds","adsFetchTimeout","vastAttributesString","Platform","OS","sendCommand","command","nativeNodeHandle","current","commandId","UIManager","getViewManagerConfig","Commands","dispatchViewManagerCommand","play","pause","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","remove","setTimeout","viewId","create","sdkInitCalledPromise","then","onBackPress","navigator","popNativeContainer","subscription","BackHandler","addEventListener"],"mappings":";;;;;;;AACA;;AASA;;AAUA;;AAGA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,mBAAmB,GAAG,cAA5B;;AA8DA,MAAMC,UAGL,GAAG,CAACC,KAAD,EAA0BC,YAA1B,KAA2C;AAC7C,QAAMC,kBAAkB,GAAG,mBAAO,IAAP,CAA3B;AACA,QAAM,CAACC,iBAAD,EAAoBC,oBAApB,IAA4C,qBAAkB,KAAlB,CAAlD;AACA,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,qBACxCC,uBAAcC,WAAd,GAA4BH,aADY,CAA1C;AAGA,QAAM,GAAGI,WAAH,IAAkB,uBAAYC,CAAD,IAAOA,CAAC,GAAG,CAAtB,EAAyB,CAAzB,CAAxB;;AAEA,QAAMC,4BAA4B,GAAIC,KAAD,IAAsC;AACzEC,0BAAaC,GAAb,CACG,2CAA0CF,KAAK,CAACG,WAAN,CAAkBC,IAAK,EADpE;;AAIA,UAAM;AAAEC,MAAAA;AAAF,QAA+BjB,KAArC;AACA,UAAM;AAAEgB,MAAAA,IAAF;AAAQE,MAAAA;AAAR,QAAmBN,KAAK,CAACG,WAA/B;;AAEA,QAAIE,wBAAJ,EAA8B;AAC5B,UAAID,IAAJ,EAAU;AACR,YAAIE,MAAJ,EAAY;AACVD,UAAAA,wBAAwB,CAAC;AAAED,YAAAA,IAAF;AAAQE,YAAAA;AAAR,WAAD,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BAAaC,GAAb,CAAkB,qCAAoC2F,MAAO,EAA7D;;AACAnB,+BAAUG,0BAAV,CACEgB,MADF,EAEEnB,uBAAUC,oBAAV,CACEzF,mBADF,EAEE0F,QAFF,CAEWkB,MAFX,CAEkBrD,QAFlB,EAFF,EAKE,CAACoD,MAAD,CALF;AAOD,OAVS,EAUP,GAVO,CAAV;AAWD;AACF,GAdD,EAcG,CAAC7E,GAAD,CAdH;AAgBA,wBAAU,MAAM;AACdrB,2BAAcC,WAAd,GAA4BmG,oBAA5B,CAAiDC,IAAjD,CAAsD,MAAM;AAC1DtG,MAAAA,gBAAgB,CAAC,IAAD,CAAhB;AACD,KAFD;AAGD,GAJD,EAIG,EAJH;AAMA,wBAAU,MAAM;AACd,QAAIyE,sBAASC,EAAT,KAAgB,SAApB,EAA+B;AAC7B,YAAM6B,WAAW,GAAG,MAAM;AACxB,YAAI1G,iBAAJ,EAAuB;AACrBoC,+BAAY/B,WAAZ,GAA0BsG,SAA1B,CAAoCC,kBAApC;;AACA,iBAAO,IAAP;AACD;;AACD,eAAO,KAAP;AACD,OAND;;AAOA,YAAMC,YAAY,GAAGC,yBAAYC,gBAAZ,CACnB,mBADmB,EAEnBL,WAFmB,CAArB;;AAIA,aAAO,MAAM;AACXG,QAAAA,YAAY,CAACT,MAAb;AACD,OAFD;AAGD;;AAED;AACD,GAnBD,EAmBG,CAACpG,iBAAD,CAnBH;;AAqBA,MAAI,CAACE,aAAL,EAAoB;AAClB,WAAO,IAAP;AACD;;AAED,sBACE,6BAAC,qBAAD;AACE,IAAA,GAAG,EAAEH,kBADP;AAEE,IAAA,GAAG,EAAE0B;AAFP,KAGM5B,KAHN;AAIE,IAAA,wBAAwB,EAAEW,4BAJ5B;AAKE,IAAA,kCAAkC,EAChCQ;AANJ,KADF;AAWD,CAnTD;;4BAqTe,uBAAWpB,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 BackHandler,\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 { StoryBlockSource } from '../models/StoryBlockSource';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWStoryBlock from './FWStoryBlock';\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\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 * Specifies if Picture in Picture is enabled. Only supported on iOS.\n */\n enablePictureInPicture?: boolean;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n\n /* The configuration of the story block.\n Only supported on Android.*/\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\nconst StoryBlock: ForwardRefRenderFunction<\n IStoryBlockMethods,\n IStoryBlockProps\n> = (props: IStoryBlockProps, forwardedRef) => {\n const nativeComponentRef = useRef(null);\n const [isFullscreenState, setIsFullscreenState] = useState<boolean>(false);\n const [sdkInitCalled, setSdkInitCalled] = useState<boolean>(\n FWGlobalState.getInstance().sdkInitCalled\n );\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 } = props;\n const { name, reason } = event.nativeEvent;\n\n if (onStoryBlockLoadFinished) {\n if (name) {\n if (reason) {\n onStoryBlockLoadFinished({ name, reason });\n } else {\n onStoryBlockLoadFinished({ name });\n }\n } else {\n onStoryBlockLoadFinished();\n }\n }\n };\n\n const handleStoryBlockFullScreenStateChanged = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `StoryBlock handleStoryBlockFullScreenStateChanged ${event.nativeEvent.isFullScreen}`\n );\n const { isFullScreen } = event.nativeEvent;\n setIsFullscreenState(isFullScreen);\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 generateKey = (): string => {\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';\n const videoLaunchBehavior =\n FireworkSDK.getInstance().videoLaunchBehavior ?? '';\n const adBadgeConfiguration =\n 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?.toString() ?? '';\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration.androidFontInfo?.typefaceName ?? '';\n\n const {\n source,\n channel = '',\n playlist = '',\n hashtagFilterExpression = '',\n enablePictureInPicture = false,\n adConfiguration,\n storyBlockConfiguration,\n } = props;\n const dynamicContentParametersString =\n generateDynamicContentParametersString();\n\n const videoCompleteAction =\n storyBlockConfiguration?.videoCompleteAction ?? '';\n const showShareButton =\n storyBlockConfiguration?.showShareButton?.toString() ?? '';\n const showPlaybackButton =\n storyBlockConfiguration?.showPlaybackButton?.toString() ?? '';\n const showBranding =\n storyBlockConfiguration?.showBranding?.toString() ?? '';\n const ctaDelayType = storyBlockConfiguration?.ctaDelay?.type ?? '';\n const ctaDelayValue =\n 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 ctaWidth = storyBlockConfiguration?.ctaWidth ?? '';\n\n const requiresAds = adConfiguration?.requiresAds?.toString() ?? '';\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = generateVastAttributesString();\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 += `_enablePictureInPicture:${enablePictureInPicture}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n if (Platform.OS === 'android') {\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\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 }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n\n return key;\n };\n\n const key = generateKey();\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\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n return {\n play: () => {\n sendCommand('play');\n },\n pause: () => {\n sendCommand('pause');\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 if (Platform.OS === 'android') {\n forceUpdate();\n }\n }\n );\n\n return () => {\n subscriptionOfShareBaseURLUpdated.remove();\n subscriptionOfAdBadgeConfigurationUpdated.remove();\n subscriptionOfVideoLaunchBehaviorUpdated.remove();\n subscriptionOfAppLanguageUpdated.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 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 useEffect(() => {\n if (Platform.OS === 'android') {\n const onBackPress = () => {\n if (isFullscreenState) {\n FireworkSDK.getInstance().navigator.popNativeContainer();\n return true;\n }\n return false;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n onBackPress\n );\n return () => {\n subscription.remove();\n };\n }\n\n return;\n }, [isFullscreenState]);\n\n if (!sdkInitCalled) {\n return null;\n }\n\n return (\n <FWStoryBlock\n ref={nativeComponentRef}\n key={key}\n {...props}\n onStoryBlockLoadFinished={handleStoryBlockLoadFinished}\n onStoryBlockFullScreenStateChanged={\n handleStoryBlockFullScreenStateChanged\n }\n />\n );\n};\n\nexport default forwardRef(StoryBlock);\n"]}
|
|
@@ -15,6 +15,8 @@ var _FWEventName = require("../models/FWEventName");
|
|
|
15
15
|
|
|
16
16
|
var _FireworkSDKModule = require("../modules/FireworkSDKModule");
|
|
17
17
|
|
|
18
|
+
var _FWGlobalState = _interopRequireDefault(require("../utils/FWGlobalState"));
|
|
19
|
+
|
|
18
20
|
var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
|
|
19
21
|
|
|
20
22
|
var _FWVideoFeed = _interopRequireDefault(require("./FWVideoFeed"));
|
|
@@ -31,8 +33,11 @@ const NativeComponentName = 'FWVideoFeed';
|
|
|
31
33
|
*/
|
|
32
34
|
|
|
33
35
|
class VideoFeed extends _react.default.Component {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @ignore
|
|
38
|
+
*/
|
|
39
|
+
constructor(props) {
|
|
40
|
+
super(props);
|
|
36
41
|
|
|
37
42
|
_defineProperty(this, "_nativeComponentRef", /*#__PURE__*/_react.default.createRef());
|
|
38
43
|
|
|
@@ -80,6 +85,10 @@ class VideoFeed extends _react.default.Component {
|
|
|
80
85
|
}
|
|
81
86
|
}
|
|
82
87
|
});
|
|
88
|
+
|
|
89
|
+
this.state = {
|
|
90
|
+
sdkInitCalled: _FWGlobalState.default.getInstance().sdkInitCalled
|
|
91
|
+
};
|
|
83
92
|
}
|
|
84
93
|
|
|
85
94
|
/**
|
|
@@ -88,6 +97,14 @@ class VideoFeed extends _react.default.Component {
|
|
|
88
97
|
componentDidMount() {
|
|
89
98
|
_FWLoggerUtil.default.log(`VideoFeed componentDidMount ${JSON.stringify(this.props)}`);
|
|
90
99
|
|
|
100
|
+
if (!this.state.sdkInitCalled) {
|
|
101
|
+
_FWGlobalState.default.getInstance().sdkInitCalledPromise.then(() => {
|
|
102
|
+
this.setState({
|
|
103
|
+
sdkInitCalled: true
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
91
108
|
const subscriptionOfShareBaseURLUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.ShareBaseURLUpdated, () => {
|
|
92
109
|
_FWLoggerUtil.default.log('Receive FWEventName.ShareBaseURLUpdated');
|
|
93
110
|
|
|
@@ -142,17 +159,23 @@ class VideoFeed extends _react.default.Component {
|
|
|
142
159
|
|
|
143
160
|
|
|
144
161
|
render() {
|
|
145
|
-
var _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _FireworkSDK$getInsta3, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3,
|
|
162
|
+
var _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _FireworkSDK$getInsta3, _FireworkSDK$getInsta4, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3, _adBadgeConfiguration4, _adBadgeConfiguration5, _adBadgeConfiguration6, _adBadgeConfiguration7, _adBadgeConfiguration8, _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3, _videoFeedConfigurati4, _videoFeedConfigurati5, _videoFeedConfigurati6, _videoFeedConfigurati7, _videoFeedConfigurati8, _videoFeedConfigurati9, _videoFeedConfigurati10, _videoFeedConfigurati11, _videoFeedConfigurati12, _videoFeedConfigurati13, _videoFeedConfigurati14, _videoFeedConfigurati15, _videoFeedConfigurati16, _videoFeedConfigurati17, _videoFeedConfigurati18, _videoFeedConfigurati19, _videoFeedConfigurati20, _videoFeedConfigurati21, _videoFeedConfigurati22, _videoFeedConfigurati23, _videoFeedConfigurati24, _videoFeedConfigurati25, _videoFeedConfigurati26, _videoFeedConfigurati27, _videoPlayerConfigura, _videoPlayerConfigura2, _videoPlayerConfigura3, _videoPlayerConfigura4, _videoPlayerConfigura5, _videoPlayerConfigura6, _videoPlayerConfigura7, _videoPlayerConfigura8, _videoPlayerConfigura9, _videoPlayerConfigura10, _videoPlayerConfigura11, _videoPlayerConfigura12, _videoPlayerConfigura13, _videoPlayerConfigura14, _videoPlayerConfigura15, _videoPlayerConfigura16, _videoPlayerConfigura17, _videoPlayerConfigura18, _videoPlayerConfigura19, _videoPlayerConfigura20, _adConfiguration$requ, _adConfiguration$requ2, _adConfiguration$adsF;
|
|
163
|
+
|
|
164
|
+
_FWLoggerUtil.default.log(`VideoFeed render props ${JSON.stringify(this.props)} state ${JSON.stringify(this.state)}`);
|
|
146
165
|
|
|
147
|
-
|
|
166
|
+
if (!this.state.sdkInitCalled) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
148
169
|
|
|
149
170
|
const gShareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
|
|
150
171
|
const appLanguage = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().appLanguage) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : '';
|
|
151
|
-
const
|
|
172
|
+
const videoLaunchBehavior = (_FireworkSDK$getInsta3 = _FireworkSDK.default.getInstance().videoLaunchBehavior) !== null && _FireworkSDK$getInsta3 !== void 0 ? _FireworkSDK$getInsta3 : '';
|
|
173
|
+
const adBadgeConfiguration = (_FireworkSDK$getInsta4 = _FireworkSDK.default.getInstance().adBadgeConfiguration) !== null && _FireworkSDK$getInsta4 !== void 0 ? _FireworkSDK$getInsta4 : {};
|
|
152
174
|
const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
|
|
153
175
|
const backgroundColorOfAdBadge = (_adBadgeConfiguration2 = adBadgeConfiguration.backgroundColor) !== null && _adBadgeConfiguration2 !== void 0 ? _adBadgeConfiguration2 : '';
|
|
154
176
|
const textColorOfAdBadge = (_adBadgeConfiguration3 = adBadgeConfiguration.textColor) !== null && _adBadgeConfiguration3 !== void 0 ? _adBadgeConfiguration3 : '';
|
|
155
|
-
const
|
|
177
|
+
const androidFontIsCustomOfAdBadge = (_adBadgeConfiguration4 = (_adBadgeConfiguration5 = adBadgeConfiguration.androidFontInfo) === null || _adBadgeConfiguration5 === void 0 ? void 0 : (_adBadgeConfiguration6 = _adBadgeConfiguration5.isCustom) === null || _adBadgeConfiguration6 === void 0 ? void 0 : _adBadgeConfiguration6.toString()) !== null && _adBadgeConfiguration4 !== void 0 ? _adBadgeConfiguration4 : '';
|
|
178
|
+
const androidFontTypefaceNameOfAdBadge = (_adBadgeConfiguration7 = (_adBadgeConfiguration8 = adBadgeConfiguration.androidFontInfo) === null || _adBadgeConfiguration8 === void 0 ? void 0 : _adBadgeConfiguration8.typefaceName) !== null && _adBadgeConfiguration7 !== void 0 ? _adBadgeConfiguration7 : '';
|
|
156
179
|
const {
|
|
157
180
|
source,
|
|
158
181
|
channel = '',
|
|
@@ -169,13 +192,32 @@ class VideoFeed extends _react.default.Component {
|
|
|
169
192
|
|
|
170
193
|
const videoFeedConfiguration = this._getVideoFeedConfiguration();
|
|
171
194
|
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
const
|
|
195
|
+
const cornerRadius = (_videoFeedConfigurati = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati2 = videoFeedConfiguration.cornerRadius) === null || _videoFeedConfigurati2 === void 0 ? void 0 : _videoFeedConfigurati2.toFixed(5)) !== null && _videoFeedConfigurati !== void 0 ? _videoFeedConfigurati : '';
|
|
196
|
+
const titleHidden = (_videoFeedConfigurati3 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati4 = videoFeedConfiguration.title) === null || _videoFeedConfigurati4 === void 0 ? void 0 : (_videoFeedConfigurati5 = _videoFeedConfigurati4.hidden) === null || _videoFeedConfigurati5 === void 0 ? void 0 : _videoFeedConfigurati5.toString()) !== null && _videoFeedConfigurati3 !== void 0 ? _videoFeedConfigurati3 : '';
|
|
197
|
+
const titleTextColor = (_videoFeedConfigurati6 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati7 = videoFeedConfiguration.title) === null || _videoFeedConfigurati7 === void 0 ? void 0 : _videoFeedConfigurati7.textColor) !== null && _videoFeedConfigurati6 !== void 0 ? _videoFeedConfigurati6 : '';
|
|
198
|
+
const titleFontSize = (_videoFeedConfigurati8 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati9 = videoFeedConfiguration.title) === null || _videoFeedConfigurati9 === void 0 ? void 0 : (_videoFeedConfigurati10 = _videoFeedConfigurati9.fontSize) === null || _videoFeedConfigurati10 === void 0 ? void 0 : _videoFeedConfigurati10.toFixed(5)) !== null && _videoFeedConfigurati8 !== void 0 ? _videoFeedConfigurati8 : '';
|
|
199
|
+
const titleAndroidFontInfo = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati11 = videoFeedConfiguration.title) === null || _videoFeedConfigurati11 === void 0 ? void 0 : _videoFeedConfigurati11.androidFontInfo;
|
|
200
|
+
const titleGradientDrawable = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati12 = videoFeedConfiguration.title) === null || _videoFeedConfigurati12 === void 0 ? void 0 : _videoFeedConfigurati12.gradientDrawable;
|
|
201
|
+
const titlePosition = (_videoFeedConfigurati13 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.titlePosition) !== null && _videoFeedConfigurati13 !== void 0 ? _videoFeedConfigurati13 : '';
|
|
202
|
+
const playIconHidden = (_videoFeedConfigurati14 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati15 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati15 === void 0 ? void 0 : (_videoFeedConfigurati16 = _videoFeedConfigurati15.hidden) === null || _videoFeedConfigurati16 === void 0 ? void 0 : _videoFeedConfigurati16.toString()) !== null && _videoFeedConfigurati14 !== void 0 ? _videoFeedConfigurati14 : '';
|
|
203
|
+
const playIconWidth = (_videoFeedConfigurati17 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati18 = videoFeedConfiguration.playIcon) === null || _videoFeedConfigurati18 === void 0 ? void 0 : (_videoFeedConfigurati19 = _videoFeedConfigurati18.iconWidth) === null || _videoFeedConfigurati19 === void 0 ? void 0 : _videoFeedConfigurati19.toFixed(5)) !== null && _videoFeedConfigurati17 !== void 0 ? _videoFeedConfigurati17 : '';
|
|
204
|
+
const showAdBadge = (_videoFeedConfigurati20 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati21 = videoFeedConfiguration.showAdBadge) === null || _videoFeedConfigurati21 === void 0 ? void 0 : _videoFeedConfigurati21.toString()) !== null && _videoFeedConfigurati20 !== void 0 ? _videoFeedConfigurati20 : '';
|
|
205
|
+
const enableAutoplay = (_videoFeedConfigurati22 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati23 = videoFeedConfiguration.enableAutoplay) === null || _videoFeedConfigurati23 === void 0 ? void 0 : _videoFeedConfigurati23.toString()) !== null && _videoFeedConfigurati22 !== void 0 ? _videoFeedConfigurati22 : '';
|
|
206
|
+
const gridColumns = (_videoFeedConfigurati24 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati25 = videoFeedConfiguration.gridColumns) === null || _videoFeedConfigurati25 === void 0 ? void 0 : _videoFeedConfigurati25.toFixed(5)) !== null && _videoFeedConfigurati24 !== void 0 ? _videoFeedConfigurati24 : '';
|
|
207
|
+
const itemSpacing = (_videoFeedConfigurati26 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati27 = videoFeedConfiguration.itemSpacing) === null || _videoFeedConfigurati27 === void 0 ? void 0 : _videoFeedConfigurati27.toFixed(5)) !== null && _videoFeedConfigurati26 !== void 0 ? _videoFeedConfigurati26 : '';
|
|
208
|
+
const playerStyle = (_videoPlayerConfigura = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.playerStyle) !== null && _videoPlayerConfigura !== void 0 ? _videoPlayerConfigura : '';
|
|
209
|
+
const videoCompleteAction = (_videoPlayerConfigura2 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.videoCompleteAction) !== null && _videoPlayerConfigura2 !== void 0 ? _videoPlayerConfigura2 : '';
|
|
210
|
+
const showShareButton = (_videoPlayerConfigura3 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura4 = videoPlayerConfiguration.showShareButton) === null || _videoPlayerConfigura4 === void 0 ? void 0 : _videoPlayerConfigura4.toString()) !== null && _videoPlayerConfigura3 !== void 0 ? _videoPlayerConfigura3 : '';
|
|
211
|
+
const showPlaybackButton = (_videoPlayerConfigura5 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura6 = videoPlayerConfiguration.showPlaybackButton) === null || _videoPlayerConfigura6 === void 0 ? void 0 : _videoPlayerConfigura6.toString()) !== null && _videoPlayerConfigura5 !== void 0 ? _videoPlayerConfigura5 : '';
|
|
212
|
+
const showMuteButton = (_videoPlayerConfigura7 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura8 = videoPlayerConfiguration.showMuteButton) === null || _videoPlayerConfigura8 === void 0 ? void 0 : _videoPlayerConfigura8.toString()) !== null && _videoPlayerConfigura7 !== void 0 ? _videoPlayerConfigura7 : '';
|
|
213
|
+
const showBranding = (_videoPlayerConfigura9 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura10 = videoPlayerConfiguration.showBranding) === null || _videoPlayerConfigura10 === void 0 ? void 0 : _videoPlayerConfigura10.toString()) !== null && _videoPlayerConfigura9 !== void 0 ? _videoPlayerConfigura9 : '';
|
|
214
|
+
const ctaDelayType = (_videoPlayerConfigura11 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura12 = videoPlayerConfiguration.ctaDelay) === null || _videoPlayerConfigura12 === void 0 ? void 0 : _videoPlayerConfigura12.type) !== null && _videoPlayerConfigura11 !== void 0 ? _videoPlayerConfigura11 : '';
|
|
215
|
+
const ctaDelayValue = ((_videoPlayerConfigura13 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura14 = videoPlayerConfiguration.ctaDelay) === null || _videoPlayerConfigura14 === void 0 ? void 0 : _videoPlayerConfigura14.value) !== null && _videoPlayerConfigura13 !== void 0 ? _videoPlayerConfigura13 : 0).toFixed(5);
|
|
216
|
+
const ctaHighlightDelayType = (_videoPlayerConfigura15 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura16 = videoPlayerConfiguration.ctaHighlightDelay) === null || _videoPlayerConfigura16 === void 0 ? void 0 : _videoPlayerConfigura16.type) !== null && _videoPlayerConfigura15 !== void 0 ? _videoPlayerConfigura15 : '';
|
|
217
|
+
const ctaHighlightDelayValue = ((_videoPlayerConfigura17 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : (_videoPlayerConfigura18 = videoPlayerConfiguration.ctaHighlightDelay) === null || _videoPlayerConfigura18 === void 0 ? void 0 : _videoPlayerConfigura18.value) !== null && _videoPlayerConfigura17 !== void 0 ? _videoPlayerConfigura17 : 0).toFixed(5);
|
|
218
|
+
const shareBaseURL = (_videoPlayerConfigura19 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.shareBaseURL) !== null && _videoPlayerConfigura19 !== void 0 ? _videoPlayerConfigura19 : '';
|
|
219
|
+
const ctaWidth = (_videoPlayerConfigura20 = videoPlayerConfiguration === null || videoPlayerConfiguration === void 0 ? void 0 : videoPlayerConfiguration.ctaWidth) !== null && _videoPlayerConfigura20 !== void 0 ? _videoPlayerConfigura20 : '';
|
|
220
|
+
const requiresAds = (_adConfiguration$requ = adConfiguration === null || adConfiguration === void 0 ? void 0 : (_adConfiguration$requ2 = adConfiguration.requiresAds) === null || _adConfiguration$requ2 === void 0 ? void 0 : _adConfiguration$requ2.toString()) !== null && _adConfiguration$requ !== void 0 ? _adConfiguration$requ : '';
|
|
179
221
|
const adsFetchTimeout = (_adConfiguration$adsF = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.adsFetchTimeout) !== null && _adConfiguration$adsF !== void 0 ? _adConfiguration$adsF : 10;
|
|
180
222
|
|
|
181
223
|
const vastAttributesString = this._generateVastAttributesString();
|
|
@@ -186,10 +228,16 @@ class VideoFeed extends _react.default.Component {
|
|
|
186
228
|
key += `_appLanguage:${appLanguage}`;
|
|
187
229
|
}
|
|
188
230
|
|
|
231
|
+
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
189
232
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
190
233
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
191
234
|
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
192
|
-
|
|
235
|
+
|
|
236
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
237
|
+
key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;
|
|
238
|
+
key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;
|
|
239
|
+
}
|
|
240
|
+
|
|
193
241
|
key += `_source:${source}`;
|
|
194
242
|
key += `_channel:${channel}`;
|
|
195
243
|
key += `_playlist:${playlist}`;
|
|
@@ -199,11 +247,42 @@ class VideoFeed extends _react.default.Component {
|
|
|
199
247
|
key += `_mode:${mode}`;
|
|
200
248
|
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
201
249
|
key += `_titleHidden:${titleHidden}`;
|
|
250
|
+
|
|
251
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
252
|
+
var _titleAndroidFontInfo, _titleAndroidFontInfo2, _titleAndroidFontInfo3, _titleGradientDrawabl, _titleGradientDrawabl2;
|
|
253
|
+
|
|
254
|
+
key += `_cornerRadius:${cornerRadius}`;
|
|
255
|
+
key += `_titleTextColor:${titleTextColor}`;
|
|
256
|
+
key += `_titleFontSize:${titleFontSize}`;
|
|
257
|
+
key += `_titleAndroidFontInfo.isCustom:${(_titleAndroidFontInfo = titleAndroidFontInfo === null || titleAndroidFontInfo === void 0 ? void 0 : (_titleAndroidFontInfo2 = titleAndroidFontInfo.isCustom) === null || _titleAndroidFontInfo2 === void 0 ? void 0 : _titleAndroidFontInfo2.toString()) !== null && _titleAndroidFontInfo !== void 0 ? _titleAndroidFontInfo : ''}`;
|
|
258
|
+
key += `_titleAndroidFontInfo.typefaceName:${(_titleAndroidFontInfo3 = titleAndroidFontInfo === null || titleAndroidFontInfo === void 0 ? void 0 : titleAndroidFontInfo.typefaceName) !== null && _titleAndroidFontInfo3 !== void 0 ? _titleAndroidFontInfo3 : ''}`;
|
|
259
|
+
key += `_titleGradientDrawable.orientation:${(_titleGradientDrawabl = titleGradientDrawable === null || titleGradientDrawable === void 0 ? void 0 : titleGradientDrawable.orientation) !== null && _titleGradientDrawabl !== void 0 ? _titleGradientDrawabl : ''}`;
|
|
260
|
+
key += `_titleGradientDrawable.colors:${((_titleGradientDrawabl2 = titleGradientDrawable === null || titleGradientDrawable === void 0 ? void 0 : titleGradientDrawable.colors) !== null && _titleGradientDrawabl2 !== void 0 ? _titleGradientDrawabl2 : []).join(',')}`;
|
|
261
|
+
key += `_playIconHidden:${playIconHidden}`;
|
|
262
|
+
key += `_playIconWidth:${playIconWidth}`;
|
|
263
|
+
key += `_showAdBadge:${showAdBadge}`;
|
|
264
|
+
}
|
|
265
|
+
|
|
202
266
|
key += `_titlePosition:${titlePosition}`;
|
|
203
267
|
key += `_enableAutoplay:${enableAutoplay}`;
|
|
204
268
|
key += `_gridColumns:${gridColumns}`;
|
|
205
|
-
key += `
|
|
269
|
+
key += `_itemSpacing:${itemSpacing}`;
|
|
206
270
|
key += `_shareBaseURL:${shareBaseURL}`;
|
|
271
|
+
|
|
272
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
273
|
+
key += `_playerStyle:${playerStyle}`;
|
|
274
|
+
key += `_videoCompleteAction:${videoCompleteAction}`;
|
|
275
|
+
key += `_showShareButton:${showShareButton}`;
|
|
276
|
+
key += `_showPlaybackButton:${showPlaybackButton}`;
|
|
277
|
+
key += `_showMuteButton:${showMuteButton}`;
|
|
278
|
+
key += `_showBranding:${showBranding}`;
|
|
279
|
+
key += `_ctaDelayType:${ctaDelayType}`;
|
|
280
|
+
key += `_ctaDelayValue:${ctaDelayValue}`;
|
|
281
|
+
key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;
|
|
282
|
+
key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;
|
|
283
|
+
key += `_ctaWidth:${ctaWidth}`;
|
|
284
|
+
}
|
|
285
|
+
|
|
207
286
|
key += `_requiresAds:${requiresAds}`;
|
|
208
287
|
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
209
288
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
@@ -213,10 +292,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
213
292
|
videoFeedConfiguration: videoFeedConfiguration,
|
|
214
293
|
ref: this._nativeComponentRef,
|
|
215
294
|
onVideoFeedLoadFinished: this._onVideoFeedLoadFinished,
|
|
216
|
-
mode: mode
|
|
217
|
-
style: Object.assign({}, this.props.style, {
|
|
218
|
-
zIndex: -1
|
|
219
|
-
})
|
|
295
|
+
mode: mode
|
|
220
296
|
}));
|
|
221
297
|
}
|
|
222
298
|
|
|
@@ -282,13 +358,25 @@ class VideoFeed extends _react.default.Component {
|
|
|
282
358
|
return videoFeedConfiguration;
|
|
283
359
|
}
|
|
284
360
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
361
|
+
let resultVideoFeedConfiguration = videoFeedConfiguration;
|
|
362
|
+
|
|
363
|
+
if (resultVideoFeedConfiguration.gridColumns && Math.floor(resultVideoFeedConfiguration.gridColumns) !== resultVideoFeedConfiguration.gridColumns) {
|
|
364
|
+
const gridColumns = Math.floor(resultVideoFeedConfiguration.gridColumns);
|
|
365
|
+
resultVideoFeedConfiguration = { ...resultVideoFeedConfiguration,
|
|
366
|
+
gridColumns
|
|
288
367
|
};
|
|
289
|
-
} else {
|
|
290
|
-
return videoFeedConfiguration;
|
|
291
368
|
}
|
|
369
|
+
|
|
370
|
+
if (resultVideoFeedConfiguration.title && resultVideoFeedConfiguration.title.numberOfLines && Math.floor(resultVideoFeedConfiguration.title.numberOfLines) !== resultVideoFeedConfiguration.title.numberOfLines) {
|
|
371
|
+
const numberOfLines = Math.floor(resultVideoFeedConfiguration.title.numberOfLines);
|
|
372
|
+
resultVideoFeedConfiguration = { ...resultVideoFeedConfiguration,
|
|
373
|
+
title: { ...resultVideoFeedConfiguration.title,
|
|
374
|
+
numberOfLines
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return resultVideoFeedConfiguration;
|
|
292
380
|
}
|
|
293
381
|
|
|
294
382
|
}
|