react-native-firework-sdk 2.2.4 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +2 -9
  4. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +2 -9
  7. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +2 -9
  8. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +9 -9
  9. package/android/build.gradle +9 -39
  10. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  11. package/android/gradle.properties +7 -5
  12. package/android/proguard-rules.pro +5 -26
  13. package/android/src/main/AndroidManifest.xml +0 -3
  14. package/android/src/main/java/com/fireworksdk/bridge/FireworkSDKPackage.kt +1 -1
  15. package/android/src/main/java/com/fireworksdk/bridge/components/base/FWBaseFragment.kt +10 -0
  16. package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +157 -0
  17. package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFrameLayout.kt +19 -0
  18. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +15 -5
  19. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +6 -7
  20. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +5 -1
  21. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelSerializer.kt +22 -0
  22. package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModel.kt +3 -5
  23. package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +2 -1
  24. package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelSerializer.kt +18 -0
  25. package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModel.kt +8 -0
  26. package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModelDeserializer.kt +35 -0
  27. package/android/src/main/java/com/fireworksdk/bridge/models/FWGradientDrawableModelSerializer.kt +27 -0
  28. package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +1 -5
  29. package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt +1 -5
  30. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +5 -15
  31. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +2 -9
  32. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationSerializer.kt +42 -0
  33. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModel.kt +3 -5
  34. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +2 -1
  35. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelSerializer.kt +20 -0
  36. package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResult.kt +3 -12
  37. package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +2 -13
  38. package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultSerializer.kt +18 -0
  39. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +8 -9
  40. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +17 -6
  41. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelSerializer.kt +59 -0
  42. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +1 -5
  43. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +14 -15
  44. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +14 -4
  45. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt +56 -0
  46. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +11 -8
  47. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +11 -12
  48. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +11 -7
  49. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +63 -0
  50. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProduct.kt +4 -11
  51. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductSerializer.kt +82 -0
  52. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWBadgeTextType.kt +18 -0
  53. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWCtaButtonTextValue.kt +18 -0
  54. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWCtaDelayType.kt +18 -0
  55. package/android/src/main/java/com/fireworksdk/bridge/models/{FWEventName.kt → enums/FWEventName.kt} +1 -1
  56. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWGradientDrawableOrientation.kt +24 -0
  57. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWPlayerLaunchBehavior.kt +18 -0
  58. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWPlayerStyle.kt +18 -0
  59. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWShoppingCtaResultRes.kt +19 -0
  60. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWSystemTypeface.kt +21 -0
  61. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoCompleteAction.kt +18 -0
  62. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedMode.kt +19 -0
  63. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedSource.kt +22 -0
  64. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoFeedTitlePosition.kt +19 -0
  65. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoPlayerCTAWidth.kt +19 -0
  66. package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +22 -0
  67. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +61 -32
  68. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +3 -2
  69. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +0 -1
  70. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +0 -1
  71. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +0 -2
  72. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +2 -2
  73. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +0 -6
  74. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +25 -32
  75. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +24 -47
  76. package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +17 -44
  77. package/android/src/main/java/com/fireworksdk/bridge/utils/FWBundleUtils.kt +46 -21
  78. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +165 -86
  79. package/android/src/main/java/com/fireworksdk/bridge/utils/FWFragmentUtil.kt +51 -0
  80. package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +1 -5
  81. package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +77 -80
  82. package/android/src/main/java/com/fireworksdk/bridge/utils/FWLiveStreamUtil.kt +17 -0
  83. package/android/src/main/java/com/fireworksdk/bridge/utils/FWSingletonHolder.kt +25 -0
  84. package/android/src/main/java/com/fireworksdk/bridge/utils/FWStatusBarUtil.kt +28 -0
  85. package/android/src/main/res/layout/fw_bridge_story_block.xml +5 -12
  86. package/ios/Components/VideoFeed.swift +39 -19
  87. package/ios/Components/VideoFeedConfiguration.swift +4 -5
  88. package/ios/Components/VideoFeedManager.swift +1 -1
  89. package/ios/Components/VideoPlayerConfiguration.swift +17 -0
  90. package/ios/FireworkSdk.xcodeproj/project.pbxproj +197 -205
  91. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +23 -8
  92. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +1 -18
  93. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +4 -1
  94. package/ios/Models/NativeToRN/FireworkEventName.swift +0 -1
  95. package/ios/Models/NativeToRN/FireworkSDK+Json.swift +1 -1
  96. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +6 -157
  97. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +1 -21
  98. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -2
  99. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +1 -12
  100. package/ios/Modules/LiveStream/LiveStreamModule.m +1 -1
  101. package/ios/Modules/LiveStream/LiveStreamModule.swift +4 -2
  102. package/ios/Modules/Shopping/FWCartViewController.swift +0 -75
  103. package/ios/Modules/Shopping/ShoppingModule.m +1 -3
  104. package/ios/Modules/Shopping/ShoppingModule.swift +12 -47
  105. package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +1 -1
  106. package/lib/commonjs/FireworkSDK.js +31 -15
  107. package/lib/commonjs/FireworkSDK.js.map +1 -1
  108. package/lib/commonjs/LiveStream.js.map +1 -1
  109. package/lib/commonjs/VideoShopping.js +43 -30
  110. package/lib/commonjs/VideoShopping.js.map +1 -1
  111. package/lib/commonjs/components/StoryBlock.js +124 -82
  112. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  113. package/lib/commonjs/components/VideoFeed.js +112 -24
  114. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  115. package/lib/commonjs/index.js.map +1 -1
  116. package/lib/commonjs/models/GradientDrawable.js +2 -0
  117. package/lib/commonjs/models/GradientDrawable.js.map +1 -0
  118. package/lib/commonjs/models/StoryBlockConfiguration.js +6 -0
  119. package/lib/commonjs/models/StoryBlockConfiguration.js.map +1 -0
  120. package/lib/commonjs/models/VideoPlayerCTADelay.js +2 -0
  121. package/lib/commonjs/models/VideoPlayerCTADelay.js.map +1 -0
  122. package/lib/commonjs/models/VideoPlayerCTAStyle.js +6 -0
  123. package/lib/commonjs/models/VideoPlayerCTAStyle.js.map +1 -0
  124. package/lib/commonjs/models/VideoPlayerCTAWidth.js +2 -0
  125. package/lib/commonjs/models/VideoPlayerCTAWidth.js.map +1 -0
  126. package/lib/commonjs/models/VideoPlayerCompleteAction.js +2 -0
  127. package/lib/commonjs/models/VideoPlayerCompleteAction.js.map +1 -0
  128. package/lib/commonjs/models/VideoPlayerStyle.js +2 -0
  129. package/lib/commonjs/models/VideoPlayerStyle.js.map +1 -0
  130. package/lib/commonjs/modules/LiveStreamModule.js.map +1 -1
  131. package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
  132. package/lib/commonjs/utils/FWGlobalState.js +47 -0
  133. package/lib/commonjs/utils/FWGlobalState.js.map +1 -0
  134. package/lib/module/FireworkSDK.js +30 -14
  135. package/lib/module/FireworkSDK.js.map +1 -1
  136. package/lib/module/LiveStream.js.map +1 -1
  137. package/lib/module/VideoShopping.js +43 -29
  138. package/lib/module/VideoShopping.js.map +1 -1
  139. package/lib/module/components/StoryBlock.js +113 -73
  140. package/lib/module/components/StoryBlock.js.map +1 -1
  141. package/lib/module/components/VideoFeed.js +113 -24
  142. package/lib/module/components/VideoFeed.js.map +1 -1
  143. package/lib/module/index.js.map +1 -1
  144. package/lib/module/models/GradientDrawable.js +2 -0
  145. package/lib/module/models/GradientDrawable.js.map +1 -0
  146. package/lib/module/models/StoryBlockConfiguration.js +2 -0
  147. package/lib/module/models/StoryBlockConfiguration.js.map +1 -0
  148. package/lib/module/models/VideoPlayerCTADelay.js +2 -0
  149. package/lib/module/models/VideoPlayerCTADelay.js.map +1 -0
  150. package/lib/module/models/VideoPlayerCTAStyle.js +2 -0
  151. package/lib/module/models/VideoPlayerCTAStyle.js.map +1 -0
  152. package/lib/module/models/VideoPlayerCTAWidth.js +2 -0
  153. package/lib/module/models/VideoPlayerCTAWidth.js.map +1 -0
  154. package/lib/module/models/VideoPlayerCompleteAction.js +2 -0
  155. package/lib/module/models/VideoPlayerCompleteAction.js.map +1 -0
  156. package/lib/module/models/VideoPlayerStyle.js +2 -0
  157. package/lib/module/models/VideoPlayerStyle.js.map +1 -0
  158. package/lib/module/modules/LiveStreamModule.js.map +1 -1
  159. package/lib/module/modules/ShoppingModule.js.map +1 -1
  160. package/lib/module/utils/FWGlobalState.js +39 -0
  161. package/lib/module/utils/FWGlobalState.js.map +1 -0
  162. package/lib/typescript/FireworkSDK.d.ts +7 -7
  163. package/lib/typescript/LiveStream.d.ts +2 -2
  164. package/lib/typescript/VideoShopping.d.ts +17 -18
  165. package/lib/typescript/components/StoryBlock.d.ts +2 -0
  166. package/lib/typescript/components/VideoFeed.d.ts +7 -3
  167. package/lib/typescript/index.d.ts +10 -3
  168. package/lib/typescript/models/AdBadgeConfiguration.d.ts +9 -2
  169. package/lib/typescript/models/FWEvents.d.ts +9 -9
  170. package/lib/typescript/models/GradientDrawable.d.ts +5 -0
  171. package/lib/typescript/models/IOSFontInfo.d.ts +2 -0
  172. package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +1 -1
  173. package/lib/typescript/models/StoryBlockConfiguration.d.ts +37 -0
  174. package/lib/typescript/models/VideoFeedConfiguration.d.ts +25 -4
  175. package/lib/typescript/models/VideoPlaybackDetails.d.ts +1 -0
  176. package/lib/typescript/models/VideoPlayerCTADelay.d.ts +11 -0
  177. package/lib/typescript/models/VideoPlayerCTAStyle.d.ts +21 -0
  178. package/lib/typescript/models/VideoPlayerCTAWidth.d.ts +1 -0
  179. package/lib/typescript/models/VideoPlayerCompleteAction.d.ts +1 -0
  180. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +9 -34
  181. package/lib/typescript/models/VideoPlayerStyle.d.ts +1 -0
  182. package/lib/typescript/modules/LiveStreamModule.d.ts +1 -1
  183. package/lib/typescript/modules/ShoppingModule.d.ts +2 -3
  184. package/lib/typescript/utils/FWGlobalState.d.ts +10 -0
  185. package/package.json +5 -3
  186. package/react-native-firework-sdk.podspec +2 -1
  187. package/src/FireworkSDK.ts +47 -19
  188. package/src/LiveStream.ts +4 -2
  189. package/src/VideoShopping.ts +47 -39
  190. package/src/components/StoryBlock.tsx +161 -98
  191. package/src/components/VideoFeed.tsx +147 -23
  192. package/src/index.ts +14 -6
  193. package/src/models/AdBadgeConfiguration.ts +10 -2
  194. package/src/models/FWEvents.ts +11 -11
  195. package/src/models/GradientDrawable.ts +14 -0
  196. package/src/models/IOSFontInfo.ts +2 -0
  197. package/src/models/ProductInfoViewConfiguration.ts +1 -1
  198. package/src/models/StoryBlockConfiguration.ts +38 -0
  199. package/src/models/VideoFeedConfiguration.ts +25 -4
  200. package/src/models/VideoPlaybackDetails.ts +1 -0
  201. package/src/models/VideoPlayerCTADelay.ts +11 -0
  202. package/src/models/VideoPlayerCTAStyle.ts +22 -0
  203. package/src/models/VideoPlayerCTAWidth.ts +1 -0
  204. package/src/models/VideoPlayerCompleteAction.ts +1 -0
  205. package/src/models/VideoPlayerConfiguration.ts +9 -36
  206. package/src/models/VideoPlayerStyle.ts +1 -0
  207. package/src/modules/LiveStreamModule.ts +1 -1
  208. package/src/modules/ShoppingModule.ts +2 -3
  209. package/src/utils/FWGlobalState.ts +31 -0
  210. package/android/publish.gradle +0 -66
  211. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFragment.kt +0 -129
  212. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +0 -90
  213. package/android/src/main/java/com/fireworksdk/bridge/constants/FWVideoPlayerConstant.kt +0 -39
  214. package/android/src/main/java/com/fireworksdk/bridge/models/FWSystemTypeface.kt +0 -9
  215. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedModel.kt +0 -7
  216. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +0 -10
  217. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedTitlePosition.kt +0 -7
  218. package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContainerActivity.kt +0 -53
  219. package/android/src/main/res/layout/fw_bridge_fragment_container.xml +0 -8
  220. package/ios/Modules/FWNavigatorModule/FWNavigatorContainerViewController.swift +0 -33
  221. package/ios/Modules/FWNavigatorModule/FWNavigatorProtocol.swift +0 -18
