react-native-firework-sdk 2.0.0 → 2.2.0-beta.1
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/Info.plist +40 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +280 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -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 +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +556 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -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 +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +245 -0
- package/README.md +1 -1
- package/android/build.gradle +5 -4
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFragment.kt +129 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +90 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +5 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +18 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +36 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResult.kt +17 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +33 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +14 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +11 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +8 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +19 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductDeserializer.kt +11 -11
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +131 -45
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +11 -3
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +45 -4
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +9 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +83 -50
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +112 -36
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +16 -6
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +26 -32
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +10 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +48 -16
- package/android/src/main/res/layout/fw_bridge_story_block.xml +24 -0
- package/ios/Components/StoryBlock.swift +32 -2
- package/ios/Components/StoryBlockManager.m +33 -0
- package/ios/Components/StoryBlockManager.swift +4 -0
- package/ios/Components/VideoFeed.swift +16 -32
- package/ios/Components/VideoFeedManager.m +12 -6
- package/ios/Components/VideoFeedManager.swift +4 -0
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +276 -212
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +13 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +18 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +147 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +58 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift +25 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +69 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +91 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift +98 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift +97 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift +97 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift +38 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift +46 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift +26 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift +43 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +42 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +160 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +35 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +199 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +59 -0
- package/ios/{Utils/DispatchQueue+FWOnce.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift} +5 -5
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +18 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift +46 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift +37 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +766 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +37 -0
- package/ios/FireworkVideoUI/Podfile +15 -0
- package/ios/FireworkVideoUI/Podfile.lock +16 -0
- package/ios/Models/NativeToRN/FireworkEventName.swift +7 -1
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +5 -1
- package/ios/Models/RNToNative/RCTConvert+Shopping.swift +21 -0
- package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +29 -1
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +13 -101
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +34 -16
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +48 -2
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +0 -1
- package/ios/Modules/LiveStream/LiveStreamModule.swift +1 -0
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +7 -2
- package/ios/Modules/Shopping/ShoppingCTAResult.swift +16 -0
- package/ios/Modules/Shopping/ShoppingModule.m +2 -1
- package/ios/Modules/Shopping/ShoppingModule.swift +92 -34
- package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +22 -0
- package/ios/Support/MultiHostStreaming/Sources/MultiHostStreamingSDK.swift +17 -0
- package/ios/Utils/{UINavigationController+FWSwizzle.swift → Extensions/Swizzle/UINavigationController+FWSwizzle.swift} +9 -8
- package/ios/Utils/FWSwizzleLoader.m +6 -1
- package/ios/Utils/FWSwizzleLoader.swift +13 -0
- package/ios/react_native_firework_sdk.h +1 -0
- package/ios/scripts/react_native_firework_sdk_pods.rb +27 -0
- package/lib/commonjs/FireworkSDK.js +55 -15
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +2 -2
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +21 -38
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +193 -128
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +17 -5
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWEventName.js +3 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/ShoppingCTAResult.js +2 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js +3 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +54 -15
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +2 -2
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +21 -40
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +183 -133
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +16 -5
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWEventName.js +3 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/ShoppingCTAResult.js +2 -0
- package/lib/module/models/VideoPlaybackEventName.js +3 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +15 -8
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +10 -12
- package/lib/typescript/components/StoryBlock.d.ts +25 -24
- package/lib/typescript/components/VideoFeed.d.ts +7 -0
- package/lib/typescript/index.d.ts +6 -6
- package/lib/typescript/models/FWEventName.d.ts +3 -0
- package/lib/typescript/models/FWEvents.d.ts +14 -1
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +12 -8
- package/lib/typescript/models/SDKInitOptions.d.ts +6 -1
- package/lib/typescript/models/ShoppingCTAResult.d.ts +11 -0
- package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +16 -0
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +13 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +4 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -2
- package/lib/typescript/modules/ShoppingModule.d.ts +2 -1
- package/package.json +8 -3
- package/react-native-firework-sdk.podspec +31 -24
- package/src/FireworkSDK.ts +54 -15
- package/src/LiveStream.ts +2 -2
- package/src/VideoShopping.ts +41 -54
- package/src/components/StoryBlock.tsx +210 -98
- package/src/components/VideoFeed.tsx +23 -4
- package/src/index.ts +15 -9
- package/src/models/FWEventName.ts +3 -0
- package/src/models/FWEvents.ts +14 -1
- package/src/models/ProductInfoViewConfiguration.ts +13 -8
- package/src/models/SDKInitOptions.ts +6 -1
- package/src/models/ShoppingCTAResult.ts +11 -0
- package/src/models/StoryBlockSource.ts +2 -1
- package/src/models/VideoFeedSource.ts +2 -1
- package/src/models/VideoPlaybackDetails.ts +16 -0
- package/src/models/VideoPlaybackEventName.ts +13 -1
- package/src/models/VideoPlayerConfiguration.ts +4 -0
- package/src/modules/FireworkSDKModule.ts +1 -2
- package/src/modules/ShoppingModule.ts +5 -5
- package/android/src/main/java/com/fireworksdk/bridge/constants/FWCommandConstant.kt +0 -6
- package/ios/Utils/FWSwizzleUtil.swift +0 -29
- package/ios/Utils/UIView+ParentViewController.swift +0 -21
- package/lib/commonjs/models/AddToCartResult.js +0 -2
- package/lib/module/models/AddToCartResult.js +0 -2
- package/lib/typescript/models/AddToCartResult.d.ts +0 -10
- package/src/models/AddToCartResult.ts +0 -10
- /package/ios/Utils/{String+Color.swift → Extensions/String+Color.swift} +0 -0
- /package/ios/Utils/{UIView+Constraints.swift → Extensions/UIView+Constraints.swift} +0 -0
- /package/ios/Utils/{UIViewController+AttachChild.swift → Extensions/UIViewController+AttachChild.swift} +0 -0
- /package/lib/commonjs/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
- /package/lib/module/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
|
@@ -111,6 +111,14 @@ class VideoFeed extends _react.default.Component {
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);
|
|
114
|
+
|
|
115
|
+
const subscriptionOfAppLanguageUpdated = _FireworkSDKModule.FireworkSDKModuleEventEmitter.addListener(_FWEventName.FWEventName.AppLanguageUpdated, () => {
|
|
116
|
+
_FWLoggerUtil.default.log('Receive FWEventName.AppLanguageUpdated');
|
|
117
|
+
|
|
118
|
+
this.setState({});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
this._subscriptions.push(subscriptionOfAppLanguageUpdated);
|
|
114
122
|
}
|
|
115
123
|
/**
|
|
116
124
|
* @ignore
|
|
@@ -132,7 +140,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
132
140
|
|
|
133
141
|
|
|
134
142
|
render() {
|
|
135
|
-
var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3, _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3, _videoFeedConfigurati4, _videoFeedConfigurati5, _adConfiguration$requ, _adConfiguration$adsF, _videoFeedConfigurati6, _FireworkSDK$getInsta3;
|
|
143
|
+
var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3, _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3, _videoFeedConfigurati4, _videoFeedConfigurati5, _adConfiguration$requ, _adConfiguration$adsF, _videoFeedConfigurati6, _FireworkSDK$getInsta3, _FireworkSDK$getInsta4;
|
|
136
144
|
|
|
137
145
|
_FWLoggerUtil.default.log(`VideoFeed render ${JSON.stringify(this.props)}`);
|
|
138
146
|
|
|
@@ -143,14 +151,15 @@ class VideoFeed extends _react.default.Component {
|
|
|
143
151
|
playlistGroup = '',
|
|
144
152
|
mode = 'row',
|
|
145
153
|
adConfiguration,
|
|
146
|
-
enablePictureInPicture = false
|
|
154
|
+
enablePictureInPicture = false,
|
|
155
|
+
hashtagFilterExpression = ''
|
|
147
156
|
} = this.props;
|
|
148
157
|
|
|
149
158
|
const videoFeedConfiguration = this._getVideoFeedConfiguration();
|
|
150
159
|
|
|
151
160
|
const titleHidden = (_videoFeedConfigurati = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati2 = videoFeedConfiguration.title) === null || _videoFeedConfigurati2 === void 0 ? void 0 : _videoFeedConfigurati2.hidden) !== null && _videoFeedConfigurati !== void 0 ? _videoFeedConfigurati : false;
|
|
152
161
|
const titlePosition = (_videoFeedConfigurati3 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.titlePosition) !== null && _videoFeedConfigurati3 !== void 0 ? _videoFeedConfigurati3 : 'nested';
|
|
153
|
-
const
|
|
162
|
+
const gShareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
|
|
154
163
|
const adBadgeConfiguration = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().getAdBadgeConfiguration()) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : {};
|
|
155
164
|
const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
|
|
156
165
|
const backgroundColorOfAdBadge = (_adBadgeConfiguration2 = adBadgeConfiguration.backgroundColor) !== null && _adBadgeConfiguration2 !== void 0 ? _adBadgeConfiguration2 : '';
|
|
@@ -166,7 +175,8 @@ class VideoFeed extends _react.default.Component {
|
|
|
166
175
|
const vastAttributesString = this._generateVastAttributesString();
|
|
167
176
|
|
|
168
177
|
const showAdBadge = (_videoFeedConfigurati6 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.showAdBadge) !== null && _videoFeedConfigurati6 !== void 0 ? _videoFeedConfigurati6 : false;
|
|
169
|
-
const videoLaunchBehavior = (_FireworkSDK$getInsta3 = _FireworkSDK.default.getInstance().
|
|
178
|
+
const videoLaunchBehavior = (_FireworkSDK$getInsta3 = _FireworkSDK.default.getInstance().videoLaunchBehavior) !== null && _FireworkSDK$getInsta3 !== void 0 ? _FireworkSDK$getInsta3 : 'default';
|
|
179
|
+
const appLanguage = (_FireworkSDK$getInsta4 = _FireworkSDK.default.getInstance().appLanguage) !== null && _FireworkSDK$getInsta4 !== void 0 ? _FireworkSDK$getInsta4 : '';
|
|
170
180
|
let key = `source:${source}`;
|
|
171
181
|
key += `_channel:${channel}`;
|
|
172
182
|
key += `_playlist:${playlist}`;
|
|
@@ -174,7 +184,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
174
184
|
key += `_mode:${mode}`;
|
|
175
185
|
key += `_titleHidden:${titleHidden}`;
|
|
176
186
|
key += `_titlePosition:${titlePosition}`;
|
|
177
|
-
key += `
|
|
187
|
+
key += `_gShareBaseURL:${gShareBaseURL}`;
|
|
178
188
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
179
189
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
180
190
|
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
@@ -187,6 +197,8 @@ class VideoFeed extends _react.default.Component {
|
|
|
187
197
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
188
198
|
key += `_showAdBadge:${showAdBadge}`;
|
|
189
199
|
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
200
|
+
key += `_appLanguage:${appLanguage}`;
|
|
201
|
+
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
190
202
|
return /*#__PURE__*/_react.default.createElement(_FWVideoFeed.default, _extends({
|
|
191
203
|
key: key
|
|
192
204
|
}, this.props, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","FWLoggerUtil","log","JSON","stringify","props","nativeNodeHandle","_nativeComponentRef","current","commandId","UIManager","getViewManagerConfig","Commands","refresh","Platform","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","adConfiguration","enablePictureInPicture","videoFeedConfiguration","_getVideoFeedConfiguration","titleHidden","title","hidden","titlePosition","shareBaseURL","FireworkSDK","getInstance","getShareBaseURL","adBadgeConfiguration","getAdBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","enableAutoplay","gridColumns","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","showAdBadge","videoLaunchBehavior","getVideoLaunchBehavior","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length","vastAttributes","attribute","Math","floor"],"mappings":";;;;;;;AAAA;;AAEA;;AAUA;;AAEA;;AAKA;;AACA;;AACA;;;;;;;;AA0DA,MAAMA,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAAyD;AAAA;AAAA;;AAAA,8DAQzBD,eAAME,SAAN,EARyB;;AAAA,4CAUP,EAVO;;AAAA,qCAYtC,MAAM;AACrBC,4BAAaC,GAAb,CAAkB,qBAAoBC,IAAI,CAACC,SAAL,CAAe,KAAKC,KAApB,CAA2B,EAAjE;;AAEA,YAAMC,gBAAgB,GAAG,iCAAe,KAAKC,mBAAL,CAAyBC,OAAxC,CAAzB;;AAEA,UAAIC,SAA0B,GAC5BC,uBAAUC,oBAAV,CAA+Bf,mBAA/B,EAAoDgB,QAApD,CAA6DC,OAD/D;;AAEA,UAAIC,sBAASC,EAAT,KAAgB,SAApB,EAA+B;AAC7BN,QAAAA,SAAS,GAAGA,SAAS,CAACO,QAAV,EAAZ;AACD;;AAEDN,6BAAUO,0BAAV,CACE,iCAAeX,gBAAf,CADF,EAEEG,SAFF,EAGE,EAHF;AAKD,KA5BsD;;AAAA,sDA8BnBS,KAAD,IAAsC;AACvEjB,4BAAaC,GAAb,CACG,sCAAqCC,IAAI,CAACC,SAAL,CAAec,KAAK,CAACC,WAArB,CAAkC,EAD1E;;AAGA,YAAM;AAAEC,QAAAA;AAAF,UAA8B,KAAKf,KAAzC;AAEA,YAAM;AAAEgB,QAAAA,IAAF;AAAQC,QAAAA;AAAR,UAAmBJ,KAAK,CAACC,WAA/B;;AAEA,UAAIC,uBAAJ,EAA6B;AAC3B,YAAIC,IAAJ,EAAU;AACR,cAAIC,MAAJ,EAAY;AACVF,YAAAA,uBAAuB,CAAC;AAAEC,cAAAA,IAAF;AAAQC,cAAAA;AAAR,aAAD,CAAvB;AACD,WAFD,MAEO;AACLF,Y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C,eAAH,aAAGA,eAAH,uBAAGA,eAAe,CAAE6C,cAApB,yEAAsC,EAA1D;;AACA,QAAI,CAACA,cAAL,EAAqB;AACnB,aAAO,EAAP;AACD;;AAED,QAAIP,YAAY,GAAG,EAAnB;;AACA,SAAK,MAAMQ,SAAX,IAAwBD,cAAxB,EAAwC;AAAA;;AACtC,UAAIP,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AACDA,MAAAA,YAAY,IAAK,GAAD,mBAAGQ,SAAS,CAACvE,IAAb,6DAAqB,EAAG,IAAGuE,SAAS,CAACtD,KAAM,EAA3D;AACD;;AAED,WAAO8C,YAAP;AACD;;AAEOnC,EAAAA,0BAA0B,GAAuC;AACvE,UAAM;AAAED,MAAAA;AAAF,QAA6B,KAAK3C,KAAxC;;AACA,QAAI,CAAC2C,sBAAL,EAA6B;AAC3B,aAAOA,sBAAP;AACD;;AAED,QACEA,sBAAsB,CAACqB,WAAvB,IACAwB,IAAI,CAACC,KAAL,CAAW9C,sBAAsB,CAACqB,WAAlC,MACErB,sBAAsB,CAACqB,WAH3B,EAIE;AACA,aAAO,EACL,GAAGrB,sBADE;AAELqB,QAAAA,WAAW,EAAEwB,IAAI,CAACC,KAAL,CAAW9C,sBAAsB,CAACqB,WAAlC;AAFR,OAAP;AAID,KATD,MASO;AACL,aAAOrB,sBAAP;AACD;AACF;;AAvOsD;;gBAAnDnD,S,kBAIkB;AACpBgD,EAAAA,IAAI,EAAE;AADc,C;;eAsOThD,S","sourcesContent":["import React from 'react';\n\nimport {\n EmitterSubscription,\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\n/**\n * The props of VideoFeed component.\n */\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps> {\n /**\n * @ignore\n */\n static defaultProps = {\n mode: 'row',\n };\n\n private _nativeComponentRef = React.createRef<any>();\n\n private _subscriptions: EmitterSubscription[] = [];\n\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this._nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);\n }\n\n /**\n * @ignore\n */\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this._subscriptions.forEach((value) => {\n value.remove();\n });\n\n this._subscriptions = [];\n }\n\n /**\n * @ignore\n */\n render() {\n FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);\n\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n adConfiguration,\n enablePictureInPicture = false,\n } = this.props;\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const shareBaseURL = FireworkSDK.getInstance().getShareBaseURL() ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;\n\n const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;\n const requiresAds = adConfiguration?.requiresAds ?? false;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = this._generateVastAttributesString();\n const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;\n const videoLaunchBehavior =\n FireworkSDK.getInstance().getVideoLaunchBehavior() ?? 'default';\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_enableAutoplay:${enableAutoplay}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_gridColumns:${gridColumns}`;\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_showAdBadge:${showAdBadge}`;\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\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 private _generateVastAttributesString(): string {\n const { adConfiguration } = this.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 private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n if (\n videoFeedConfiguration.gridColumns &&\n Math.floor(videoFeedConfiguration.gridColumns!) !==\n videoFeedConfiguration.gridColumns\n ) {\n return {\n ...videoFeedConfiguration,\n gridColumns: Math.floor(videoFeedConfiguration.gridColumns!),\n };\n } else {\n return videoFeedConfiguration;\n }\n }\n}\n\nexport default VideoFeed;\n"]}
|
|
1
|
+
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","FWLoggerUtil","log","JSON","stringify","props","nativeNodeHandle","_nativeComponentRef","current","commandId","UIManager","getViewManagerConfig","Commands","refresh","Platform","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","adConfiguration","enablePictureInPicture","hashtagFilterExpression","videoFeedConfiguration","_getVideoFeedConfiguration","titleHidden","title","hidden","titlePosition","gShareBaseURL","FireworkSDK","getInstance","shareBaseURL","adBadgeConfiguration","getAdBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","enableAutoplay","gridColumns","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","showAdBadge","videoLaunchBehavior","appLanguage","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length","vastAttributes","attribute","Math","floor"],"mappings":";;;;;;;AAAA;;AAEA;;AAUA;;AAEA;;AAKA;;AACA;;AACA;;;;;;;;AAiEA,MAAMA,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAAyD;AAAA;AAAA;;AAAA,8DAQzBD,eAAME,SAAN,EARyB;;AAAA,4CAUP,EAVO;;AAAA,qCAYtC,MAAM;AACrBC,4BAAaC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AAAE5B,MAAAA;AAAF,QAAsB,KAAK3C,KAAjC;AACA,UAAMyF,cAAc,4BAAG9C,eAAH,aAAGA,eAAH,uBAAGA,eAAe,CAAE8C,cAApB,yEAAsC,EAA1D;;AACA,QAAI,CAACA,cAAL,EAAqB;AACnB,aAAO,EAAP;AACD;;AAED,QAAIP,YAAY,GAAG,EAAnB;;AACA,SAAK,MAAMQ,SAAX,IAAwBD,cAAxB,EAAwC;AAAA;;AACtC,UAAIP,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AACDA,MAAAA,YAAY,IAAK,GAAD,mBAAGQ,SAAS,CAAC1E,IAAb,6DAAqB,EAAG,IAAG0E,SAAS,CAACvD,KAAM,EAA3D;AACD;;AAED,WAAO+C,YAAP;AACD;;AAEOnC,EAAAA,0BAA0B,GAAuC;AACvE,UAAM;AAAED,MAAAA;AAAF,QAA6B,KAAK9C,KAAxC;;AACA,QAAI,CAAC8C,sBAAL,EAA6B;AAC3B,aAAOA,sBAAP;AACD;;AAED,QACEA,sBAAsB,CAACqB,WAAvB,IACAwB,IAAI,CAACC,KAAL,CAAW9C,sBAAsB,CAACqB,WAAlC,MACErB,sBAAsB,CAACqB,WAH3B,EAIE;AACA,aAAO,EACL,GAAGrB,sBADE;AAELqB,QAAAA,WAAW,EAAEwB,IAAI,CAACC,KAAL,CAAW9C,sBAAsB,CAACqB,WAAlC;AAFR,OAAP;AAID,KATD,MASO;AACL,aAAOrB,sBAAP;AACD;AACF;;AAnPsD;;gBAAnDtD,S,kBAIkB;AACpBkD,EAAAA,IAAI,EAAE;AADc,C;;eAkPTlD,S","sourcesContent":["import React from 'react';\n\nimport {\n EmitterSubscription,\n findNodeHandle,\n NativeSyntheticEvent,\n Platform,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\n/**\n * The props of VideoFeed component.\n */\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. 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 * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps> {\n /**\n * @ignore\n */\n static defaultProps = {\n mode: 'row',\n };\n\n private _nativeComponentRef = React.createRef<any>();\n\n private _subscriptions: EmitterSubscription[] = [];\n\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this._nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAppLanguageUpdated);\n }\n\n /**\n * @ignore\n */\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this._subscriptions.forEach((value) => {\n value.remove();\n });\n\n this._subscriptions = [];\n }\n\n /**\n * @ignore\n */\n render() {\n FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);\n\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n adConfiguration,\n enablePictureInPicture = false,\n hashtagFilterExpression = '',\n } = this.props;\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;\n\n const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;\n const requiresAds = adConfiguration?.requiresAds ?? false;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = this._generateVastAttributesString();\n const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;\n const videoLaunchBehavior =\n FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';\n const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_gShareBaseURL:${gShareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_enableAutoplay:${enableAutoplay}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_gridColumns:${gridColumns}`;\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_showAdBadge:${showAdBadge}`;\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_appLanguage:${appLanguage}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\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 private _generateVastAttributesString(): string {\n const { adConfiguration } = this.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 private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n if (\n videoFeedConfiguration.gridColumns &&\n Math.floor(videoFeedConfiguration.gridColumns!) !==\n videoFeedConfiguration.gridColumns\n ) {\n return {\n ...videoFeedConfiguration,\n gridColumns: Math.floor(videoFeedConfiguration.gridColumns!),\n };\n } else {\n return videoFeedConfiguration;\n }\n }\n}\n\nexport default VideoFeed;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AAOA;;AACA;;AAKA;;AAwBA;;AAEA;;AA0BA;;AAeA;;;;eAEeA,oB","sourcesContent":["import type {\n IStoryBlockMethods,\n IStoryBlockProps,\n} from './components/StoryBlock';\nimport StoryBlock from './components/StoryBlock';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport FWNavigator from './FWNavigator';\nimport type {\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n} from './LiveStream';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport type { AdBadgeTextType } from './models/AdBadgeConfiguration';\nimport type AdConfiguration from './models/AdConfiguration';\nimport type { VastAttribute } from './models/AdConfiguration';\nimport type AndroidFontInfo from './models/AndroidFontInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type IOSFontInfo from './models/IOSFontInfo';\nimport type {\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n} from './models/IOSFontInfo';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedContentPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n} from './models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from './models/VideoFeedSource';\nimport type VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type { VideoPlayerSize } from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCompleteAction,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerStyle,\n} from './models/VideoPlayerConfiguration';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n ShoppingCTACallback,\n UpdateProductDetailsCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfiguration,\n AndroidFontInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n IOSFontInfo,\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n IStoryBlockMethods,\n IStoryBlockProps,\n IVideoFeedProps,\n LinkButtonConfiguration,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedContentPadding,\n VideoFeedMode,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
|
|
@@ -13,6 +13,7 @@ exports.FWEventName = FWEventName;
|
|
|
13
13
|
FWEventName["VideoPlayback"] = "fw:video-playback";
|
|
14
14
|
FWEventName["VideoFeedClick"] = "fw:video-feed-click";
|
|
15
15
|
FWEventName["AddToCart"] = "fw:shopping:add-to-cart";
|
|
16
|
+
FWEventName["ShoppingCTAButtonClick"] = "fw:shopping:cta-button-click";
|
|
16
17
|
FWEventName["ClickCartIcon"] = "fw:shopping:click-cart-icon";
|
|
17
18
|
FWEventName["UpdateProductDetails"] = "fw:shopping:update-product-details";
|
|
18
19
|
FWEventName["LiveStream"] = "fw:livestream";
|
|
@@ -20,6 +21,8 @@ exports.FWEventName = FWEventName;
|
|
|
20
21
|
FWEventName["ShareBaseURLUpdated"] = "fw:share-base-url-updated";
|
|
21
22
|
FWEventName["VideoLaunchBehaviorUpdated"] = "fw:video-launch-behavior-updated";
|
|
22
23
|
FWEventName["AdBadgeConfigurationUpdated"] = "fw:ad-badge-configuration-updated";
|
|
24
|
+
FWEventName["AppLanguageUpdated"] = "fw:app-language-updated";
|
|
25
|
+
FWEventName["NativeAppLanguageUpdated"] = "fw:native-app-language-updated";
|
|
23
26
|
FWEventName["LogMessage"] = "fw:log-message";
|
|
24
27
|
FWEventName["CustomLinkButtonClick"] = "fw:shopping:custom-link-button-click";
|
|
25
28
|
})(FWEventName || (exports.FWEventName = FWEventName = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ShoppingCTAButtonClick = 'fw:shopping:cta-button-click',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n AppLanguageUpdated = 'fw:app-language-updated',\n NativeAppLanguageUpdated = 'fw:native-app-language-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n}\n"]}
|
|
@@ -9,10 +9,13 @@ var VideoPlaybackEventName;
|
|
|
9
9
|
(function (VideoPlaybackEventName) {
|
|
10
10
|
VideoPlaybackEventName["Impression"] = "fw:video:impression";
|
|
11
11
|
VideoPlaybackEventName["Start"] = "fw:video:start";
|
|
12
|
+
VideoPlaybackEventName["Pause"] = "fw:video:pause";
|
|
13
|
+
VideoPlaybackEventName["Resume"] = "fw:video:resume";
|
|
12
14
|
VideoPlaybackEventName["FirstQuartile"] = "fw:video:first-quartile";
|
|
13
15
|
VideoPlaybackEventName["Midpoint"] = "fw:video:midpoint";
|
|
14
16
|
VideoPlaybackEventName["ThirdQuartile"] = "fw:video:third-quartile";
|
|
15
17
|
VideoPlaybackEventName["Complete"] = "fw:video:complete";
|
|
18
|
+
VideoPlaybackEventName["AdStart"] = "fw:video:ad-start";
|
|
16
19
|
VideoPlaybackEventName["AdEnd"] = "fw:video:ad-end";
|
|
17
20
|
VideoPlaybackEventName["ClickCTA"] = "fw:video:click-cta";
|
|
18
21
|
VideoPlaybackEventName["ClickShare"] = "fw:video:click-share";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoPlaybackEventName.ts"],"names":["VideoPlaybackEventName"],"mappings":";;;;;;IAAKA,sB;;WAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;GAAAA,sB,KAAAA,sB;;
|
|
1
|
+
{"version":3,"sources":["VideoPlaybackEventName.ts"],"names":["VideoPlaybackEventName"],"mappings":";;;;;;IAAKA,sB;;WAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;GAAAA,sB,KAAAA,sB;;eAmDUA,sB","sourcesContent":["enum VideoPlaybackEventName {\n /**\n * When video is shown to the user.\n */\n Impression = 'fw:video:impression',\n /**\n * Video started.\n */\n Start = 'fw:video:start',\n /**\n * Video paused.\n */\n Pause = 'fw:video:pause',\n /**\n * Video resume.\n */\n Resume = 'fw:video:resume',\n /**\n * Video reached 25%.\n */\n FirstQuartile = 'fw:video:first-quartile',\n /**\n * Video reached 50%.\n */\n Midpoint = 'fw:video:midpoint',\n /**\n * Video reached 75%.\n */\n ThirdQuartile = 'fw:video:third-quartile',\n /**\n * Video reached 100%.\n */\n Complete = 'fw:video:complete',\n /**\n * Ad video started playing.\n */\n AdStart = 'fw:video:ad-start',\n /**\n * Ad video completed playing.\n */\n AdEnd = 'fw:video:ad-end',\n /**\n * When a visitor clicks on CTA button (if available).\n */\n ClickCTA = 'fw:video:click-cta',\n /**\n * When user clicks on \"Share\" button.\n */\n ClickShare = 'fw:video:click-share',\n}\n\nexport default VideoPlaybackEventName;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["FireworkSDKModule","NativeModules","FireworkSDK","Proxy","get","Error","LINKING_ERROR","FireworkSDKModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAMA,MAAMA,iBAAiB,GAAGC,2BAAcC,WAAd,GACtBD,2BAAcC,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;
|
|
1
|
+
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["FireworkSDKModule","NativeModules","FireworkSDK","Proxy","get","Error","LINKING_ERROR","FireworkSDKModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAMA,MAAMA,iBAAiB,GAAGC,2BAAcC,WAAd,GACtBD,2BAAcC,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAsBA,MAAMC,6BAA6B,GAAG,IAAIC,+BAAJ,CAAuBR,iBAAvB,CAAtC;;eAEeA,iB","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type AdBadgeConfiguration from '../models/AdBadgeConfiguration';\nimport type SDKInitOptions from '../models/SDKInitOptions';\nimport type TrackPurchaseParameters from '../models/TrackPurchaseParameters';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\n\nconst FireworkSDKModule = NativeModules.FireworkSDK\n ? NativeModules.FireworkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IFireworkSDKModule extends NativeModule {\n init(options?: SDKInitOptions): Promise<any>;\n openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;\n setCustomCTAClickEnabled(enabled: boolean): void;\n setShareBaseURL(url?: string): Promise<any>;\n setVideoPlaybackEventEnabled(enabled: boolean): void;\n setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;\n trackPurchase(parameters: TrackPurchaseParameters): void;\n changeAppLanguage(language?: string | null): Promise<boolean>;\n}\n\nconst FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);\nexport { FireworkSDKModuleEventEmitter };\nexport default FireworkSDKModule as IFireworkSDKModule;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ShoppingModule.ts"],"names":["ShoppingModule","NativeModules","Proxy","get","Error","LINKING_ERROR","ShoppingModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;
|
|
1
|
+
{"version":3,"sources":["ShoppingModule.ts"],"names":["ShoppingModule","NativeModules","Proxy","get","Error","LINKING_ERROR","ShoppingModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAKA,MAAMA,cAAc,GAAGC,2BAAcD,cAAd,GACnBC,2BAAcD,cADK,GAEnB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AA0BA,MAAMC,0BAA0B,GAAG,IAAIC,+BAAJ,CAAuBP,cAAvB,CAAnC;;eAGeA,c","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type Product from '../models/Product';\nimport type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';\nimport type ShoppingCTAResult from '../models/ShoppingCTAResult';\n\nconst ShoppingModule = NativeModules.ShoppingModule\n ? NativeModules.ShoppingModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IShoppingModule extends NativeModule {\n init(): void;\n updateVideoProducts(products: Product[], callbackId: number | string): void;\n updateShoppingCTAResult(\n result: ShoppingCTAResult,\n callbackId: number | string\n ): void;\n setCartIconVisible(visible: boolean): void;\n setCartItemCount(count: number): void;\n setCustomClickCartIconEnabled(enabled: boolean): Promise<void>; // Only supported on iOS\n clearCallbackId(callbackId: number | string, eventName: string): void; // Only supported on iOS\n setProductInfoViewConfiguration(config: ProductInfoViewConfiguration): void;\n setCustomClickLinkButtonEnabled(enabled: boolean): Promise<void>;\n}\n\nconst ShoppingModuleEventEmitter = new NativeEventEmitter(ShoppingModule);\nexport { ShoppingModuleEventEmitter };\n\nexport default ShoppingModule as IShoppingModule;\n"]}
|
|
@@ -36,7 +36,7 @@ class FireworkSDK {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* The callback of video playback.
|
|
39
|
+
* The callback of video playback.
|
|
40
40
|
*/
|
|
41
41
|
get onVideoPlayback() {
|
|
42
42
|
return this._onVideoPlayback;
|
|
@@ -48,12 +48,19 @@ class FireworkSDK {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* The global share base URL of the video.
|
|
52
|
+
* The {@link VideoPlayerConfiguration.shareBaseURL} in {@link VideoPlayerConfiguration} will override this.
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
|
+
get shareBaseURL() {
|
|
54
55
|
return this._shareBaseURL;
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
set shareBaseURL(value) {
|
|
59
|
+
FireworkSDKModule.setShareBaseURL(value !== null && value !== void 0 ? value : '').then(() => {
|
|
60
|
+
this.updateInternalShareBaseURL(value);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
/**
|
|
58
65
|
* Get the configuration for ad badges. Only supported on iOS.
|
|
59
66
|
*/
|
|
@@ -77,6 +84,10 @@ class FireworkSDK {
|
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
|
|
87
|
+
get appLanguage() {
|
|
88
|
+
return this._appLanguage;
|
|
89
|
+
}
|
|
90
|
+
|
|
80
91
|
/**
|
|
81
92
|
* Defaults to false.
|
|
82
93
|
* You can enable debug logs by setting this property to true.
|
|
@@ -93,7 +104,7 @@ class FireworkSDK {
|
|
|
93
104
|
*/
|
|
94
105
|
|
|
95
106
|
|
|
96
|
-
|
|
107
|
+
get videoLaunchBehavior() {
|
|
97
108
|
return this._videoLaunchBehavior;
|
|
98
109
|
}
|
|
99
110
|
|
|
@@ -148,6 +159,8 @@ class FireworkSDK {
|
|
|
148
159
|
|
|
149
160
|
_defineProperty(this, "_adBadgeConfiguration", void 0);
|
|
150
161
|
|
|
162
|
+
_defineProperty(this, "_appLanguage", void 0);
|
|
163
|
+
|
|
151
164
|
_defineProperty(this, "_videoLaunchBehavior", void 0);
|
|
152
165
|
|
|
153
166
|
_defineProperty(this, "_shopping", VideoShopping.getInstance());
|
|
@@ -188,6 +201,14 @@ class FireworkSDK {
|
|
|
188
201
|
this.onVideoFeedClick(event !== null && event !== void 0 ? event : {});
|
|
189
202
|
}
|
|
190
203
|
});
|
|
204
|
+
|
|
205
|
+
if (Platform.OS === 'ios') {
|
|
206
|
+
this.eventEmitter.addListener(FWEventName.NativeAppLanguageUpdated, event => {
|
|
207
|
+
FWLoggerUtil.log(`Receive NativeAppLanguageUpdated event appLanguage: ${event.appLanguage}`);
|
|
208
|
+
const language = event.appLanguage;
|
|
209
|
+
this.updateInternalAppLanguage(language);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
191
212
|
}
|
|
192
213
|
/**
|
|
193
214
|
* Initializes Firework SDK.
|
|
@@ -198,13 +219,6 @@ class FireworkSDK {
|
|
|
198
219
|
async init(options) {
|
|
199
220
|
FWLoggerUtil.log('Call FireworkSDK init method');
|
|
200
221
|
FireworkSDKModule.init(options).then(() => {
|
|
201
|
-
const shareBaseURLChanged = this._shareBaseURL !== (options === null || options === void 0 ? void 0 : options.shareBaseURL);
|
|
202
|
-
this._shareBaseURL = options === null || options === void 0 ? void 0 : options.shareBaseURL;
|
|
203
|
-
|
|
204
|
-
if (shareBaseURLChanged) {
|
|
205
|
-
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
222
|
const videoLaunchBehaviorUpdated = this._videoLaunchBehavior !== (options === null || options === void 0 ? void 0 : options.videoLaunchBehavior);
|
|
209
223
|
this._videoLaunchBehavior = options === null || options === void 0 ? void 0 : options.videoLaunchBehavior;
|
|
210
224
|
|
|
@@ -237,21 +251,46 @@ class FireworkSDK {
|
|
|
237
251
|
}
|
|
238
252
|
}
|
|
239
253
|
/**
|
|
240
|
-
* Change App level language. Only supported on
|
|
241
|
-
* @param {string} language Such as en, ar and en-US
|
|
242
|
-
*
|
|
254
|
+
* Change App level language. Only supported on iOS.
|
|
255
|
+
* @param {string | undefined | null} language Such as en, ar and en-US
|
|
256
|
+
* If language is null or undefined or empty string, SDK will use system language.
|
|
257
|
+
* @returns {Promise<boolean>} The result of changing app language.
|
|
243
258
|
*/
|
|
244
259
|
|
|
245
260
|
|
|
246
261
|
async changeAppLanguage(language) {
|
|
247
|
-
if (Platform.OS === '
|
|
262
|
+
if (Platform.OS === 'ios') {
|
|
248
263
|
const result = await FireworkSDKModule.changeAppLanguage(language);
|
|
264
|
+
|
|
265
|
+
if (result) {
|
|
266
|
+
this.updateInternalAppLanguage(language);
|
|
267
|
+
}
|
|
268
|
+
|
|
249
269
|
return result;
|
|
250
270
|
}
|
|
251
271
|
|
|
252
272
|
return false;
|
|
253
273
|
}
|
|
254
274
|
|
|
275
|
+
updateInternalAppLanguage(language) {
|
|
276
|
+
const valueHasChanged = this._appLanguage !== language;
|
|
277
|
+
this._appLanguage = language;
|
|
278
|
+
|
|
279
|
+
if (valueHasChanged) {
|
|
280
|
+
this.eventEmitter.emit(FWEventName.AppLanguageUpdated);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
updateInternalShareBaseURL(shareBaseURL) {
|
|
285
|
+
const shareBaseURLChanged = this._shareBaseURL !== shareBaseURL;
|
|
286
|
+
console.log('updateInternalShareBaseURL shareBaseURL', shareBaseURL);
|
|
287
|
+
this._shareBaseURL = shareBaseURL;
|
|
288
|
+
|
|
289
|
+
if (shareBaseURLChanged) {
|
|
290
|
+
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
255
294
|
}
|
|
256
295
|
|
|
257
296
|
_defineProperty(FireworkSDK, "_instance", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FireworkSDK.ts"],"names":["Platform","FWNavigator","LiveStream","FWEventName","FireworkSDKModule","FireworkSDKModuleEventEmitter","LiveStreamModule","ShoppingModule","FWLoggerUtil","VideoShopping","FireworkSDK","onCustomCTAClick","_onCustomCTAClick","value","log","setCustomCTAClickEnabled","onVideoPlayback","_onVideoPlayback","setVideoPlaybackEventEnabled","getShareBaseURL","_shareBaseURL","getAdBadgeConfiguration","_adBadgeConfiguration","setAdBadgeConfiguration","valueHasChanged","badgeTextType","backgroundColor","textColor","eventEmitter","emit","AdBadgeConfigurationUpdated","debugLogsEnabled","enabled","getVideoLaunchBehavior","_videoLaunchBehavior","shopping","_shopping","liveStream","_liveStream","navigator","_navigator","getInstance","_instance","constructor","addListener","SDKInit","event","error","onSDKInit","LogMessage","logNativeMessage","message","CustomCTAClick","url","VideoPlayback","eventName","VideoFeedClick","info","id","onVideoFeedClick","init","options","then","shareBaseURLChanged","shareBaseURL","ShareBaseURLUpdated","videoLaunchBehaviorUpdated","videoLaunchBehavior","VideoLaunchBehaviorUpdated","openVideoPlayer","config","trackPurchase","parameters","OS","changeAppLanguage","language","result"],"mappings":";;AAAA,SAA6BA,QAA7B,QAA6C,cAA7C;AAEA,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,YAAL,CAAkBC,IAAlB,CAAuB1B,WAAW,CAACiE,0BAAnC;AACD;AACF,KAbD;AAcA7D,IAAAA,cAAc,CAACqD,IAAf;AACAtD,IAAAA,gBAAgB,CAACsD,IAAjB;AACD;AAED;AACF;AACA;AACA;AACA;;;AACSS,EAAAA,eAAe,CAAChB,GAAD,EAAciB,MAAd,EAAiD;AACrElE,IAAAA,iBAAiB,CAACiE,eAAlB,CAAkChB,GAAlC,EAAuCiB,MAAvC,aAAuCA,MAAvC,cAAuCA,MAAvC,GAAiD,EAAjD;AACD;AAED;AACF;AACA;AACA;;;AACSC,EAAAA,aAAa,CAACC,UAAD,EAAsC;AACxD,QAAIxE,QAAQ,CAACyE,EAAT,KAAgB,KAApB,EAA2B;AACzBrE,MAAAA,iBAAiB,CAACmE,aAAlB,CAAgCC,UAAhC;AACD;AACF;AAED;AACF;AACA;AACA;AACA;;;AACgC,QAAjBE,iBAAiB,CAACC,QAAD,EAAqC;AACjE,QAAI3E,QAAQ,CAACyE,EAAT,KAAgB,SAApB,EAA+B;AAC7B,YAAMG,MAAM,GAAG,MAAMxE,iBAAiB,CAACsE,iBAAlB,CAAoCC,QAApC,CAArB;AACA,aAAOC,MAAP;AACD;;AAED,WAAO,KAAP;AACD;;AAlOe;;gBAAZlE,W;;AAqON,eAAeA,WAAf","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport FWNavigator from './FWNavigator';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomCTAClickEvent,\n SDKInitEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport FireworkSDKModule, {\n FireworkSDKModuleEventEmitter,\n} from './modules/FireworkSDKModule';\nimport LiveStreamModule from './modules/LiveStreamModule';\nimport ShoppingModule from './modules/ShoppingModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\nimport VideoShopping from './VideoShopping';\n\nexport type SDKInitCallback = (event: SDKInitEvent) => void;\nexport type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;\nexport type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;\nexport type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;\n\n/**\n * Firework SDK.\n */\nclass FireworkSDK {\n private static _instance?: FireworkSDK;\n\n /**\n * The callback of SDK initialization.\n */\n public onSDKInit?: SDKInitCallback;\n\n /**\n * the callback of clicking Video Feed.\n */\n public onVideoFeedClick?: VideoFeedClickCallback;\n\n /**\n * The callback of clicking custom CTA.\n */\n public get onCustomCTAClick(): CustomCTAClickCallback | undefined {\n return this._onCustomCTAClick;\n }\n public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {\n FWLoggerUtil.log(`Set onCustomCTAClick callback ${!!value}`);\n this._onCustomCTAClick = value;\n FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);\n }\n private _onCustomCTAClick: CustomCTAClickCallback | undefined;\n\n /**\n * The callback of video playback. Only supported on iOS.\n */\n public get onVideoPlayback(): VideoPlaybackCallback | undefined {\n return this._onVideoPlayback;\n }\n public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {\n this._onVideoPlayback = value;\n FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);\n }\n private _onVideoPlayback?: VideoPlaybackCallback | undefined;\n\n /**\n * Get share base URL.\n */\n public getShareBaseURL(): string | undefined {\n return this._shareBaseURL;\n }\n private _shareBaseURL: string | undefined;\n\n /**\n * Get the configuration for ad badges. Only supported on iOS.\n */\n public getAdBadgeConfiguration(): AdBadgeConfiguration | undefined {\n return this._adBadgeConfiguration;\n }\n /**\n * Set the configuration for ad badges. Only supported on iOS.\n */\n public async setAdBadgeConfiguration(\n value: AdBadgeConfiguration | undefined\n ): Promise<void> {\n await FireworkSDKModule.setAdBadgeConfiguration(value ?? {});\n const valueHasChanged =\n this._adBadgeConfiguration?.badgeTextType !== value?.badgeTextType ||\n this._adBadgeConfiguration?.backgroundColor !== value?.backgroundColor ||\n this._adBadgeConfiguration?.textColor !== value?.textColor;\n this._adBadgeConfiguration = value;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);\n }\n }\n private _adBadgeConfiguration: AdBadgeConfiguration | undefined;\n\n /**\n * Defaults to false.\n * You can enable debug logs by setting this property to true.\n */\n public get debugLogsEnabled(): boolean {\n return FWLoggerUtil.enabled;\n }\n public set debugLogsEnabled(value: boolean) {\n FWLoggerUtil.enabled = value;\n }\n\n /**\n * Get video launch behavior.\n */\n public getVideoLaunchBehavior(): VideoLaunchBehavior | undefined {\n return this._videoLaunchBehavior;\n }\n private _videoLaunchBehavior: VideoLaunchBehavior | undefined;\n\n private get eventEmitter(): NativeEventEmitter {\n return FireworkSDKModuleEventEmitter;\n }\n\n /**\n * Get VideoShopping object.\n */\n public get shopping(): VideoShopping {\n return this._shopping;\n }\n private _shopping: VideoShopping = VideoShopping.getInstance();\n\n /**\n * Get LiveStream object.\n */\n public get liveStream(): LiveStream {\n return this._liveStream;\n }\n private _liveStream: LiveStream = LiveStream.getInstance();\n\n /**\n * Get FWNavigator object.\n */\n public get navigator(): FWNavigator {\n return this._navigator;\n }\n private _navigator: FWNavigator = FWNavigator.getInstance();\n\n /**\n * Get global single instance of FireworkSDK class.\n * @returns FireworkSDK\n */\n public static getInstance() {\n if (!FireworkSDK._instance) {\n FireworkSDK._instance = new FireworkSDK();\n }\n\n return FireworkSDK._instance!;\n }\n\n private constructor() {\n FWLoggerUtil.log('FireworkSDK constructor');\n this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {\n FWLoggerUtil.log(`Receive SDKInit event ${event?.error}`);\n\n if (this.onSDKInit) {\n this.onSDKInit(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LogMessage, (event) => {\n FWLoggerUtil.logNativeMessage(event.message);\n });\n\n this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {\n FWLoggerUtil.log(`Receive CustomCTAClick url: ${event?.url}`);\n\n if (this.onCustomCTAClick) {\n this.onCustomCTAClick(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoPlayback, (event) => {\n FWLoggerUtil.log(\n `Receive VideoPlayback event eventName: ${event?.eventName}`\n );\n\n if (this.onVideoPlayback) {\n this.onVideoPlayback(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {\n FWLoggerUtil.log(`Receive VideoFeedClick event id: ${event?.info.id}`);\n\n if (this.onVideoFeedClick) {\n this.onVideoFeedClick(event ?? {});\n }\n });\n }\n\n /**\n * Initializes Firework SDK.\n * @param {SDKInitOptions?} options\n */\n public async init(options?: SDKInitOptions): Promise<void> {\n FWLoggerUtil.log('Call FireworkSDK init method');\n\n FireworkSDKModule.init(options).then(() => {\n const shareBaseURLChanged = this._shareBaseURL !== options?.shareBaseURL;\n this._shareBaseURL = options?.shareBaseURL;\n if (shareBaseURLChanged) {\n this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);\n }\n\n const videoLaunchBehaviorUpdated =\n this._videoLaunchBehavior !== options?.videoLaunchBehavior;\n this._videoLaunchBehavior = options?.videoLaunchBehavior;\n if (videoLaunchBehaviorUpdated) {\n this.eventEmitter.emit(FWEventName.VideoLaunchBehaviorUpdated);\n }\n });\n ShoppingModule.init();\n LiveStreamModule.init();\n }\n\n /**\n * Open Video URL.\n * @param {string} url\n * @param {VideoPlayerConfiguration} config\n */\n public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {\n FireworkSDKModule.openVideoPlayer(url, config ?? {});\n }\n\n /**\n * Records the user purchase. Only supported on iOS.\n * @param {TrackPurchaseParameters} parameters\n */\n public trackPurchase(parameters: TrackPurchaseParameters) {\n if (Platform.OS === 'ios') {\n FireworkSDKModule.trackPurchase(parameters);\n }\n }\n\n /**\n * Change App level language. Only supported on Android.\n * @param {string} language Such as en, ar and en-US\n * @returns {Promise<boolean>}\n */\n public async changeAppLanguage(language: string): Promise<boolean> {\n if (Platform.OS === 'android') {\n const result = await FireworkSDKModule.changeAppLanguage(language);\n return result;\n }\n\n return false;\n }\n}\n\nexport default FireworkSDK;\n"]}
|
|
1
|
+
{"version":3,"sources":["FireworkSDK.ts"],"names":["Platform","FWNavigator","LiveStream","FWEventName","FireworkSDKModule","FireworkSDKModuleEventEmitter","LiveStreamModule","ShoppingModule","FWLoggerUtil","VideoShopping","FireworkSDK","onCustomCTAClick","_onCustomCTAClick","value","log","setCustomCTAClickEnabled","onVideoPlayback","_onVideoPlayback","setVideoPlaybackEventEnabled","shareBaseURL","_shareBaseURL","setShareBaseURL","then","updateInternalShareBaseURL","getAdBadgeConfiguration","_adBadgeConfiguration","setAdBadgeConfiguration","valueHasChanged","badgeTextType","backgroundColor","textColor","eventEmitter","emit","AdBadgeConfigurationUpdated","appLanguage","_appLanguage","debugLogsEnabled","enabled","videoLaunchBehavior","_videoLaunchBehavior","shopping","_shopping","liveStream","_liveStream","navigator","_navigator","getInstance","_instance","constructor","addListener","SDKInit","event","error","onSDKInit","LogMessage","logNativeMessage","message","CustomCTAClick","url","VideoPlayback","eventName","VideoFeedClick","info","id","onVideoFeedClick","OS","NativeAppLanguageUpdated","language","updateInternalAppLanguage","init","options","videoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","openVideoPlayer","config","trackPurchase","parameters","changeAppLanguage","result","AppLanguageUpdated","shareBaseURLChanged","console","ShareBaseURLUpdated"],"mappings":";;AAAA,SAA6BA,QAA7B,QAA6C,cAA7C;AAEA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,SAASC,WAAT,QAA4B,sBAA5B;AAWA,OAAOC,iBAAP,IACEC,6BADF,QAEO,6BAFP;AAGA,OAAO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AuB7B,WAAW,CAAC4E,kBAAnC;AACD;AACF;;AAEOxD,EAAAA,0BAA0B,CAACJ,YAAD,EAAwB;AACxD,UAAM6D,mBAAmB,GAAG,KAAK5D,aAAL,KAAuBD,YAAnD;AACA8D,IAAAA,OAAO,CAACnE,GAAR,CAAY,yCAAZ,EAAuDK,YAAvD;AACA,SAAKC,aAAL,GAAqBD,YAArB;;AACA,QAAI6D,mBAAJ,EAAyB;AACvB,WAAKjD,YAAL,CAAkBC,IAAlB,CAAuB7B,WAAW,CAAC+E,mBAAnC;AACD;AACF;;AAzQe;;gBAAZxE,W;;AA4QN,eAAeA,WAAf","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport FWNavigator from './FWNavigator';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomCTAClickEvent,\n SDKInitEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport FireworkSDKModule, {\n FireworkSDKModuleEventEmitter,\n} from './modules/FireworkSDKModule';\nimport LiveStreamModule from './modules/LiveStreamModule';\nimport ShoppingModule from './modules/ShoppingModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\nimport VideoShopping from './VideoShopping';\n\nexport type SDKInitCallback = (event: SDKInitEvent) => void;\nexport type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;\nexport type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;\nexport type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;\n\n/**\n * Firework SDK.\n */\nclass FireworkSDK {\n private static _instance?: FireworkSDK;\n\n /**\n * The callback of SDK initialization.\n */\n public onSDKInit?: SDKInitCallback;\n\n /**\n * the callback of clicking Video Feed.\n */\n public onVideoFeedClick?: VideoFeedClickCallback;\n\n /**\n * The callback of clicking custom CTA.\n */\n public get onCustomCTAClick(): CustomCTAClickCallback | undefined {\n return this._onCustomCTAClick;\n }\n public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {\n FWLoggerUtil.log(`Set onCustomCTAClick callback ${!!value}`);\n this._onCustomCTAClick = value;\n FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);\n }\n private _onCustomCTAClick: CustomCTAClickCallback | undefined;\n\n /**\n * The callback of video playback.\n */\n public get onVideoPlayback(): VideoPlaybackCallback | undefined {\n return this._onVideoPlayback;\n }\n public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {\n this._onVideoPlayback = value;\n FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);\n }\n private _onVideoPlayback?: VideoPlaybackCallback | undefined;\n\n /**\n * The global share base URL of the video.\n * The {@link VideoPlayerConfiguration.shareBaseURL} in {@link VideoPlayerConfiguration} will override this.\n */\n public get shareBaseURL(): string | undefined {\n return this._shareBaseURL;\n }\n public set shareBaseURL(value: string | undefined) {\n FireworkSDKModule.setShareBaseURL(value ?? '').then(() => {\n this.updateInternalShareBaseURL(value);\n });\n }\n private _shareBaseURL: string | undefined;\n\n /**\n * Get the configuration for ad badges. Only supported on iOS.\n */\n public getAdBadgeConfiguration(): AdBadgeConfiguration | undefined {\n return this._adBadgeConfiguration;\n }\n /**\n * Set the configuration for ad badges. Only supported on iOS.\n */\n public async setAdBadgeConfiguration(\n value: AdBadgeConfiguration | undefined\n ): Promise<void> {\n await FireworkSDKModule.setAdBadgeConfiguration(value ?? {});\n const valueHasChanged =\n this._adBadgeConfiguration?.badgeTextType !== value?.badgeTextType ||\n this._adBadgeConfiguration?.backgroundColor !== value?.backgroundColor ||\n this._adBadgeConfiguration?.textColor !== value?.textColor;\n this._adBadgeConfiguration = value;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);\n }\n }\n private _adBadgeConfiguration: AdBadgeConfiguration | undefined;\n\n public get appLanguage(): string | undefined | null {\n return this._appLanguage;\n }\n private _appLanguage: string | undefined | null;\n\n /**\n * Defaults to false.\n * You can enable debug logs by setting this property to true.\n */\n public get debugLogsEnabled(): boolean {\n return FWLoggerUtil.enabled;\n }\n public set debugLogsEnabled(value: boolean) {\n FWLoggerUtil.enabled = value;\n }\n\n /**\n * Get video launch behavior.\n */\n public get videoLaunchBehavior(): VideoLaunchBehavior | undefined {\n return this._videoLaunchBehavior;\n }\n private _videoLaunchBehavior: VideoLaunchBehavior | undefined;\n\n private get eventEmitter(): NativeEventEmitter {\n return FireworkSDKModuleEventEmitter;\n }\n\n /**\n * Get VideoShopping object.\n */\n public get shopping(): VideoShopping {\n return this._shopping;\n }\n private _shopping: VideoShopping = VideoShopping.getInstance();\n\n /**\n * Get LiveStream object.\n */\n public get liveStream(): LiveStream {\n return this._liveStream;\n }\n private _liveStream: LiveStream = LiveStream.getInstance();\n\n /**\n * Get FWNavigator object.\n */\n public get navigator(): FWNavigator {\n return this._navigator;\n }\n private _navigator: FWNavigator = FWNavigator.getInstance();\n\n /**\n * Get global single instance of FireworkSDK class.\n * @returns FireworkSDK\n */\n public static getInstance() {\n if (!FireworkSDK._instance) {\n FireworkSDK._instance = new FireworkSDK();\n }\n\n return FireworkSDK._instance!;\n }\n\n private constructor() {\n FWLoggerUtil.log('FireworkSDK constructor');\n this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {\n FWLoggerUtil.log(`Receive SDKInit event ${event?.error}`);\n\n if (this.onSDKInit) {\n this.onSDKInit(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LogMessage, (event) => {\n FWLoggerUtil.logNativeMessage(event.message);\n });\n\n this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {\n FWLoggerUtil.log(`Receive CustomCTAClick url: ${event?.url}`);\n\n if (this.onCustomCTAClick) {\n this.onCustomCTAClick(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoPlayback, (event) => {\n FWLoggerUtil.log(\n `Receive VideoPlayback event eventName: ${event?.eventName}`\n );\n\n if (this.onVideoPlayback) {\n this.onVideoPlayback(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {\n FWLoggerUtil.log(`Receive VideoFeedClick event id: ${event?.info.id}`);\n\n if (this.onVideoFeedClick) {\n this.onVideoFeedClick(event ?? {});\n }\n });\n\n if (Platform.OS === 'ios') {\n this.eventEmitter.addListener(\n FWEventName.NativeAppLanguageUpdated,\n (event) => {\n FWLoggerUtil.log(\n `Receive NativeAppLanguageUpdated event appLanguage: ${event.appLanguage}`\n );\n const language = event.appLanguage;\n this.updateInternalAppLanguage(language);\n }\n );\n }\n }\n\n /**\n * Initializes Firework SDK.\n * @param {SDKInitOptions?} options\n */\n public async init(options?: SDKInitOptions): Promise<void> {\n FWLoggerUtil.log('Call FireworkSDK init method');\n\n FireworkSDKModule.init(options).then(() => {\n const videoLaunchBehaviorUpdated =\n this._videoLaunchBehavior !== options?.videoLaunchBehavior;\n this._videoLaunchBehavior = options?.videoLaunchBehavior;\n if (videoLaunchBehaviorUpdated) {\n this.eventEmitter.emit(FWEventName.VideoLaunchBehaviorUpdated);\n }\n });\n ShoppingModule.init();\n LiveStreamModule.init();\n }\n\n /**\n * Open Video URL.\n * @param {string} url\n * @param {VideoPlayerConfiguration} config\n */\n public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {\n FireworkSDKModule.openVideoPlayer(url, config ?? {});\n }\n\n /**\n * Records the user purchase. Only supported on iOS.\n * @param {TrackPurchaseParameters} parameters\n */\n public trackPurchase(parameters: TrackPurchaseParameters) {\n if (Platform.OS === 'ios') {\n FireworkSDKModule.trackPurchase(parameters);\n }\n }\n\n /**\n * Change App level language. Only supported on iOS.\n * @param {string | undefined | null} language Such as en, ar and en-US\n * If language is null or undefined or empty string, SDK will use system language.\n * @returns {Promise<boolean>} The result of changing app language.\n */\n public async changeAppLanguage(language?: string | null): Promise<boolean> {\n if (Platform.OS === 'ios') {\n const result = await FireworkSDKModule.changeAppLanguage(language);\n if (result) {\n this.updateInternalAppLanguage(language);\n }\n return result;\n }\n\n return false;\n }\n\n private updateInternalAppLanguage(language?: string | null) {\n const valueHasChanged = this._appLanguage !== language;\n this._appLanguage = language;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.AppLanguageUpdated);\n }\n }\n\n private updateInternalShareBaseURL(shareBaseURL?: string) {\n const shareBaseURLChanged = this._shareBaseURL !== shareBaseURL;\n console.log('updateInternalShareBaseURL shareBaseURL', shareBaseURL);\n this._shareBaseURL = shareBaseURL;\n if (shareBaseURLChanged) {\n this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);\n }\n }\n}\n\nexport default FireworkSDK;\n"]}
|
package/lib/module/LiveStream.js
CHANGED
|
@@ -9,11 +9,11 @@ import FWLoggerUtil from './utils/FWLoggerUtil';
|
|
|
9
9
|
*/
|
|
10
10
|
class LiveStream {
|
|
11
11
|
/**
|
|
12
|
-
* The callback of live stream event.
|
|
12
|
+
* The callback of live stream event.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* The callback of live stream chat event.
|
|
16
|
+
* The callback of live stream chat event.
|
|
17
17
|
*/
|
|
18
18
|
get eventEmitter() {
|
|
19
19
|
return LiveStreamModuleEventEmitter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["LiveStream.ts"],"names":["FWEventName","LiveStreamModuleEventEmitter","FWLoggerUtil","LiveStream","eventEmitter","getInstance","_instance","constructor","log","addListener","event","onLiveStreamEvent","LiveStreamChat","onLiveStreamChatEvent"],"mappings":";;AACA,SAASA,WAAT,QAA4B,sBAA5B;AAEA,SAASC,4BAAT,QAA6C,4BAA7C;AACA,OAAOC,YAAP,MAAyB,sBAAzB;;AAOA;AACA;AACA;AACA,MAAMC,UAAN,CAAiB;AAGf;AACF;AACA;;AAEE;AACF;AACA;AAG0B,MAAZC,YAAY,GAAuB;AAC7C,WAAOH,4BAAP;AACD;;AAEwB,SAAXI,WAAW,GAAG;AAC1B,QAAI,CAACF,UAAU,CAACG,SAAhB,EAA2B;AACzBH,MAAAA,UAAU,CAACG,SAAX,GAAuB,IAAIH,UAAJ,EAAvB;AACD;;AAED,WAAOA,UAAU,CAACG,SAAlB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA;;AAAA;;AACpBL,IAAAA,YAAY,CAACM,GAAb,CAAiB,wBAAjB;AACA,SAAKJ,YAAL,CAAkBK,WAAlB,CAA8BT,WAAW,CAACG,UAA1C,EAAuDO,KAAD,IAAW;AAC/D,UAAI,KAAKC,iBAAT,EAA4B;AAC1B,aAAKA,iBAAL,CAAuBD,KAAvB,aAAuBA,KAAvB,cAAuBA,KAAvB,GAAgC,EAAhC;AACD;AACF,KAJD;AAMA,SAAKN,YAAL,CAAkBK,WAAlB,CAA8BT,WAAW,CAACY,cAA1C,EAA2DF,KAAD,IAAW;AACnE,UAAI,KAAKG,qBAAT,EAAgC;AAC9B,aAAKA,qBAAL,CAA2BH,KAA3B,aAA2BA,KAA3B,cAA2BA,KAA3B,GAAoC,EAApC;AACD;AACF,KAJD;AAKD;;AArCc;;gBAAXP,U;;AAwCN,eAAeA,UAAf","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\nimport { FWEventName } from './models/FWEventName';\nimport type { LiveStreamChatEvent, LiveStreamEvent } from './models/FWEvents';\nimport { LiveStreamModuleEventEmitter } from './modules/LiveStreamModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\n\nexport type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;\nexport type onLiveStreamChatEventCallback = (\n event: LiveStreamChatEvent\n) => void;\n\n/**\n * The entry class of live stream.\n */\nclass LiveStream {\n private static _instance?: LiveStream;\n\n /**\n * The callback of live stream event
|
|
1
|
+
{"version":3,"sources":["LiveStream.ts"],"names":["FWEventName","LiveStreamModuleEventEmitter","FWLoggerUtil","LiveStream","eventEmitter","getInstance","_instance","constructor","log","addListener","event","onLiveStreamEvent","LiveStreamChat","onLiveStreamChatEvent"],"mappings":";;AACA,SAASA,WAAT,QAA4B,sBAA5B;AAEA,SAASC,4BAAT,QAA6C,4BAA7C;AACA,OAAOC,YAAP,MAAyB,sBAAzB;;AAOA;AACA;AACA;AACA,MAAMC,UAAN,CAAiB;AAGf;AACF;AACA;;AAEE;AACF;AACA;AAG0B,MAAZC,YAAY,GAAuB;AAC7C,WAAOH,4BAAP;AACD;;AAEwB,SAAXI,WAAW,GAAG;AAC1B,QAAI,CAACF,UAAU,CAACG,SAAhB,EAA2B;AACzBH,MAAAA,UAAU,CAACG,SAAX,GAAuB,IAAIH,UAAJ,EAAvB;AACD;;AAED,WAAOA,UAAU,CAACG,SAAlB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA;;AAAA;;AACpBL,IAAAA,YAAY,CAACM,GAAb,CAAiB,wBAAjB;AACA,SAAKJ,YAAL,CAAkBK,WAAlB,CAA8BT,WAAW,CAACG,UAA1C,EAAuDO,KAAD,IAAW;AAC/D,UAAI,KAAKC,iBAAT,EAA4B;AAC1B,aAAKA,iBAAL,CAAuBD,KAAvB,aAAuBA,KAAvB,cAAuBA,KAAvB,GAAgC,EAAhC;AACD;AACF,KAJD;AAMA,SAAKN,YAAL,CAAkBK,WAAlB,CAA8BT,WAAW,CAACY,cAA1C,EAA2DF,KAAD,IAAW;AACnE,UAAI,KAAKG,qBAAT,EAAgC;AAC9B,aAAKA,qBAAL,CAA2BH,KAA3B,aAA2BA,KAA3B,cAA2BA,KAA3B,GAAoC,EAApC;AACD;AACF,KAJD;AAKD;;AArCc;;gBAAXP,U;;AAwCN,eAAeA,UAAf","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\nimport { FWEventName } from './models/FWEventName';\nimport type { LiveStreamChatEvent, LiveStreamEvent } from './models/FWEvents';\nimport { LiveStreamModuleEventEmitter } from './modules/LiveStreamModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\n\nexport type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;\nexport type onLiveStreamChatEventCallback = (\n event: LiveStreamChatEvent\n) => void;\n\n/**\n * The entry class of live stream.\n */\nclass LiveStream {\n private static _instance?: LiveStream;\n\n /**\n * The callback of live stream event.\n */\n public onLiveStreamEvent?: onLiveStreamEventCallback;\n /**\n * The callback of live stream chat event.\n */\n public onLiveStreamChatEvent?: onLiveStreamChatEventCallback;\n\n private get eventEmitter(): NativeEventEmitter {\n return LiveStreamModuleEventEmitter;\n }\n\n public static getInstance() {\n if (!LiveStream._instance) {\n LiveStream._instance = new LiveStream();\n }\n\n return LiveStream._instance!;\n }\n\n private constructor() {\n FWLoggerUtil.log('LiveStream constructor');\n this.eventEmitter.addListener(FWEventName.LiveStream, (event) => {\n if (this.onLiveStreamEvent) {\n this.onLiveStreamEvent(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LiveStreamChat, (event) => {\n if (this.onLiveStreamChatEvent) {\n this.onLiveStreamChatEvent(event ?? {});\n }\n });\n }\n}\n\nexport default LiveStream;\n"]}
|