react-native-firework-sdk 1.9.0-beta.3 → 2.0.0-beta.5
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/README.md +1 -1
- package/android/build.gradle +25 -43
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +48 -193
- package/android/src/main/java/com/fireworksdk/bridge/constants/FWVideoPlayerConstant.kt +7 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +24 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModel.kt +10 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +21 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +17 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +35 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModel.kt +11 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +24 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSystemTypeface.kt +9 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +13 -13
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +70 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +9 -10
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +67 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +0 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +19 -11
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +74 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProduct.kt +17 -15
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductDeserializer.kt +120 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +4 -130
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +71 -100
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +2 -50
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +17 -35
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +145 -111
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +104 -133
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContainerActivity.kt +1 -14
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/{FWDataUtils.kt → FWDataConvertUtils.kt} +1 -11
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +5 -5
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWCommonUtil.kt +23 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +339 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +14 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +10 -12
- package/android/src/main/res/layout/fw_bridge_fragment_container.xml +2 -2
- package/android/src/main/res/values/colors.xml +2 -2
- package/android/src/main/res/values/styles.xml +0 -40
- package/ios/Components/StoryBlock.swift +1 -5
- package/ios/Components/VideoFeed.swift +17 -32
- package/ios/Components/VideoPlayerConfiguration.swift +0 -5
- package/ios/FireworkSdk-Bridging-Header.h +0 -6
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +208 -374
- package/ios/Models/NativeToRN/FireworkEventName.swift +1 -1
- package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +20 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +86 -33
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -2
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +13 -34
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +29 -0
- package/ios/Utils/{Extensions/DispatchQueue+FWOnce.swift → DispatchQueue+FWOnce.swift} +3 -3
- package/ios/Utils/FWSwizzleLoader.m +1 -1
- package/ios/Utils/FWSwizzleUtil.swift +9 -17
- package/ios/Utils/{Extensions/Swizzle/UINavigationController+FWSwizzle.swift → UINavigationController+FWSwizzle.swift} +8 -6
- package/ios/Utils/UIView+ParentViewController.swift +21 -0
- package/ios/react_native_firework_sdk.h +0 -1
- package/lib/commonjs/FWNavigator.js +8 -41
- package/lib/commonjs/FWNavigator.js.map +1 -1
- package/lib/commonjs/FireworkSDK.js +50 -77
- 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 +3 -38
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +22 -4
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +17 -26
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/AndroidFontInfo.js +2 -0
- package/lib/commonjs/models/FWEventName.js +1 -2
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/SDKInitOptions.js +2 -0
- package/lib/commonjs/modules/FWNavigatorModule.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/FWNavigator.js +9 -40
- package/lib/module/FWNavigator.js.map +1 -1
- package/lib/module/FireworkSDK.js +51 -76
- 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 +3 -37
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +20 -4
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +18 -23
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/AndroidFontInfo.js +2 -0
- package/lib/module/models/AndroidFontInfo.js.map +1 -0
- package/lib/module/models/FWEventName.js +1 -2
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/SDKInitOptions.js +2 -0
- package/lib/module/models/SDKInitOptions.js.map +1 -0
- package/lib/module/modules/FWNavigatorModule.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js +1 -2
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FWNavigator.d.ts +6 -24
- package/lib/typescript/FireworkSDK.d.ts +22 -28
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +1 -18
- package/lib/typescript/components/StoryBlock.d.ts +9 -2
- package/lib/typescript/components/VideoFeed.d.ts +12 -5
- package/lib/typescript/index.d.ts +7 -6
- package/lib/typescript/models/AndroidFontInfo.d.ts +14 -0
- package/lib/typescript/models/FWEventName.d.ts +1 -2
- package/lib/typescript/models/FWEvents.d.ts +0 -6
- package/lib/typescript/models/SDKInitOptions.d.ts +6 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +11 -14
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +1 -6
- package/lib/typescript/modules/FWNavigatorModule.d.ts +0 -3
- package/lib/typescript/modules/FireworkSDKModule.d.ts +4 -5
- package/lib/typescript/modules/ShoppingModule.d.ts +0 -2
- package/package.json +1 -1
- package/react-native-firework-sdk.podspec +18 -15
- package/src/FWNavigator.ts +8 -42
- package/src/FireworkSDK.ts +55 -71
- package/src/LiveStream.ts +2 -2
- package/src/VideoShopping.ts +4 -54
- package/src/components/StoryBlock.tsx +25 -4
- package/src/components/VideoFeed.tsx +22 -21
- package/src/index.ts +5 -11
- package/src/models/AndroidFontInfo.ts +14 -0
- package/src/models/FWEventName.ts +1 -2
- package/src/models/FWEvents.ts +0 -7
- package/src/models/SDKInitOptions.ts +7 -0
- package/src/models/VideoFeedConfiguration.ts +11 -14
- package/src/models/VideoPlayerConfiguration.ts +1 -7
- package/src/modules/FWNavigatorModule.ts +0 -1
- package/src/modules/FireworkSDKModule.ts +6 -8
- package/src/modules/ShoppingModule.ts +0 -5
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGsonUtil.kt +0 -38
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +0 -123
- package/android/src/main/res/layout/fw_bridge_fragment_playlistfeed.xml +0 -18
- package/android/src/main/res/layout/fw_bridge_fragment_shoppingcart.xml +0 -8
- package/android/src/main/res/layout/fw_bridge_fragment_videofeed.xml +0 -17
- package/ios/Utils/AppLanguage/Bundle+FWSwizzle.swift +0 -58
- package/ios/Utils/AppLanguage/FWAppLanguageManager.swift +0 -118
- package/ios/Utils/AppLanguage/FWLanguageUtil.swift +0 -39
- package/ios/Utils/AppLanguage/NumberFormatter+FWSwizzle.swift +0 -25
- package/ios/Utils/AppLanguage/UIImageView+FWSwizzle.swift +0 -91
- package/ios/Utils/AppLanguage/UILabel+FWSwizzle.swift +0 -98
- package/ios/Utils/AppLanguage/UITextField+FWSwizzle.swift +0 -97
- package/ios/Utils/AppLanguage/UITextView+FWSwizzle.swift +0 -97
- package/ios/Utils/AppLanguage/UIView+FWSwizzle.swift +0 -38
- package/ios/Utils/AppLanguage/UIViewController+FWSwizzle.swift +0 -32
- package/ios/Utils/AppLanguage/UIWindow+FWSwizzle.swift +0 -26
- package/ios/Utils/AppLanguage/URLSession+FWSwizzle.swift +0 -69
- package/ios/Utils/Extensions/UIView+FWUIHierarchy.swift +0 -47
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.h +0 -25
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.m +0 -75
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.h +0 -21
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.m +0 -124
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.h +0 -11
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.m +0 -86
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.h +0 -16
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.m +0 -55
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.h +0 -18
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.m +0 -39
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.h +0 -54
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.m +0 -141
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.h +0 -16
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.m +0 -20
- package/ios/Utils/FWRTL/Classes/Utils/FWRTLDefinitions.h +0 -52
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.h +0 -19
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.m +0 -49
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.h +0 -21
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.m +0 -38
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.h +0 -18
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.m +0 -43
- package/ios/Utils/FWSwizzleLoader.swift +0 -13
- package/ios/scripts/firework_sdk_pods.rb +0 -3
- package/lib/commonjs/models/NewNativeContainerProps.js +0 -2
- package/lib/module/models/NewNativeContainerProps.js +0 -2
- package/lib/typescript/models/NewNativeContainerProps.d.ts +0 -6
- package/src/models/NewNativeContainerProps.ts +0 -4
- /package/ios/Utils/{Extensions/String+Color.swift → String+Color.swift} +0 -0
- /package/ios/Utils/{Extensions/UIView+Constraints.swift → UIView+Constraints.swift} +0 -0
- /package/ios/Utils/{Extensions/UIViewController+AttachChild.swift → UIViewController+AttachChild.swift} +0 -0
- /package/lib/commonjs/models/{NewNativeContainerProps.js.map → AndroidFontInfo.js.map} +0 -0
- /package/lib/{module/models/NewNativeContainerProps.js.map → commonjs/models/SDKInitOptions.js.map} +0 -0
|
@@ -23,13 +23,16 @@ import FWVideoFeed from './FWVideoFeed';
|
|
|
23
23
|
|
|
24
24
|
export type VideoFeedMode = 'row' | 'column' | 'grid';
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* The props of VideoFeed component.
|
|
28
|
+
*/
|
|
26
29
|
export interface IVideoFeedProps {
|
|
27
30
|
/**
|
|
28
31
|
* Standard React Native View Style.
|
|
29
32
|
*/
|
|
30
33
|
style?: StyleProp<ViewStyle>;
|
|
31
34
|
/**
|
|
32
|
-
* One of five available video feed sources.
|
|
35
|
+
* One of five available video feed sources.The playlistGroup is only supported on iOS
|
|
33
36
|
*/
|
|
34
37
|
source: VideoFeedSource;
|
|
35
38
|
/**
|
|
@@ -41,7 +44,7 @@ export interface IVideoFeedProps {
|
|
|
41
44
|
*/
|
|
42
45
|
playlist?: string;
|
|
43
46
|
/**
|
|
44
|
-
* PlaylistGroup id of the feed. Required when the source is set as playlistGroup.
|
|
47
|
+
* PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.
|
|
45
48
|
*/
|
|
46
49
|
playlistGroup?: string;
|
|
47
50
|
/**
|
|
@@ -65,18 +68,21 @@ export interface IVideoFeedProps {
|
|
|
65
68
|
*/
|
|
66
69
|
adConfiguration?: AdConfiguration;
|
|
67
70
|
/**
|
|
68
|
-
* Specifies if Picture in Picture is enabled.
|
|
71
|
+
* Specifies if Picture in Picture is enabled.
|
|
69
72
|
*/
|
|
70
73
|
enablePictureInPicture?: boolean;
|
|
71
74
|
/**
|
|
72
|
-
* The feed loading result callback. It means loading successfully when error equals to undefined.
|
|
75
|
+
* The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.
|
|
73
76
|
*/
|
|
74
77
|
onVideoFeedLoadFinished?: (error?: FWError) => void;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
const NativeComponentName = 'FWVideoFeed';
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
/**
|
|
83
|
+
* VideoFeed component.
|
|
84
|
+
*/
|
|
85
|
+
class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
80
86
|
static defaultProps = {
|
|
81
87
|
mode: 'row',
|
|
82
88
|
};
|
|
@@ -152,15 +158,15 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
152
158
|
);
|
|
153
159
|
this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);
|
|
154
160
|
|
|
155
|
-
const
|
|
161
|
+
const subscriptionOfVideoLaunchBehaviorUpdated =
|
|
156
162
|
FireworkSDKModuleEventEmitter.addListener(
|
|
157
|
-
FWEventName.
|
|
163
|
+
FWEventName.VideoLaunchBehaviorUpdated,
|
|
158
164
|
() => {
|
|
159
|
-
FWLoggerUtil.log('Receive FWEventName.
|
|
165
|
+
FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');
|
|
160
166
|
this.setState({});
|
|
161
167
|
}
|
|
162
168
|
);
|
|
163
|
-
this.subscriptions.push(
|
|
169
|
+
this.subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);
|
|
164
170
|
}
|
|
165
171
|
|
|
166
172
|
componentWillUnmount() {
|
|
@@ -190,10 +196,9 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
190
196
|
const videoFeedConfiguration = this._getVideoFeedConfiguration();
|
|
191
197
|
const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;
|
|
192
198
|
const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';
|
|
193
|
-
const
|
|
194
|
-
const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
199
|
+
const shareBaseURL = FireworkSDK.getInstance().getShareBaseURL() ?? '';
|
|
195
200
|
const adBadgeConfiguration =
|
|
196
|
-
FireworkSDK.getInstance().
|
|
201
|
+
FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};
|
|
197
202
|
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
198
203
|
const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
|
|
199
204
|
const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
|
|
@@ -201,17 +206,13 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
201
206
|
this._generateDynamicContentParametersString();
|
|
202
207
|
const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;
|
|
203
208
|
|
|
204
|
-
let enablePictureInPictureLegacy = false;
|
|
205
|
-
if (videoFeedConfiguration) {
|
|
206
|
-
enablePictureInPictureLegacy =
|
|
207
|
-
(videoFeedConfiguration as any).enablePictureInPicture ?? false;
|
|
208
|
-
}
|
|
209
209
|
const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;
|
|
210
210
|
const requiresAds = adConfiguration?.requiresAds ?? false;
|
|
211
211
|
const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;
|
|
212
212
|
const vastAttributesString = this._generateVastAttributesString();
|
|
213
213
|
const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;
|
|
214
|
-
const
|
|
214
|
+
const videoLaunchBehavior =
|
|
215
|
+
FireworkSDK.getInstance().getVideoLaunchBehavior() ?? 'default';
|
|
215
216
|
|
|
216
217
|
let key = `source:${source}`;
|
|
217
218
|
key += `_channel:${channel}`;
|
|
@@ -220,7 +221,6 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
220
221
|
key += `_mode:${mode}`;
|
|
221
222
|
key += `_titleHidden:${titleHidden}`;
|
|
222
223
|
key += `_titlePosition:${titlePosition}`;
|
|
223
|
-
key += `_customLayoutName:${customLayoutName}`;
|
|
224
224
|
key += `_shareBaseURL:${shareBaseURL}`;
|
|
225
225
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
226
226
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
@@ -228,13 +228,12 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
228
228
|
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
229
229
|
key += `_enableAutoplay:${enableAutoplay}`;
|
|
230
230
|
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
231
|
-
key += `_enablePictureInPictureLegacy:${enablePictureInPictureLegacy}`;
|
|
232
231
|
key += `_gridColumns:${gridColumns}`;
|
|
233
232
|
key += `_requiresAds:${requiresAds}`;
|
|
234
233
|
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
235
234
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
236
235
|
key += `_showAdBadge:${showAdBadge}`;
|
|
237
|
-
key += `
|
|
236
|
+
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
238
237
|
|
|
239
238
|
return (
|
|
240
239
|
<FWVideoFeed
|
|
@@ -307,3 +306,5 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
307
306
|
}
|
|
308
307
|
}
|
|
309
308
|
}
|
|
309
|
+
|
|
310
|
+
export default VideoFeed;
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
VideoPlaybackCallback,
|
|
10
10
|
} from './FireworkSDK';
|
|
11
11
|
import FireworkSDK from './FireworkSDK';
|
|
12
|
-
import type { FWNativeContainerProps } from './FWNavigator';
|
|
13
12
|
import FWNavigator from './FWNavigator';
|
|
14
13
|
import type {
|
|
15
14
|
onLiveStreamChatEventCallback,
|
|
@@ -21,6 +20,7 @@ import type { AdBadgeTextType } from './models/AdBadgeConfiguration';
|
|
|
21
20
|
import type AdConfiguration from './models/AdConfiguration';
|
|
22
21
|
import type { VastAttribute } from './models/AdConfiguration';
|
|
23
22
|
import type AddToCartResult from './models/AddToCartResult';
|
|
23
|
+
import type AndroidFontInfo from './models/AndroidFontInfo';
|
|
24
24
|
import type FeedItemDetails from './models/FeedItemDetails';
|
|
25
25
|
import type FWError from './models/FWError';
|
|
26
26
|
import type {
|
|
@@ -33,7 +33,6 @@ import type {
|
|
|
33
33
|
UpdateProductDetailsEvent,
|
|
34
34
|
VideoFeedClickEvent,
|
|
35
35
|
VideoPlaybackEvent,
|
|
36
|
-
WillDisplayProductEvent,
|
|
37
36
|
} from './models/FWEvents';
|
|
38
37
|
import type IOSFontInfo from './models/IOSFontInfo';
|
|
39
38
|
import type {
|
|
@@ -44,7 +43,6 @@ import LiveStreamChatEventName from './models/LiveStreamChatEventName';
|
|
|
44
43
|
import type LiveStreamEventDetails from './models/LiveStreamEventDetails';
|
|
45
44
|
import LiveStreamEventName from './models/LiveStreamEventName';
|
|
46
45
|
import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
|
|
47
|
-
import type { NewNativeContainerProps } from './models/NewNativeContainerProps';
|
|
48
46
|
import type Product from './models/Product';
|
|
49
47
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
50
48
|
import type {
|
|
@@ -53,6 +51,8 @@ import type {
|
|
|
53
51
|
} from './models/ProductInfoViewConfiguration';
|
|
54
52
|
import type ProductUnit from './models/ProductUnit';
|
|
55
53
|
import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
|
|
54
|
+
import type SDKInitOptions from './models/SDKInitOptions';
|
|
55
|
+
import type { VideoLaunchBehavior } from './models/SDKInitOptions';
|
|
56
56
|
import type { StoryBlockSource } from './models/StoryBlockSource';
|
|
57
57
|
import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
|
|
58
58
|
import type VideoFeedConfiguration from './models/VideoFeedConfiguration';
|
|
@@ -68,7 +68,6 @@ import type { VideoPlayerSize } from './models/VideoPlaybackDetails';
|
|
|
68
68
|
import VideoPlaybackEventName from './models/VideoPlaybackEventName';
|
|
69
69
|
import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
|
|
70
70
|
import type {
|
|
71
|
-
VideoLaunchBehavior,
|
|
72
71
|
VideoPlayerCompleteAction,
|
|
73
72
|
VideoPlayerCTADelay,
|
|
74
73
|
VideoPlayerCTADelayType,
|
|
@@ -77,11 +76,9 @@ import type {
|
|
|
77
76
|
} from './models/VideoPlayerConfiguration';
|
|
78
77
|
import type {
|
|
79
78
|
AddToCartCallback,
|
|
80
|
-
ClickCartIconCallback,
|
|
81
79
|
CustomClickCartIconCallback,
|
|
82
80
|
CustomClickLinkButtonCallback,
|
|
83
81
|
UpdateProductDetailsCallback,
|
|
84
|
-
WillDisplayProductCallback,
|
|
85
82
|
} from './VideoShopping';
|
|
86
83
|
import VideoShopping from './VideoShopping';
|
|
87
84
|
|
|
@@ -95,7 +92,7 @@ export {
|
|
|
95
92
|
AddToCartCallback,
|
|
96
93
|
AddToCartEvent,
|
|
97
94
|
AddToCartResult,
|
|
98
|
-
|
|
95
|
+
AndroidFontInfo,
|
|
99
96
|
CustomClickCartIconCallback,
|
|
100
97
|
CustomClickLinkButtonCallback,
|
|
101
98
|
CustomClickLinkButtonEvent,
|
|
@@ -104,7 +101,6 @@ export {
|
|
|
104
101
|
FeedItemDetails,
|
|
105
102
|
FireworkSDK,
|
|
106
103
|
FWError,
|
|
107
|
-
FWNativeContainerProps,
|
|
108
104
|
FWNavigator,
|
|
109
105
|
IOSFontInfo,
|
|
110
106
|
IOSSystemFontStyle,
|
|
@@ -119,7 +115,6 @@ export {
|
|
|
119
115
|
LiveStreamEventDetails,
|
|
120
116
|
LiveStreamEventName,
|
|
121
117
|
LiveStreamMessageDetails,
|
|
122
|
-
NewNativeContainerProps,
|
|
123
118
|
onLiveStreamChatEventCallback,
|
|
124
119
|
onLiveStreamEventCallback,
|
|
125
120
|
Product,
|
|
@@ -129,6 +124,7 @@ export {
|
|
|
129
124
|
ProductUnitOption,
|
|
130
125
|
SDKInitCallback,
|
|
131
126
|
SDKInitEvent,
|
|
127
|
+
SDKInitOptions,
|
|
132
128
|
StoryBlock,
|
|
133
129
|
StoryBlockSource,
|
|
134
130
|
TrackPurchaseParameters,
|
|
@@ -158,6 +154,4 @@ export {
|
|
|
158
154
|
VideoPlayerSize,
|
|
159
155
|
VideoPlayerStyle,
|
|
160
156
|
VideoShopping,
|
|
161
|
-
WillDisplayProductCallback,
|
|
162
|
-
WillDisplayProductEvent,
|
|
163
157
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Only supported on Android.
|
|
3
|
+
*/
|
|
4
|
+
export default interface AndroidFontInfo {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to use a custom font. Default is false.
|
|
7
|
+
*/
|
|
8
|
+
isCustom?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The Android system typeface name, such as "DEFAULT", "DEFAULT_BOLD", "SANS_SERIF", "SERIF", "MONOSPACE".
|
|
11
|
+
* Or custom font name, such as: "fonts/kaushanscript_regular.ttf". (You need to set the isCustom=true and put the font file in the "assets" directory: app/src/main/assets/fonts/kaushanscript_regular.ttf)
|
|
12
|
+
*/
|
|
13
|
+
typefaceName?: string;
|
|
14
|
+
}
|
|
@@ -6,12 +6,11 @@ export enum FWEventName {
|
|
|
6
6
|
AddToCart = 'fw:shopping:add-to-cart',
|
|
7
7
|
ClickCartIcon = 'fw:shopping:click-cart-icon',
|
|
8
8
|
UpdateProductDetails = 'fw:shopping:update-product-details',
|
|
9
|
-
WillDisplayProduct = 'fw:shopping:will-display-product',
|
|
10
9
|
LiveStream = 'fw:livestream',
|
|
11
10
|
LiveStreamChat = 'fw:livestream-chat',
|
|
12
11
|
ShareBaseURLUpdated = 'fw:share-base-url-updated',
|
|
12
|
+
VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',
|
|
13
13
|
AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',
|
|
14
|
-
AppLanguageUpdated = 'fw:app-language-updated',
|
|
15
14
|
LogMessage = 'fw:log-message',
|
|
16
15
|
CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',
|
|
17
16
|
}
|
package/src/models/FWEvents.ts
CHANGED
|
@@ -48,13 +48,6 @@ export interface UpdateProductDetailsEvent {
|
|
|
48
48
|
productIds: string[];
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export interface WillDisplayProductEvent {
|
|
52
|
-
/**
|
|
53
|
-
* A unique identifier of the video.
|
|
54
|
-
*/
|
|
55
|
-
videoId: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
51
|
export interface LiveStreamEvent {
|
|
59
52
|
eventName: LiveStreamEventName;
|
|
60
53
|
info: LiveStreamEventDetails;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
|
+
import type AndroidFontInfo from './AndroidFontInfo';
|
|
2
3
|
|
|
3
4
|
export interface VideoFeedTitleConfiguration {
|
|
4
5
|
/**
|
|
@@ -6,11 +7,11 @@ export interface VideoFeedTitleConfiguration {
|
|
|
6
7
|
*/
|
|
7
8
|
hidden?: boolean;
|
|
8
9
|
/**
|
|
9
|
-
* The text color of video feed title.
|
|
10
|
+
* The text color of video feed title.
|
|
10
11
|
*/
|
|
11
12
|
textColor?: string;
|
|
12
13
|
/**
|
|
13
|
-
* The font size of video feed title.
|
|
14
|
+
* The font size of video feed title.
|
|
14
15
|
*/
|
|
15
16
|
fontSize?: number;
|
|
16
17
|
/**
|
|
@@ -19,6 +20,12 @@ export interface VideoFeedTitleConfiguration {
|
|
|
19
20
|
* Only supported on iOS.
|
|
20
21
|
*/
|
|
21
22
|
iOSFontInfo?: IOSFontInfo;
|
|
23
|
+
/**
|
|
24
|
+
* The Android font info of "VideoFeedTitle".
|
|
25
|
+
* The property is ignored when fontSize is not set.
|
|
26
|
+
* Only supported on Android.
|
|
27
|
+
*/
|
|
28
|
+
androidFontInfo?: AndroidFontInfo;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
export interface VideoFeedPlayIconConfiguration {
|
|
@@ -41,7 +48,7 @@ export default interface VideoFeedConfiguration {
|
|
|
41
48
|
*/
|
|
42
49
|
backgroundColor?: string;
|
|
43
50
|
/**
|
|
44
|
-
* Corner radius of video feed item.
|
|
51
|
+
* Corner radius of video feed item.
|
|
45
52
|
*/
|
|
46
53
|
cornerRadius?: number;
|
|
47
54
|
/**
|
|
@@ -53,17 +60,13 @@ export default interface VideoFeedConfiguration {
|
|
|
53
60
|
*/
|
|
54
61
|
titlePosition?: VideoFeedTitlePosition;
|
|
55
62
|
/**
|
|
56
|
-
* Configuration of video feed item play icon.
|
|
63
|
+
* Configuration of video feed item play icon.
|
|
57
64
|
*/
|
|
58
65
|
playIcon?: VideoFeedPlayIconConfiguration;
|
|
59
66
|
/**
|
|
60
67
|
* Indicates if the video feed item shows ad badge.
|
|
61
68
|
*/
|
|
62
69
|
showAdBadge?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Custom layout name for video feed item. Only supported on Android.
|
|
65
|
-
*/
|
|
66
|
-
customLayoutName?: string;
|
|
67
70
|
/**
|
|
68
71
|
* The aspect ratio(width / height) for video feed item. Only supported on iOS.
|
|
69
72
|
*/
|
|
@@ -86,10 +89,4 @@ export default interface VideoFeedConfiguration {
|
|
|
86
89
|
* The property value needs to be an integer and greater than 0.
|
|
87
90
|
*/
|
|
88
91
|
gridColumns?: number;
|
|
89
|
-
/**
|
|
90
|
-
* Please use the enablePictureInPicture in IVideoFeedProps. Only supported on iOS.
|
|
91
|
-
*
|
|
92
|
-
* @deprecated The property will be deprecated since RN SDK V2.
|
|
93
|
-
*/
|
|
94
|
-
enablePictureInPicture?: boolean;
|
|
95
92
|
}
|
|
@@ -35,8 +35,6 @@ export interface VideoPlayerCTADelay {
|
|
|
35
35
|
value: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
|
|
39
|
-
|
|
40
38
|
export default interface VideoPlayerConfiguration {
|
|
41
39
|
/**
|
|
42
40
|
* Sets the proportion of the video player to its container.
|
|
@@ -62,10 +60,6 @@ export default interface VideoPlayerConfiguration {
|
|
|
62
60
|
* Indicates if the video player shows mute button.
|
|
63
61
|
*/
|
|
64
62
|
showMuteButton?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Specifies the video player launch behavior.
|
|
67
|
-
*/
|
|
68
|
-
launchBehavior?: VideoLaunchBehavior;
|
|
69
63
|
/**
|
|
70
64
|
* Indicates if Firework branding should be showed or not.
|
|
71
65
|
*/
|
|
@@ -75,7 +69,7 @@ export default interface VideoPlayerConfiguration {
|
|
|
75
69
|
*/
|
|
76
70
|
ctaDelay?: VideoPlayerCTADelay;
|
|
77
71
|
/**
|
|
78
|
-
* Specifies the delay before the highlight animation occurs.
|
|
72
|
+
* Specifies the delay before the highlight animation occurs. Only supported on iOS.
|
|
79
73
|
*/
|
|
80
74
|
ctaHighlightDelay?: VideoPlayerCTADelay;
|
|
81
75
|
}
|
|
@@ -13,7 +13,6 @@ const FWNavigatorModule = NativeModules.FWNavigatorModule
|
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
interface IFWNavigatorModule extends NativeModule {
|
|
16
|
-
pushNativeContainer(props: { [key: string]: any }): Promise<boolean>;
|
|
17
16
|
popNativeContainer(): Promise<boolean>;
|
|
18
17
|
canPopNativeContainer(): Promise<boolean>;
|
|
19
18
|
startFloatingPlayer(): Promise<boolean>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NativeEventEmitter, NativeModule } from 'react-native';
|
|
2
|
-
import { NativeModules } from 'react-native';
|
|
3
|
-
import type AdBadgeConfiguration from '../models/AdBadgeConfiguration';
|
|
1
|
+
import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';
|
|
4
2
|
|
|
5
3
|
import { LINKING_ERROR } from '../constants/FWErrorMessage';
|
|
6
|
-
import type
|
|
4
|
+
import type AdBadgeConfiguration from '../models/AdBadgeConfiguration';
|
|
5
|
+
import type SDKInitOptions from '../models/SDKInitOptions';
|
|
7
6
|
import type TrackPurchaseParameters from '../models/TrackPurchaseParameters';
|
|
7
|
+
import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
|
|
8
8
|
|
|
9
9
|
const FireworkSDKModule = NativeModules.FireworkSDK
|
|
10
10
|
? NativeModules.FireworkSDK
|
|
@@ -18,17 +18,15 @@ const FireworkSDKModule = NativeModules.FireworkSDK
|
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
interface IFireworkSDKModule extends NativeModule {
|
|
21
|
-
init(
|
|
21
|
+
init(options?: SDKInitOptions): Promise<any>;
|
|
22
22
|
openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;
|
|
23
23
|
setCustomCTAClickEnabled(enabled: boolean): void;
|
|
24
|
-
setCustomCTALinkContentPageRouteName(name?: string): Promise<any>;
|
|
25
24
|
setShareBaseURL(url?: string): Promise<any>;
|
|
26
25
|
setVideoPlaybackEventEnabled(enabled: boolean): void;
|
|
27
26
|
setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;
|
|
28
|
-
setAppComponentName(name?: string): Promise<any>;
|
|
29
27
|
trackPurchase(parameters: TrackPurchaseParameters): void;
|
|
30
28
|
changeAppLanguage(language: string): Promise<boolean>;
|
|
31
|
-
restart(): Promise<
|
|
29
|
+
restart(): Promise<any>;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
const FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import { LINKING_ERROR } from '../constants/FWErrorMessage';
|
|
4
|
-
import type { NewNativeContainerProps } from '../models/NewNativeContainerProps';
|
|
5
4
|
import type Product from '../models/Product';
|
|
6
5
|
import type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';
|
|
7
6
|
|
|
@@ -24,10 +23,6 @@ interface IShoppingModule extends NativeModule {
|
|
|
24
23
|
tips: string,
|
|
25
24
|
callbackId: number | string
|
|
26
25
|
): void;
|
|
27
|
-
jumpToCartPage(
|
|
28
|
-
callbackId: number | string,
|
|
29
|
-
props: NewNativeContainerProps
|
|
30
|
-
): void;
|
|
31
26
|
setCartIconVisible(visible: boolean): void;
|
|
32
27
|
setCartItemCount(count: number): void;
|
|
33
28
|
setCustomClickCartIconEnabled(enabled: boolean): Promise<void>; // Only supported on iOS
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
package com.fireworksdk.bridge.utils
|
|
2
|
-
|
|
3
|
-
import com.google.gson.Gson
|
|
4
|
-
import java.lang.reflect.Type
|
|
5
|
-
|
|
6
|
-
object FWGsonUtil {
|
|
7
|
-
|
|
8
|
-
private val gson by lazy {
|
|
9
|
-
Gson()
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
fun toJson(ts: Any?): String? {
|
|
13
|
-
return gson.toJson(ts)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
fun <T> fromJson(json: String?, type: Class<T>): T? {
|
|
17
|
-
if (json.isNullOrBlank()) {
|
|
18
|
-
return null
|
|
19
|
-
}
|
|
20
|
-
return gson.fromJson(json, type)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
fun <T> fromJson(json: String?, type: Type): T? {
|
|
24
|
-
if (json.isNullOrBlank()) {
|
|
25
|
-
return null
|
|
26
|
-
}
|
|
27
|
-
return gson.fromJson(json, type)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
fun <T> fromObject(o: Any?, type: Class<T>): T? {
|
|
31
|
-
if (o == null) {
|
|
32
|
-
return null
|
|
33
|
-
}
|
|
34
|
-
val jsonString = toJson(o)
|
|
35
|
-
return gson.fromJson(jsonString, type)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
package com.fireworksdk.bridge.utils
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
import android.graphics.Color
|
|
5
|
-
import com.loopnow.fireworklibrary.VideoPlayerProperties
|
|
6
|
-
import com.fireworksdk.bridge.constants.FWVideoPlayerConstant
|
|
7
|
-
import com.fireworksdk.bridge.models.FWAdBadgeConfigModel
|
|
8
|
-
import com.fireworksdk.bridge.models.FWVideoFeedConfigModel
|
|
9
|
-
import com.fireworksdk.bridge.models.FWVideoFeedTitlePosition
|
|
10
|
-
import com.fireworksdk.bridge.models.FWVideoPlayerConfigModel
|
|
11
|
-
import com.loopnow.fireworklibrary.AdLabelType
|
|
12
|
-
import com.loopnow.fireworklibrary.VideoFeedProperties
|
|
13
|
-
import com.loopnow.fireworklibrary.models.FeedTitlePosition
|
|
14
|
-
import com.loopnow.fireworklibrary.views.PlaylistGroupFeedView
|
|
15
|
-
import com.loopnow.fireworklibrary.views.VideoFeedView
|
|
16
|
-
|
|
17
|
-
object FWVideoPlayerUtils {
|
|
18
|
-
|
|
19
|
-
var customCTAClickEnabled: Boolean = false
|
|
20
|
-
var videoPlaybackEventEnabled: Boolean = false
|
|
21
|
-
var customClickLinkButtonEnabled: Boolean = false
|
|
22
|
-
|
|
23
|
-
private var hasAssignedLaunchAppWithMute = false
|
|
24
|
-
/**
|
|
25
|
-
* if true, mute when open player (can be set only once)
|
|
26
|
-
*/
|
|
27
|
-
private var launchPlayerWithMute = false
|
|
28
|
-
set(value) {
|
|
29
|
-
if (!hasAssignedLaunchAppWithMute) {
|
|
30
|
-
hasAssignedLaunchAppWithMute = true
|
|
31
|
-
VideoPlayerProperties.launchPlayerWithMute = value
|
|
32
|
-
field = value
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fun setAdBadgeConfig(config: FWAdBadgeConfigModel?) {
|
|
38
|
-
val badgeTextType = config?.badgeTextType
|
|
39
|
-
when {
|
|
40
|
-
badgeTextType.equals(FWVideoPlayerConstant.FW_AD_BADGE_LABEL_AD) -> {
|
|
41
|
-
VideoFeedProperties.setAdLabel(AdLabelType.AD)
|
|
42
|
-
}
|
|
43
|
-
badgeTextType.equals(FWVideoPlayerConstant.FW_AD_BADGE_LABEL_SPONSORED) -> {
|
|
44
|
-
VideoFeedProperties.setAdLabel(AdLabelType.SPONSORED)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
fun setPlaylistGroupFeedConfig(context: Context, feedView: PlaylistGroupFeedView?, config: FWVideoFeedConfigModel?) {
|
|
50
|
-
config?.customLayoutName?.let {
|
|
51
|
-
val layout = context.resources.getIdentifier(it, "layout", context.packageName)
|
|
52
|
-
feedView?.setCustomLayout(layout)
|
|
53
|
-
}
|
|
54
|
-
val backgroundColor = config?.backgroundColor
|
|
55
|
-
if (!backgroundColor.isNullOrBlank()) {
|
|
56
|
-
feedView?.setBackgroundColor(Color.parseColor(backgroundColor))
|
|
57
|
-
} else {
|
|
58
|
-
feedView?.setBackgroundColor(Color.TRANSPARENT)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
feedView?.setTitleVisible(config?.title?.hidden != true)
|
|
62
|
-
|
|
63
|
-
val titlePosition = when {
|
|
64
|
-
config?.titlePosition.equals(FWVideoFeedTitlePosition.Stacked.rawValue) -> FeedTitlePosition.BELOW
|
|
65
|
-
else -> FeedTitlePosition.ALIGN_BOTTOM
|
|
66
|
-
}
|
|
67
|
-
feedView?.setTitlePosition(titlePosition)
|
|
68
|
-
VideoFeedProperties.displayAdLabel = config?.showAdBadge == true
|
|
69
|
-
feedView?.viewModel?.apply {
|
|
70
|
-
val columns = config?.gridColumns ?: 0
|
|
71
|
-
gridColumns = if (columns > 0) {
|
|
72
|
-
columns
|
|
73
|
-
} else {
|
|
74
|
-
2
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
fun setVideoFeedConfig(context: Context, feedView: VideoFeedView?, config: FWVideoFeedConfigModel?) {
|
|
80
|
-
config?.customLayoutName?.let {
|
|
81
|
-
val layout = context.resources.getIdentifier(it, "layout", context.packageName)
|
|
82
|
-
feedView?.setCustomLayout(layout)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
val backgroundColor = config?.backgroundColor
|
|
86
|
-
if (!backgroundColor.isNullOrBlank()) {
|
|
87
|
-
feedView?.setBackgroundColor(Color.parseColor(backgroundColor))
|
|
88
|
-
} else {
|
|
89
|
-
feedView?.setBackgroundColor(Color.TRANSPARENT)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
feedView?.setTitleVisible(config?.title?.hidden != true)
|
|
93
|
-
|
|
94
|
-
val titlePosition = when {
|
|
95
|
-
config?.titlePosition.equals(FWVideoFeedTitlePosition.Stacked.rawValue) -> FeedTitlePosition.BELOW
|
|
96
|
-
else -> FeedTitlePosition.ALIGN_BOTTOM
|
|
97
|
-
}
|
|
98
|
-
feedView?.setTitlePosition(titlePosition)
|
|
99
|
-
feedView?.setAutoPlayOnFeed(config?.enableAutoplay == true)
|
|
100
|
-
VideoFeedProperties.displayAdLabel = config?.showAdBadge == true
|
|
101
|
-
feedView?.viewModel?.apply {
|
|
102
|
-
val columns = config?.gridColumns ?: 0
|
|
103
|
-
gridColumns = if (columns > 0) {
|
|
104
|
-
columns
|
|
105
|
-
} else {
|
|
106
|
-
2
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
fun setVideoPlayerConfig(config: FWVideoPlayerConfigModel?) {
|
|
112
|
-
VideoPlayerProperties.branding = config?.showBranding != false
|
|
113
|
-
VideoPlayerProperties.share = config?.showShareButton != false
|
|
114
|
-
VideoPlayerProperties.loop = config?.videoCompleteAction != FWVideoPlayerConstant.FW_VIDEO_COMPLETE_ACTION_ADVANCE_TO_NEXT
|
|
115
|
-
// VideoPlayerProperties.autoPlayOnComplete = config?.videoCompleteAction != FWVideoPlayerConstant.FW_VIDEO_COMPLETE_ACTION_LOOP
|
|
116
|
-
VideoPlayerProperties.fullScreenPlayer = config?.playerStyle != FWVideoPlayerConstant.FW_PLAYER_STYLE_FIT
|
|
117
|
-
VideoPlayerProperties.enableOneTouchMute = config?.showMuteButton == true
|
|
118
|
-
VideoPlayerProperties.enablePlayPauseControl = config?.showPlaybackButton == true
|
|
119
|
-
if (config?.launchBehavior != null) {
|
|
120
|
-
launchPlayerWithMute = config.launchBehavior == FWVideoPlayerConstant.FW_PLAYER_LAUNCH_BEHAVIOR_MUTE_ON_FIRST_LAUNCH
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<androidx.constraintlayout.widget.ConstraintLayout
|
|
3
|
-
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
5
|
-
android:id="@+id/fw_bridge_playlistfeed_container"
|
|
6
|
-
android:background="@color/fw_bridge_white"
|
|
7
|
-
android:layout_width="match_parent"
|
|
8
|
-
android:layout_height="match_parent">
|
|
9
|
-
|
|
10
|
-
<com.loopnow.fireworklibrary.views.PlaylistGroupFeedView
|
|
11
|
-
android:id="@+id/fw_bridge_playlistfeed"
|
|
12
|
-
android:layout_width="match_parent"
|
|
13
|
-
android:layout_height="match_parent"
|
|
14
|
-
app:imageStyle="@style/FWFeedViewImageStyle"
|
|
15
|
-
app:textStyle="@style/FWFeedViewCaptionStyle"
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<androidx.constraintlayout.widget.ConstraintLayout
|
|
3
|
-
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
-
android:id="@+id/fw_bridge_shopping_cart_container"
|
|
5
|
-
android:layout_width="match_parent"
|
|
6
|
-
android:layout_height="match_parent">
|
|
7
|
-
|
|
8
|
-
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<androidx.constraintlayout.widget.ConstraintLayout
|
|
3
|
-
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
5
|
-
android:id="@+id/fw_bridge_videofeed_container"
|
|
6
|
-
android:layout_width="match_parent"
|
|
7
|
-
android:layout_height="match_parent">
|
|
8
|
-
|
|
9
|
-
<com.loopnow.fireworklibrary.views.VideoFeedView
|
|
10
|
-
android:id="@+id/fw_bridge_videofeed"
|
|
11
|
-
android:layout_width="match_parent"
|
|
12
|
-
android:layout_height="match_parent"
|
|
13
|
-
app:imageStyle="@style/FWFeedViewImageStyle"
|
|
14
|
-
app:textStyle="@style/FWFeedViewCaptionStyle"
|
|
15
|
-
/>
|
|
16
|
-
|
|
17
|
-
</androidx.constraintlayout.widget.ConstraintLayout>
|