@@ -11,13 +11,14 @@ import {
11
11
  } from 'react-native';
12
12
 
13
13
  import FireworkSDK from '../FireworkSDK';
14
+ import type AdConfiguration from '../models/AdConfiguration';
14
15
  import type FWError from '../models/FWError';
15
16
  import { FWEventName } from '../models/FWEventName';
16
- import type AdConfiguration from '../models/AdConfiguration';
17
17
  import type VideoFeedConfiguration from '../models/VideoFeedConfiguration';
18
18
  import type { VideoFeedSource } from '../models/VideoFeedSource';
19
19
  import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
20
20
  import { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';
21
+ import FWGlobalState from '../utils/FWGlobalState';
21
22
  import FWLoggerUtil from '../utils/FWLoggerUtil';
22
23
  import FWVideoFeed from './FWVideoFeed';
23
24
 
@@ -84,12 +85,16 @@ export interface IVideoFeedProps {
84
85
  onVideoFeedLoadFinished?: (error?: FWError) => void;
85
86
  }
86
87
 
88
+ interface IVideoFeedState {
89
+ sdkInitCalled: boolean;
90
+ }
91
+
87
92
  const NativeComponentName = 'FWVideoFeed';
88
93
 
89
94
  /**
90
95
  * VideoFeed component.
91
96
  */
92
- class VideoFeed extends React.Component<IVideoFeedProps> {
97
+ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
93
98
  /**
94
99
  * @ignore
95
100
  */
@@ -101,6 +106,13 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
101
106
 
102
107
  private _subscriptions: EmitterSubscription[] = [];
103
108
 
109
+ constructor(props: IVideoFeedProps) {
110
+ super(props);
111
+ this.state = {
112
+ sdkInitCalled: FWGlobalState.getInstance().sdkInitCalled,
113
+ };
114
+ }
115
+
104
116
  public refresh = () => {
105
117
  FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);
106
118
 
@@ -148,6 +160,12 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
148
160
  `VideoFeed componentDidMount ${JSON.stringify(this.props)}`
149
161
  );
150
162
 
163
+ if (!this.state.sdkInitCalled) {
164
+ FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {
165
+ this.setState({ sdkInitCalled: true });
166
+ });
167
+ }
168
+
151
169
  const subscriptionOfShareBaseURLUpdated =
152
170
  FireworkSDKModuleEventEmitter.addListener(
153
171
  FWEventName.ShareBaseURLUpdated,
@@ -210,16 +228,29 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
210
228
  * @ignore
211
229
  */
212
230
  render() {
213
- FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);
231
+ FWLoggerUtil.log(
232
+ `VideoFeed render props ${JSON.stringify(
233
+ this.props
234
+ )} state ${JSON.stringify(this.state)}`
235
+ );
236
+
237
+ if (!this.state.sdkInitCalled) {
238
+ return null;
239
+ }
240
+
214
241
  const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
215
242
  const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';
243
+ const videoLaunchBehavior =
244
+ FireworkSDK.getInstance().videoLaunchBehavior ?? '';
216
245
  const adBadgeConfiguration =
217
246
  FireworkSDK.getInstance().adBadgeConfiguration ?? {};
218
247
  const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
219
248
  const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
220
249
  const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
221
- const videoLaunchBehavior =
222
- FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
250
+ const androidFontIsCustomOfAdBadge =
251
+ adBadgeConfiguration.androidFontInfo?.isCustom?.toString() ?? '';
252
+ const androidFontTypefaceNameOfAdBadge =
253
+ adBadgeConfiguration.androidFontInfo?.typefaceName ?? '';
223
254
 
224
255
  const {
225
256
  source,
@@ -236,15 +267,50 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
236
267
  this._generateDynamicContentParametersString();
237
268
 
238
269
  const videoFeedConfiguration = this._getVideoFeedConfiguration();
239
- const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;
240
- const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';
241
- const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;
242
- const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;
243
- const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;
244
-
270
+ const cornerRadius = videoFeedConfiguration?.cornerRadius?.toFixed(5) ?? '';
271
+
272
+ const titleHidden = videoFeedConfiguration?.title?.hidden?.toString() ?? '';
273
+ const titleTextColor = videoFeedConfiguration?.title?.textColor ?? '';
274
+ const titleFontSize =
275
+ videoFeedConfiguration?.title?.fontSize?.toFixed(5) ?? '';
276
+ const titleAndroidFontInfo = videoFeedConfiguration?.title?.androidFontInfo;
277
+ const titleGradientDrawable =
278
+ videoFeedConfiguration?.title?.gradientDrawable;
279
+ const titlePosition = videoFeedConfiguration?.titlePosition ?? '';
280
+ const playIconHidden =
281
+ videoFeedConfiguration?.playIcon?.hidden?.toString() ?? '';
282
+ const playIconWidth =
283
+ videoFeedConfiguration?.playIcon?.iconWidth?.toFixed(5) ?? '';
284
+ const showAdBadge = videoFeedConfiguration?.showAdBadge?.toString() ?? '';
285
+ const enableAutoplay =
286
+ videoFeedConfiguration?.enableAutoplay?.toString() ?? '';
287
+ const gridColumns = videoFeedConfiguration?.gridColumns?.toFixed(5) ?? '';
288
+ const itemSpacing = videoFeedConfiguration?.itemSpacing?.toFixed(5) ?? '';
289
+
290
+ const playerStyle = videoPlayerConfiguration?.playerStyle ?? '';
291
+ const videoCompleteAction =
292
+ videoPlayerConfiguration?.videoCompleteAction ?? '';
293
+ const showShareButton =
294
+ videoPlayerConfiguration?.showShareButton?.toString() ?? '';
295
+ const showPlaybackButton =
296
+ videoPlayerConfiguration?.showPlaybackButton?.toString() ?? '';
297
+ const showMuteButton =
298
+ videoPlayerConfiguration?.showMuteButton?.toString() ?? '';
299
+ const showBranding =
300
+ videoPlayerConfiguration?.showBranding?.toString() ?? '';
301
+ const ctaDelayType = videoPlayerConfiguration?.ctaDelay?.type ?? '';
302
+ const ctaDelayValue = (
303
+ videoPlayerConfiguration?.ctaDelay?.value ?? 0
304
+ ).toFixed(5);
305
+ const ctaHighlightDelayType =
306
+ videoPlayerConfiguration?.ctaHighlightDelay?.type ?? '';
307
+ const ctaHighlightDelayValue = (
308
+ videoPlayerConfiguration?.ctaHighlightDelay?.value ?? 0
309
+ ).toFixed(5);
245
310
  const shareBaseURL = videoPlayerConfiguration?.shareBaseURL ?? '';
311
+ const ctaWidth = videoPlayerConfiguration?.ctaWidth ?? '';
246
312
 
247
- const requiresAds = adConfiguration?.requiresAds ?? false;
313
+ const requiresAds = adConfiguration?.requiresAds?.toString() ?? '';
248
314
  const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;
249
315
  const vastAttributesString = this._generateVastAttributesString();
250
316
 
@@ -252,10 +318,14 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
252
318
  if (Platform.OS === 'ios') {
253
319
  key += `_appLanguage:${appLanguage}`;
254
320
  }
321
+ key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
255
322
  key += `_adBadgeTextType:${adBadgeTextType}`;
256
323
  key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
257
324
  key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
258
- key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
325
+ if (Platform.OS === 'android') {
326
+ key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;
327
+ key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;
328
+ }
259
329
 
260
330
  key += `_source:${source}`;
261
331
  key += `_channel:${channel}`;
@@ -267,12 +337,46 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
267
337
  key += `_enablePictureInPicture:${enablePictureInPicture}`;
268
338
 
269
339
  key += `_titleHidden:${titleHidden}`;
340
+ if (Platform.OS === 'android') {
341
+ key += `_cornerRadius:${cornerRadius}`;
342
+ key += `_titleTextColor:${titleTextColor}`;
343
+ key += `_titleFontSize:${titleFontSize}`;
344
+ key += `_titleAndroidFontInfo.isCustom:${
345
+ titleAndroidFontInfo?.isCustom?.toString() ?? ''
346
+ }`;
347
+ key += `_titleAndroidFontInfo.typefaceName:${
348
+ titleAndroidFontInfo?.typefaceName ?? ''
349
+ }`;
350
+ key += `_titleGradientDrawable.orientation:${
351
+ titleGradientDrawable?.orientation ?? ''
352
+ }`;
353
+ key += `_titleGradientDrawable.colors:${(
354
+ titleGradientDrawable?.colors ?? []
355
+ ).join(',')}`;
356
+ key += `_playIconHidden:${playIconHidden}`;
357
+ key += `_playIconWidth:${playIconWidth}`;
358
+ key += `_showAdBadge:${showAdBadge}`;
359
+ }
360
+
270
361
  key += `_titlePosition:${titlePosition}`;
271
362
  key += `_enableAutoplay:${enableAutoplay}`;
272
363
  key += `_gridColumns:${gridColumns}`;
273
- key += `_showAdBadge:${showAdBadge}`;
364
+ key += `_itemSpacing:${itemSpacing}`;
274
365
 
275
366
  key += `_shareBaseURL:${shareBaseURL}`;
367
+ if (Platform.OS === 'android') {
368
+ key += `_playerStyle:${playerStyle}`;
369
+ key += `_videoCompleteAction:${videoCompleteAction}`;
370
+ key += `_showShareButton:${showShareButton}`;
371
+ key += `_showPlaybackButton:${showPlaybackButton}`;
372
+ key += `_showMuteButton:${showMuteButton}`;
373
+ key += `_showBranding:${showBranding}`;
374
+ key += `_ctaDelayType:${ctaDelayType}`;
375
+ key += `_ctaDelayValue:${ctaDelayValue}`;
376
+ key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;
377
+ key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;
378
+ key += `_ctaWidth:${ctaWidth}`;
379
+ }
276
380
 
277
381
  key += `_requiresAds:${requiresAds}`;
278
382
  key += `_adsFetchTimeout:${adsFetchTimeout}`;
@@ -286,7 +390,6 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
286
390
  ref={this._nativeComponentRef}
287
391
  onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}
288
392
  mode={mode}
289
- style={Object.assign({}, this.props.style, { zIndex: -1 })}
290
393
  />
291
394
  );
292
395
  }
@@ -336,18 +439,39 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
336
439
  return videoFeedConfiguration;
337
440
  }
338
441
 
442
+ let resultVideoFeedConfiguration = videoFeedConfiguration;
443
+
339
444
  if (
340
- videoFeedConfiguration.gridColumns &&
341
- Math.floor(videoFeedConfiguration.gridColumns!) !==
342
- videoFeedConfiguration.gridColumns
445
+ resultVideoFeedConfiguration.gridColumns &&
446
+ Math.floor(resultVideoFeedConfiguration.gridColumns) !==
447
+ resultVideoFeedConfiguration.gridColumns
343
448
  ) {
344
- return {
345
- ...videoFeedConfiguration,
346
- gridColumns: Math.floor(videoFeedConfiguration.gridColumns!),
449
+ const gridColumns = Math.floor(resultVideoFeedConfiguration.gridColumns);
450
+ resultVideoFeedConfiguration = {
451
+ ...resultVideoFeedConfiguration,
452
+ gridColumns,
453
+ };
454
+ }
455
+
456
+ if (
457
+ resultVideoFeedConfiguration.title &&
458
+ resultVideoFeedConfiguration.title.numberOfLines &&
459
+ Math.floor(resultVideoFeedConfiguration.title.numberOfLines) !==
460
+ resultVideoFeedConfiguration.title.numberOfLines
461
+ ) {
462
+ const numberOfLines = Math.floor(
463
+ resultVideoFeedConfiguration.title.numberOfLines
464
+ );
465
+ resultVideoFeedConfiguration = {
466
+ ...resultVideoFeedConfiguration,
467
+ title: {
468
+ ...resultVideoFeedConfiguration.title,
469
+ numberOfLines,
470
+ },
347
471
  };
348
- } else {
349
- return videoFeedConfiguration;
350
472
  }
473
+
474
+ return resultVideoFeedConfiguration;
351
475
  }
352
476
  }
353
477
 
package/src/index.ts CHANGED
@@ -36,6 +36,8 @@ import type {
36
36
  VideoFeedClickEvent,
37
37
  VideoPlaybackEvent,
38
38
  } from './models/FWEvents';
39
+ import type GradientDrawable from './models/GradientDrawable';
40
+ import type { GradientDrawableOrientation } from './models/GradientDrawable';
39
41
  import type IOSFontInfo from './models/IOSFontInfo';
40
42
  import type {
41
43
  IOSSystemFontStyle,
@@ -57,11 +59,12 @@ import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
57
59
  import type SDKInitOptions from './models/SDKInitOptions';
58
60
  import type { VideoLaunchBehavior } from './models/SDKInitOptions';
59
61
  import type ShoppingCTAResult from './models/ShoppingCTAResult';
62
+ import type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';
60
63
  import type { StoryBlockSource } from './models/StoryBlockSource';
61
64
  import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
62
65
  import type VideoFeedConfiguration from './models/VideoFeedConfiguration';
63
66
  import type {
64
- VideoFeedContentPadding,
67
+ VideoFeedPadding,
65
68
  VideoFeedPlayIconConfiguration,
66
69
  VideoFeedTitleConfiguration,
67
70
  VideoFeedTitlePosition,
@@ -70,14 +73,15 @@ import type { VideoFeedSource } from './models/VideoFeedSource';
70
73
  import type VideoPlaybackDetails from './models/VideoPlaybackDetails';
71
74
  import type { VideoPlayerSize } from './models/VideoPlaybackDetails';
72
75
  import VideoPlaybackEventName from './models/VideoPlaybackEventName';
76
+ import type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';
73
77
  import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
74
78
  import type {
75
- VideoPlayerCompleteAction,
76
79
  VideoPlayerCTADelay,
77
80
  VideoPlayerCTADelayType,
78
- VideoPlayerCTAStyle,
79
- VideoPlayerStyle,
80
- } from './models/VideoPlayerConfiguration';
81
+ } from './models/VideoPlayerCTADelay';
82
+ import type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';
83
+ import type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';
84
+ import type { VideoPlayerStyle } from './models/VideoPlayerStyle';
81
85
  import type {
82
86
  CustomClickCartIconCallback,
83
87
  CustomClickLinkButtonCallback,
@@ -102,6 +106,8 @@ export {
102
106
  FireworkSDK,
103
107
  FWError,
104
108
  FWNavigator,
109
+ GradientDrawable,
110
+ GradientDrawableOrientation,
105
111
  IOSFontInfo,
106
112
  IOSSystemFontStyle,
107
113
  IOSSystemFontWeight,
@@ -132,6 +138,7 @@ export {
132
138
  ShoppingCTAEvent,
133
139
  ShoppingCTAResult,
134
140
  StoryBlock,
141
+ StoryBlockConfiguration,
135
142
  StoryBlockSource,
136
143
  TrackPurchaseParameters,
137
144
  UpdateProductDetailsCallback,
@@ -141,8 +148,8 @@ export {
141
148
  VideoFeedClickCallback,
142
149
  VideoFeedClickEvent,
143
150
  VideoFeedConfiguration,
144
- VideoFeedContentPadding,
145
151
  VideoFeedMode,
152
+ VideoFeedPadding,
146
153
  VideoFeedPlayIconConfiguration,
147
154
  VideoFeedSource,
148
155
  VideoFeedTitleConfiguration,
@@ -157,6 +164,7 @@ export {
157
164
  VideoPlayerCTADelay,
158
165
  VideoPlayerCTADelayType,
159
166
  VideoPlayerCTAStyle,
167
+ VideoPlayerCTAWidth,
160
168
  VideoPlayerSize,
161
169
  VideoPlayerStyle,
162
170
  VideoShopping,
@@ -1,3 +1,5 @@
1
+ import type AndroidFontInfo from './AndroidFontInfo';
2
+
1
3
  export type AdBadgeTextType = 'ad' | 'sponsored';
2
4
 
3
5
  export default interface AdBadgeConfiguration {
@@ -6,11 +8,17 @@ export default interface AdBadgeConfiguration {
6
8
  */
7
9
  badgeTextType?: AdBadgeTextType;
8
10
  /**
9
- * The background color of the ad badge. Only supported on iOS.
11
+ * The background color of the ad badge.
10
12
  */
11
13
  backgroundColor?: string;
12
14
  /**
13
- * The color of the ad badge text. Only supported on iOS.
15
+ * The color of the ad badge text.
14
16
  */
15
17
  textColor?: string;
18
+ /**
19
+ * The Android font info of ad badge.
20
+ * The property is ignored when fontSize is not set.
21
+ * Only supported on Android.
22
+ */
23
+ androidFontInfo?: AndroidFontInfo;
16
24
  }
@@ -52,17 +52,6 @@ export interface UpdateProductDetailsEvent {
52
52
  productIds: string[];
53
53
  }
54
54
 
55
- export interface LiveStreamEvent {
56
- eventName: LiveStreamEventName;
57
- info: LiveStreamEventDetails;
58
- }
59
-
60
- export interface LiveStreamChatEvent {
61
- eventName: LiveStreamChatEventName;
62
- message: LiveStreamMessageDetails;
63
- liveStream: LiveStreamEventDetails;
64
- }
65
-
66
55
  export interface CustomClickLinkButtonEvent {
67
56
  /**
68
57
  * The url for the product unit
@@ -77,3 +66,14 @@ export interface CustomClickLinkButtonEvent {
77
66
  */
78
67
  unitId: string;
79
68
  }
69
+
70
+ export interface LiveStreamEvent {
71
+ eventName: LiveStreamEventName;
72
+ info: LiveStreamEventDetails;
73
+ }
74
+
75
+ export interface LiveStreamChatEvent {
76
+ eventName: LiveStreamChatEventName;
77
+ message: LiveStreamMessageDetails;
78
+ liveStream: LiveStreamEventDetails;
79
+ }
@@ -0,0 +1,14 @@
1
+ export type GradientDrawableOrientation =
2
+ | 'TOP_BOTTOM'
3
+ | 'TR_BL'
4
+ | 'RIGHT_LEFT'
5
+ | 'BR_TL'
6
+ | 'BOTTOM_TOP'
7
+ | 'BL_TR'
8
+ | 'LEFT_RIGHT'
9
+ | 'TL_BR';
10
+
11
+ export default interface GradientDrawable {
12
+ orientation?: GradientDrawableOrientation;
13
+ colors?: string[];
14
+ }
@@ -19,11 +19,13 @@ export default interface IOSFontInfo {
19
19
  /**
20
20
  * The iOS system font style.
21
21
  * The property is ignored when fontName is non-empty.
22
+ * Only supported on iOS.
22
23
  */
23
24
  systemFontStyle?: IOSSystemFontStyle;
24
25
  /**
25
26
  * The iOS system font weight.
26
27
  * The property is ignored when fontName is non-empty or systemFontStyle is italic.
28
+ * Only supported on iOS.
27
29
  */
28
30
  systemFontWeight?: IOSSystemFontWeight;
29
31
  }
@@ -36,7 +36,7 @@ export default interface ProductInfoViewConfiguration {
36
36
  */
37
37
  ctaButton?: ShoppingCTAButtonConfiguration;
38
38
  /**
39
- * Configuration of link button next to "Add to cart" button.
39
+ * Configuration of link button next to shopping CTA button.
40
40
  */
41
41
  linkButton?: LinkButtonConfiguration;
42
42
  }
@@ -0,0 +1,38 @@
1
+ import type { VideoPlayerCTADelay } from './VideoPlayerCTADelay';
2
+ import type { VideoPlayerCTAWidth } from './VideoPlayerCTAWidth';
3
+ import type { VideoPlayerCompleteAction } from './VideoPlayerCompleteAction';
4
+
5
+ export interface StoryBlockConfiguration {
6
+ /**
7
+ * Behavior occurring after video is complete.
8
+ */
9
+ videoCompleteAction?: VideoPlayerCompleteAction;
10
+ /**
11
+ * Indicates if the video player shows share button.
12
+ */
13
+ showShareButton?: boolean;
14
+ /**
15
+ * Indicates if the video player shows playback button.
16
+ */
17
+ showPlaybackButton?: boolean;
18
+ /**
19
+ * Indicates if Firework branding should be showed or not.
20
+ */
21
+ showBranding?: boolean;
22
+ /**
23
+ * Specifies the delay before showing the CTA.
24
+ */
25
+ ctaDelay?: VideoPlayerCTADelay;
26
+ /**
27
+ * Specifies the delay before the highlight animation occurs. Only supported on iOS.
28
+ */
29
+ ctaHighlightDelay?: VideoPlayerCTADelay;
30
+ /**
31
+ * The share base URL of the video.
32
+ */
33
+ shareBaseURL?: string;
34
+ /**
35
+ * Specifies the desired width for the Video Player CTA button.
36
+ */
37
+ ctaWidth?: VideoPlayerCTAWidth;
38
+ }
@@ -1,5 +1,6 @@
1
1
  import type IOSFontInfo from './IOSFontInfo';
2
2
  import type AndroidFontInfo from './AndroidFontInfo';
3
+ import type GradientDrawable from './GradientDrawable';
3
4
 
4
5
  export interface VideoFeedTitleConfiguration {
5
6
  /**
@@ -14,6 +15,11 @@ export interface VideoFeedTitleConfiguration {
14
15
  * The font size of video feed title.
15
16
  */
16
17
  fontSize?: number;
18
+ /**
19
+ * Specifies the number of allowed lines for the label.
20
+ * Only supported on iOS.
21
+ */
22
+ numberOfLines?: number;
17
23
  /**
18
24
  * The iOS font info of video feed title.
19
25
  * The property is ignored when fontSize is not set.
@@ -26,6 +32,17 @@ export interface VideoFeedTitleConfiguration {
26
32
  * Only supported on Android.
27
33
  */
28
34
  androidFontInfo?: AndroidFontInfo;
35
+ /**
36
+ * The background color of video feed title.
37
+ * The property is ignored when gradientDrawable is set.
38
+ * Only supported on Android.
39
+ */
40
+ backgroundColor?: string;
41
+ /**
42
+ * The background drawable of video feed title.
43
+ * Only supported on Android.
44
+ */
45
+ gradientDrawable?: GradientDrawable;
29
46
  }
30
47
 
31
48
  export interface VideoFeedPlayIconConfiguration {
@@ -35,7 +52,7 @@ export interface VideoFeedPlayIconConfiguration {
35
52
 
36
53
  export type VideoFeedTitlePosition = 'stacked' | 'nested';
37
54
 
38
- export interface VideoFeedContentPadding {
55
+ export interface VideoFeedPadding {
39
56
  top?: number;
40
57
  right?: number;
41
58
  bottom?: number;
@@ -59,6 +76,10 @@ export default interface VideoFeedConfiguration {
59
76
  * Title position of video feed item.
60
77
  */
61
78
  titlePosition?: VideoFeedTitlePosition;
79
+ /**
80
+ * The padding of video feed title. Only supported on iOS.
81
+ */
82
+ titlePadding?: VideoFeedPadding;
62
83
  /**
63
84
  * Configuration of video feed item play icon.
64
85
  */
@@ -72,11 +93,11 @@ export default interface VideoFeedConfiguration {
72
93
  */
73
94
  aspectRatio?: number;
74
95
  /**
75
- * The content padding for video feed. Only supported on iOS.
96
+ * The padding of video feed content. Only supported on iOS.
76
97
  */
77
- contentPadding?: VideoFeedContentPadding;
98
+ contentPadding?: VideoFeedPadding;
78
99
  /**
79
- * The item spacing for video feed. Only supported on iOS.
100
+ * The item spacing for video feed.
80
101
  */
81
102
  itemSpacing?: number;
82
103
  /**
@@ -34,6 +34,7 @@ export default interface VideoPlaybackDetails {
34
34
  progress?: number | null;
35
35
  /**
36
36
  * The type of the CTA button clicked: "buy" "download" "view" "book".
37
+ * Only supported on iOS.
37
38
  */
38
39
  ctaActionType?: string | null;
39
40
  /**
@@ -0,0 +1,11 @@
1
+ export type VideoPlayerCTADelayType = 'constant' | 'percentage';
2
+ export interface VideoPlayerCTADelay {
3
+ type: VideoPlayerCTADelayType;
4
+ /**
5
+ * If type is constant, the value is the number of seconds of delay.
6
+ * Value should be greater than or equal to 0 and less than or equal to 10 when type is constant.
7
+ * If type is percentage, the value is a percentage based on the the total duration of the video length.
8
+ * Value must be greater than or equal to 0 and less than 1 when type is percentage.
9
+ */
10
+ value: number;
11
+ }
@@ -0,0 +1,22 @@
1
+ import type IOSFontInfo from './IOSFontInfo';
2
+
3
+ export interface VideoPlayerCTAStyle {
4
+ /**
5
+ * The background color of CTA button.
6
+ */
7
+ backgroundColor?: string;
8
+ /**
9
+ * The text color of CTA button.
10
+ */
11
+ textColor?: string;
12
+ /**
13
+ * The font size of CTA button.
14
+ */
15
+ fontSize?: number;
16
+ /**
17
+ * The iOS font info of CTA button.
18
+ * The property is ignored when fontSize is not set.
19
+ * Only supported on iOS.
20
+ */
21
+ iOSFontInfo?: IOSFontInfo;
22
+ }
@@ -0,0 +1 @@
1
+ export type VideoPlayerCTAWidth = 'fullWidth' | 'compact' | 'sizeToFit';
@@ -0,0 +1 @@
1
+ export type VideoPlayerCompleteAction = 'loop' | 'advanceToNext';
@@ -1,39 +1,8 @@
1
- import type IOSFontInfo from './IOSFontInfo';
2
-
3
- export type VideoPlayerStyle = 'full' | 'fit';
4
- export type VideoPlayerCompleteAction = 'loop' | 'advanceToNext';
5
- export interface VideoPlayerCTAStyle {
6
- /**
7
- * The background color of CTA button.
8
- */
9
- backgroundColor?: string;
10
- /**
11
- * The text color of CTA button.
12
- */
13
- textColor?: string;
14
- /**
15
- * The font size of CTA button.
16
- */
17
- fontSize?: number;
18
- /**
19
- * The iOS font info of CTA button.
20
- * The property is ignored when fontSize is not set.
21
- * Only supported on iOS.
22
- */
23
- iOSFontInfo?: IOSFontInfo;
24
- }
25
-
26
- export type VideoPlayerCTADelayType = 'constant' | 'percentage';
27
- export interface VideoPlayerCTADelay {
28
- type: VideoPlayerCTADelayType;
29
- /**
30
- * If type is constant, the value is the number of seconds of delay.
31
- * Value should be greater than or equal to 0 and less than or equal to 10 when type is constant.
32
- * If type is percentage, the value is a percentage based on the the total duration of the video length.
33
- * Value must be greater than or equal to 0 and less than 1 when type is percentage.
34
- */
35
- value: number;
36
- }
1
+ import type { VideoPlayerCTADelay } from './VideoPlayerCTADelay';
2
+ import type { VideoPlayerCTAStyle } from './VideoPlayerCTAStyle';
3
+ import type { VideoPlayerCTAWidth } from './VideoPlayerCTAWidth';
4
+ import type { VideoPlayerCompleteAction } from './VideoPlayerCompleteAction';
5
+ import type { VideoPlayerStyle } from './VideoPlayerStyle';
37
6
 
38
7
  export default interface VideoPlayerConfiguration {
39
8
  /**
@@ -76,4 +45,8 @@ export default interface VideoPlayerConfiguration {
76
45
  * The share base URL of the video.
77
46
  */
78
47
  shareBaseURL?: string;
48
+ /**
49
+ * Specifies the desired width for the Video Player CTA button.
50
+ */
51
+ ctaWidth?: VideoPlayerCTAWidth;
79
52
  }
@@ -0,0 +1 @@
1
+ export type VideoPlayerStyle = 'full' | 'fit';
@@ -14,7 +14,7 @@ const LiveStreamModule = NativeModules.LiveStreamModule
14
14
  );
15
15
 
16
16
  interface ILiveStreamModule extends NativeModule {
17
- init(): void;
17
+ init(): Promise<any>;
18
18
  }
19
19
  const LiveStreamModuleEventEmitter = new NativeEventEmitter(LiveStreamModule);
20
20
  export { LiveStreamModuleEventEmitter };