react-native-firework-sdk 2.8.6 → 2.9.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 (88) hide show
  1. package/FireworkVideoUI.xcframework/Info.plist +5 -5
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  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/_CodeSignature/CodeResources +1 -1
  7. package/android/build.gradle +2 -1
  8. package/android/gradle.properties +1 -1
  9. package/android/src/main/java/com/fireworksdk/bridge/components/base/FWLoading.kt +22 -0
  10. package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +240 -18
  11. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +19 -9
  12. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdConfigurationDeserializer.kt +49 -0
  13. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdConfigurationModel.kt +13 -0
  14. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdConfigurationSerializer.kt +42 -0
  15. package/android/src/main/java/com/fireworksdk/bridge/models/FWButtonInfoDeserializer.kt +21 -0
  16. package/android/src/main/java/com/fireworksdk/bridge/models/FWButtonInfoModel.kt +6 -0
  17. package/android/src/main/java/com/fireworksdk/bridge/models/FWButtonInfoSerializer.kt +17 -0
  18. package/android/src/main/java/com/fireworksdk/bridge/models/FWPlayerButtonConfigurationDeserializer.kt +33 -0
  19. package/android/src/main/java/com/fireworksdk/bridge/models/FWPlayerButtonConfigurationModel.kt +10 -0
  20. package/android/src/main/java/com/fireworksdk/bridge/models/FWPlayerButtonConfigurationSerializer.kt +25 -0
  21. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +7 -0
  22. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +17 -0
  23. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationSerializer.kt +13 -0
  24. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
  25. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +3 -0
  26. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelSerializer.kt +2 -0
  27. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +3 -1
  28. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +7 -1
  29. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +4 -0
  30. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWErrorAction.kt +18 -0
  31. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWEventName.kt +3 -0
  32. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +50 -26
  33. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +47 -8
  34. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +1 -0
  35. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +0 -10
  36. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +42 -0
  37. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +5 -3
  38. package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +24 -6
  39. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +95 -0
  40. package/android/src/main/res/layout/fw_bridge_story_block.xml +6 -0
  41. package/android/src/main/res/layout/fw_loading.xml +14 -0
  42. package/ios/Components/VideoFeed.swift +1 -1
  43. package/ios/FireworkVideoUI/Podfile.lock +1 -1
  44. package/ios/Modules/FWNavigatorModule/RNSScreenStackView+Window.h +20 -0
  45. package/ios/Modules/FWNavigatorModule/RNSScreenStackView+Window.m +84 -0
  46. package/lib/commonjs/VideoShopping.js +1 -4
  47. package/lib/commonjs/VideoShopping.js.map +1 -1
  48. package/lib/commonjs/components/StoryBlock.js +32 -42
  49. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  50. package/lib/commonjs/components/VideoFeed.js +29 -11
  51. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  52. package/lib/commonjs/index.js +8 -0
  53. package/lib/commonjs/index.js.map +1 -1
  54. package/lib/commonjs/utils/VideoFeedUtil.js +73 -0
  55. package/lib/commonjs/utils/VideoFeedUtil.js.map +1 -0
  56. package/lib/module/VideoShopping.js +1 -5
  57. package/lib/module/VideoShopping.js.map +1 -1
  58. package/lib/module/components/StoryBlock.js +32 -40
  59. package/lib/module/components/StoryBlock.js.map +1 -1
  60. package/lib/module/components/VideoFeed.js +28 -11
  61. package/lib/module/components/VideoFeed.js.map +1 -1
  62. package/lib/module/index.js +2 -1
  63. package/lib/module/index.js.map +1 -1
  64. package/lib/module/utils/VideoFeedUtil.js +65 -0
  65. package/lib/module/utils/VideoFeedUtil.js.map +1 -0
  66. package/lib/typescript/VideoShopping.d.ts +0 -1
  67. package/lib/typescript/components/StoryBlock.d.ts +15 -4
  68. package/lib/typescript/components/VideoFeed.d.ts +12 -1
  69. package/lib/typescript/index.d.ts +2 -1
  70. package/lib/typescript/models/ButtonInfo.d.ts +0 -1
  71. package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +3 -3
  72. package/lib/typescript/models/StoryBlockConfiguration.d.ts +0 -2
  73. package/lib/typescript/models/VideoPlayerButtonConfiguration.d.ts +0 -6
  74. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +0 -2
  75. package/lib/typescript/utils/VideoFeedUtil.d.ts +10 -0
  76. package/package.json +1 -1
  77. package/src/VideoShopping.ts +1 -4
  78. package/src/components/StoryBlock.tsx +40 -44
  79. package/src/components/VideoFeed.tsx +32 -11
  80. package/src/index.ts +2 -0
  81. package/src/models/ButtonInfo.ts +0 -1
  82. package/src/models/ProductInfoViewConfiguration.ts +3 -3
  83. package/src/models/StoryBlockConfiguration.ts +0 -2
  84. package/src/models/VideoPlayerButtonConfiguration.ts +0 -6
  85. package/src/models/VideoPlayerConfiguration.ts +0 -2
  86. package/src/utils/VideoFeedUtil.ts +74 -0
  87. package/android/src/main/java/com/fireworksdk/bridge/utils/FWStatusBarUtil.kt +0 -28
  88. package/android/src/main/java/com/fireworksdk/bridge/utils/FWStoryBlockUtil.kt +0 -30
@@ -1 +1 @@
1
- {"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWGlobalState","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","constructor","props","createRef","log","JSON","stringify","nativeNodeHandle","_nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","onVideoFeedDidStartPictureInPicture","onVideoFeedDidStopPictureInPicture","state","sdkInitCalled","getInstance","componentDidMount","sdkInitCalledPromise","then","setState","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","gShareBaseURL","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","playlistGroup","hashtagFilterExpression","productIds","contentId","mode","enablePictureInPicture","adConfiguration","dynamicContentParametersString","_generateDynamicContentParametersString","videoFeedConfiguration","_getVideoFeedConfiguration","cornerRadius","toFixed","titleHidden","title","hidden","titleTextColor","titleFontSize","fontSize","titleAndroidFontInfo","titleGradientDrawable","gradientDrawable","titlePosition","playIconHidden","playIcon","playIconWidth","iconWidth","showAdBadge","enableAutoplay","gridColumns","itemSpacing","videoPlayerConfiguration","_getVideoPlayerConfiguration","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","ctaWidth","buttonConfiguration","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","key","join","orientation","colors","_generateButtonInfoString","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","undefined","_onVideoFeedLoadFinished","_onVideoFeedDidStartPictureInPicture","_onVideoFeedDidStopPictureInPicture","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","valueString","length","vastAttributes","attribute","buttonInfo","imageName","systemImageName","tintColor","resultVideoFeedConfiguration","Math","floor","numberOfLines","resultVideoPlayerConfiguration"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAGA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAyFA,MAAMC,mBAAmB,GAAG,aAA5B;A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,KAA7B,IACAoE,4BAA4B,CAACpE,KAA7B,CAAmCuE,aADnC,IAEAF,IAAI,CAACC,KAAL,CAAWF,4BAA4B,CAACpE,KAA7B,CAAmCuE,aAA9C,MACEH,4BAA4B,CAACpE,KAA7B,CAAmCuE,aAJvC,EAKE;AACA,YAAMA,aAAa,GAAGF,IAAI,CAACC,KAAL,CACpBF,4BAA4B,CAACpE,KAA7B,CAAmCuE,aADf,CAAtB;AAGAH,MAAAA,4BAA4B,GAAG,EAC7B,GAAGA,4BAD0B;AAE7BpE,QAAAA,KAAK,EAAE,EACL,GAAGoE,4BAA4B,CAACpE,KAD3B;AAELuE,UAAAA;AAFK;AAFsB,OAA/B;AAOD;;AAED,WAAOH,4BAAP;AACD;;AAEOlD,EAAAA,4BAA4B,GAEtB;AACZ,UAAM;AAAED,MAAAA,wBAAF;AAA4B1B,MAAAA;AAA5B,QAAuD,KAAKrE,KAAlE;AAEA,QAAIsJ,8BAES,GAAGvD,wBAFhB;;AAGA,QAAI,OAAO1B,sBAAP,KAAkC,SAAtC,EAAiD;AAC/C,UAAI,CAACiF,8BAAL,EAAqC;AACnCA,QAAAA,8BAA8B,GAAG,EAAjC;AACD;;AACDA,MAAAA,8BAA8B,GAAG,EAC/B,GAAGA,8BAD4B;AAE/BjF,QAAAA;AAF+B,OAAjC;AAID;;AAED,WAAOiF,8BAAP;AACD;;AAlduE;;gBAApEzJ,S,kBAIkB;AACpBuE,EAAAA,IAAI,EAAE;AADc,C;;AAidxB,eAAevE,SAAf","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 AdConfiguration from '../models/AdConfiguration';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\nimport type ButtonInfo from '../models/ButtonInfo';\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 * Defaults to discover.\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 * Required when the source is set as hashtagPlaylist.\n */\n hashtagFilterExpression?: string;\n /**\n * Product ids used to generate the sku feed\n */\n productIds?: string[];\n /**\n * The video or live stream id. Only supported on iOS.\n */\n contentId?: string;\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\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 * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStopPictureInPicture?: (error?: FWError) => void;\n}\n\ninterface IVideoFeedState {\n sdkInitCalled: boolean;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {\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 constructor(props: IVideoFeedProps) {\n super(props);\n this.state = {\n sdkInitCalled: FWGlobalState.getInstance().sdkInitCalled,\n };\n }\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 private _onVideoFeedDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStartPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStartPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStartPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStartPictureInPicture();\n }\n }\n };\n\n private _onVideoFeedDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStopPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStopPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStopPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStopPictureInPicture();\n }\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n if (!this.state.sdkInitCalled) {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n this.setState({ sdkInitCalled: true });\n });\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 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(\n `VideoFeed render props ${JSON.stringify(\n this.props\n )} state ${JSON.stringify(this.state)}`\n );\n\n if (!this.state.sdkInitCalled) {\n return null;\n }\n\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL;\n const appLanguage = FireworkSDK.getInstance().appLanguage;\n const videoLaunchBehavior = FireworkSDK.getInstance().videoLaunchBehavior;\n const adBadgeConfiguration = FireworkSDK.getInstance().adBadgeConfiguration;\n const adBadgeTextType = adBadgeConfiguration?.badgeTextType;\n const backgroundColorOfAdBadge = adBadgeConfiguration?.backgroundColor;\n const textColorOfAdBadge = adBadgeConfiguration?.textColor;\n const androidFontIsCustomOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.isCustom?.toString();\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n playlistGroup,\n hashtagFilterExpression,\n productIds,\n contentId,\n mode,\n enablePictureInPicture,\n adConfiguration,\n } = this.props;\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const cornerRadius = videoFeedConfiguration?.cornerRadius?.toFixed(5);\n\n const titleHidden = videoFeedConfiguration?.title?.hidden?.toString();\n const titleTextColor = videoFeedConfiguration?.title?.textColor;\n const titleFontSize = videoFeedConfiguration?.title?.fontSize?.toFixed(5);\n const titleAndroidFontInfo = videoFeedConfiguration?.title?.androidFontInfo;\n const titleGradientDrawable =\n videoFeedConfiguration?.title?.gradientDrawable;\n const titlePosition = videoFeedConfiguration?.titlePosition;\n const playIconHidden = videoFeedConfiguration?.playIcon?.hidden;\n const playIconWidth =\n videoFeedConfiguration?.playIcon?.iconWidth?.toFixed(5);\n const showAdBadge = videoFeedConfiguration?.showAdBadge?.toString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay;\n const gridColumns = videoFeedConfiguration?.gridColumns?.toFixed(5);\n const itemSpacing = videoFeedConfiguration?.itemSpacing?.toFixed(5);\n\n const videoPlayerConfiguration = this._getVideoPlayerConfiguration();\n const playerStyle = videoPlayerConfiguration?.playerStyle;\n const videoCompleteAction = videoPlayerConfiguration?.videoCompleteAction;\n const showShareButton = videoPlayerConfiguration?.showShareButton;\n const showPlaybackButton = videoPlayerConfiguration?.showPlaybackButton;\n const showMuteButton = videoPlayerConfiguration?.showMuteButton;\n const showBranding = videoPlayerConfiguration?.showBranding;\n const ctaDelayType = videoPlayerConfiguration?.ctaDelay?.type;\n const ctaDelayValue = videoPlayerConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n videoPlayerConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n videoPlayerConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = videoPlayerConfiguration?.shareBaseURL;\n const ctaWidth = videoPlayerConfiguration?.ctaWidth;\n const buttonConfiguration = videoPlayerConfiguration?.buttonConfiguration;\n const showVideoDetailTitle = videoPlayerConfiguration?.showVideoDetailTitle;\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = this._generateVastAttributesString();\n\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n if (Platform.OS === 'android') {\n key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;\n key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;\n }\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `_productIds:${productIds?.join(',')}`;\n key += `_contentId:${contentId}`;\n key += `_mode:${mode}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n\n key += `_titleHidden:${titleHidden}`;\n if (Platform.OS === 'android') {\n key += `_cornerRadius:${cornerRadius}`;\n key += `_titleTextColor:${titleTextColor}`;\n key += `_titleFontSize:${titleFontSize}`;\n key += `_titleAndroidFontInfo.isCustom:${titleAndroidFontInfo?.isCustom}`;\n key += `_titleAndroidFontInfo.typefaceName:${titleAndroidFontInfo?.typefaceName}`;\n key += `_titleGradientDrawable.orientation:${titleGradientDrawable?.orientation}`;\n key += `_titleGradientDrawable.colors:${titleGradientDrawable?.colors?.join(\n ','\n )}`;\n key += `_playIconHidden:${playIconHidden}`;\n key += `_playIconWidth:${playIconWidth}`;\n key += `_showAdBadge:${showAdBadge}`;\n }\n\n key += `_titlePosition:${titlePosition}`;\n if (Platform.OS === 'android') {\n key += `_enableAutoplay:${enableAutoplay}`;\n }\n key += `_gridColumns:${gridColumns}`;\n key += `_itemSpacing:${itemSpacing}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n if (Platform.OS === 'android') {\n key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${this._generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${this._generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${this._generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${this._generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${this._generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${this._generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n enablePictureInPicture={undefined}\n videoFeedConfiguration={videoFeedConfiguration}\n videoPlayerConfiguration={videoPlayerConfiguration}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n onVideoFeedDidStartPictureInPicture={\n this._onVideoFeedDidStartPictureInPicture\n }\n onVideoFeedDidStopPictureInPicture={\n this._onVideoFeedDidStopPictureInPicture\n }\n mode={mode ?? 'row'}\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 | undefined {\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 _generateButtonInfoString(buttonInfo?: ButtonInfo): string {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n let resultVideoFeedConfiguration = videoFeedConfiguration;\n\n if (\n resultVideoFeedConfiguration.gridColumns &&\n Math.floor(resultVideoFeedConfiguration.gridColumns) !==\n resultVideoFeedConfiguration.gridColumns\n ) {\n const gridColumns = Math.floor(resultVideoFeedConfiguration.gridColumns);\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n gridColumns,\n };\n }\n\n if (\n resultVideoFeedConfiguration.title &&\n resultVideoFeedConfiguration.title.numberOfLines &&\n Math.floor(resultVideoFeedConfiguration.title.numberOfLines) !==\n resultVideoFeedConfiguration.title.numberOfLines\n ) {\n const numberOfLines = Math.floor(\n resultVideoFeedConfiguration.title.numberOfLines\n );\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n title: {\n ...resultVideoFeedConfiguration.title,\n numberOfLines,\n },\n };\n }\n\n return resultVideoFeedConfiguration;\n }\n\n private _getVideoPlayerConfiguration():\n | VideoPlayerNativeConfiguration\n | undefined {\n const { videoPlayerConfiguration, enablePictureInPicture } = this.props;\n\n let resultVideoPlayerConfiguration:\n | VideoPlayerNativeConfiguration\n | undefined = videoPlayerConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultVideoPlayerConfiguration) {\n resultVideoPlayerConfiguration = {};\n }\n resultVideoPlayerConfiguration = {\n ...resultVideoPlayerConfiguration,\n enablePictureInPicture,\n };\n }\n\n return resultVideoPlayerConfiguration;\n }\n}\n\nexport default VideoFeed;\n"]}
1
+ {"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWGlobalState","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","constructor","props","createRef","log","JSON","stringify","nativeNodeHandle","_nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","onVideoFeedEmpty","name","reason","error","_loaded","onVideoFeedDidStartPictureInPicture","onVideoFeedDidStopPictureInPicture","state","sdkInitCalled","getInstance","componentDidMount","sdkInitCalledPromise","then","setState","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","gShareBaseURL","shareBaseURL","appLanguage","videoLaunchBehavior","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","androidFontIsCustomOfAdBadge","androidFontInfo","isCustom","androidFontTypefaceNameOfAdBadge","typefaceName","source","channel","playlist","playlistGroup","hashtagFilterExpression","productIds","contentId","mode","enablePictureInPicture","adConfiguration","dynamicContentParametersString","_generateDynamicContentParametersString","videoFeedConfiguration","_getVideoFeedConfiguration","cornerRadius","toFixed","titleHidden","title","hidden","titleTextColor","titleFontSize","fontSize","titleAndroidFontInfo","titleGradientDrawable","gradientDrawable","titlePosition","playIconHidden","playIcon","playIconWidth","iconWidth","showAdBadge","enableAutoplay","gridColumns","itemSpacing","videoPlayerConfiguration","_getVideoPlayerConfiguration","playerStyle","videoCompleteAction","showShareButton","showPlaybackButton","showMuteButton","showBranding","ctaDelayType","ctaDelay","type","ctaDelayValue","ctaHighlightDelayType","ctaHighlightDelay","ctaHighlightDelayValue","ctaWidth","buttonConfiguration","showVideoDetailTitle","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","key","join","orientation","colors","_generateButtonInfoString","videoDetailButton","closeButton","muteButton","unmuteButton","playButton","pauseButton","undefined","_onVideoFeedLoadFinished","_onVideoFeedEmpty","_onVideoFeedDidStartPictureInPicture","_onVideoFeedDidStopPictureInPicture","dynamicContentParameters","resultString","sortedKeyList","Object","keys","sort","valueString","length","vastAttributes","attribute","buttonInfo","imageName","systemImageName","tintColor","resultVideoFeedConfiguration","Math","floor","numberOfLines","resultVideoPlayerConfiguration"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAGA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAkGA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,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,eAAe1E,SAAf","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 AdConfiguration from '../models/AdConfiguration';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWGlobalState from '../utils/FWGlobalState';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\nimport type ButtonInfo from '../models/ButtonInfo';\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 * Defaults to discover.\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 * Required when the source is set as hashtagPlaylist.\n */\n hashtagFilterExpression?: string;\n /**\n * Product ids used to generate the sku feed\n */\n productIds?: string[];\n /**\n * The video or live stream id. Only supported on iOS.\n */\n contentId?: string;\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\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.\n */\n adConfiguration?: AdConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n /**\n * The callback is triggered when there are no items in the story block.\n * The callback is triggered in the following cases:\n * 1. Loading successfully but the back end returns an empty list.\n * 2. The load failed and list is empty.\n * onVideoFeedLoadFinished will also be triggered when onVideoFeedEmpty is triggered.\n * Only supported on Android.\n */\n onVideoFeedEmpty?: (error?: FWError) => void;\n /**\n * Start Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStartPictureInPicture?: (error?: FWError) => void;\n /**\n * Stop Picture in Picture callback. Only supported on iOS.\n */\n onVideoFeedDidStopPictureInPicture?: (error?: FWError) => void;\n}\n\ninterface IVideoFeedState {\n sdkInitCalled: boolean;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {\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 private _loaded: boolean = false;\n\n constructor(props: IVideoFeedProps) {\n super(props);\n this.state = {\n sdkInitCalled: FWGlobalState.getInstance().sdkInitCalled,\n };\n }\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, onVideoFeedEmpty } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n let error: FWError = { name };\n if (reason) {\n error.reason = reason;\n }\n onVideoFeedLoadFinished(error);\n if (!this._loaded) {\n onVideoFeedEmpty?.(error);\n }\n } else {\n onVideoFeedLoadFinished();\n this._loaded = true;\n }\n }\n };\n\n private _onVideoFeedEmpty = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedEmpty } = this.props;\n\n if (onVideoFeedEmpty) {\n onVideoFeedEmpty();\n }\n };\n\n private _onVideoFeedDidStartPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStartPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStartPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStartPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStartPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStartPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStartPictureInPicture();\n }\n }\n };\n\n private _onVideoFeedDidStopPictureInPicture = (\n event: NativeSyntheticEvent<any>\n ) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedDidStopPictureInPicture ${JSON.stringify(\n event.nativeEvent\n )}`\n );\n const { onVideoFeedDidStopPictureInPicture } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedDidStopPictureInPicture) {\n if (name) {\n if (reason) {\n onVideoFeedDidStopPictureInPicture({ name, reason });\n } else {\n onVideoFeedDidStopPictureInPicture({ name });\n }\n } else {\n onVideoFeedDidStopPictureInPicture();\n }\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n if (!this.state.sdkInitCalled) {\n FWGlobalState.getInstance().sdkInitCalledPromise.then(() => {\n this.setState({ sdkInitCalled: true });\n });\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 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 if (!this.state.sdkInitCalled) {\n return null;\n }\n\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL;\n const appLanguage = FireworkSDK.getInstance().appLanguage;\n const videoLaunchBehavior = FireworkSDK.getInstance().videoLaunchBehavior;\n const adBadgeConfiguration = FireworkSDK.getInstance().adBadgeConfiguration;\n const adBadgeTextType = adBadgeConfiguration?.badgeTextType;\n const backgroundColorOfAdBadge = adBadgeConfiguration?.backgroundColor;\n const textColorOfAdBadge = adBadgeConfiguration?.textColor;\n const androidFontIsCustomOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.isCustom?.toString();\n const androidFontTypefaceNameOfAdBadge =\n adBadgeConfiguration?.androidFontInfo?.typefaceName;\n\n const {\n source,\n channel,\n playlist,\n playlistGroup,\n hashtagFilterExpression,\n productIds,\n contentId,\n mode,\n enablePictureInPicture,\n adConfiguration,\n } = this.props;\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const cornerRadius = videoFeedConfiguration?.cornerRadius?.toFixed(5);\n\n const titleHidden = videoFeedConfiguration?.title?.hidden?.toString();\n const titleTextColor = videoFeedConfiguration?.title?.textColor;\n const titleFontSize = videoFeedConfiguration?.title?.fontSize?.toFixed(5);\n const titleAndroidFontInfo = videoFeedConfiguration?.title?.androidFontInfo;\n const titleGradientDrawable =\n videoFeedConfiguration?.title?.gradientDrawable;\n const titlePosition = videoFeedConfiguration?.titlePosition;\n const playIconHidden = videoFeedConfiguration?.playIcon?.hidden;\n const playIconWidth =\n videoFeedConfiguration?.playIcon?.iconWidth?.toFixed(5);\n const showAdBadge = videoFeedConfiguration?.showAdBadge?.toString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay;\n const gridColumns = videoFeedConfiguration?.gridColumns?.toFixed(5);\n const itemSpacing = videoFeedConfiguration?.itemSpacing?.toFixed(5);\n\n const videoPlayerConfiguration = this._getVideoPlayerConfiguration();\n const playerStyle = videoPlayerConfiguration?.playerStyle;\n const videoCompleteAction = videoPlayerConfiguration?.videoCompleteAction;\n const showShareButton = videoPlayerConfiguration?.showShareButton;\n const showPlaybackButton = videoPlayerConfiguration?.showPlaybackButton;\n const showMuteButton = videoPlayerConfiguration?.showMuteButton;\n const showBranding = videoPlayerConfiguration?.showBranding;\n const ctaDelayType = videoPlayerConfiguration?.ctaDelay?.type;\n const ctaDelayValue = videoPlayerConfiguration?.ctaDelay?.value?.toFixed(5);\n const ctaHighlightDelayType =\n videoPlayerConfiguration?.ctaHighlightDelay?.type;\n const ctaHighlightDelayValue =\n videoPlayerConfiguration?.ctaHighlightDelay?.value?.toFixed(5);\n const shareBaseURL = videoPlayerConfiguration?.shareBaseURL;\n const ctaWidth = videoPlayerConfiguration?.ctaWidth;\n const buttonConfiguration = videoPlayerConfiguration?.buttonConfiguration;\n const showVideoDetailTitle = videoPlayerConfiguration?.showVideoDetailTitle;\n const requiresAds = adConfiguration?.requiresAds;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout;\n const vastAttributesString = this._generateVastAttributesString();\n\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n if (Platform.OS === 'android') {\n key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;\n key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;\n }\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `_productIds:${productIds?.join(',')}`;\n key += `_contentId:${contentId}`;\n key += `_mode:${mode}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n\n key += `_titleHidden:${titleHidden}`;\n if (Platform.OS === 'android') {\n key += `_cornerRadius:${cornerRadius}`;\n key += `_titleTextColor:${titleTextColor}`;\n key += `_titleFontSize:${titleFontSize}`;\n key += `_titleAndroidFontInfo.isCustom:${titleAndroidFontInfo?.isCustom}`;\n key += `_titleAndroidFontInfo.typefaceName:${titleAndroidFontInfo?.typefaceName}`;\n key += `_titleGradientDrawable.orientation:${titleGradientDrawable?.orientation}`;\n key += `_titleGradientDrawable.colors:${titleGradientDrawable?.colors?.join(\n ','\n )}`;\n key += `_playIconHidden:${playIconHidden}`;\n key += `_playIconWidth:${playIconWidth}`;\n key += `_showAdBadge:${showAdBadge}`;\n }\n\n key += `_titlePosition:${titlePosition}`;\n if (Platform.OS === 'android') {\n key += `_enableAutoplay:${enableAutoplay}`;\n }\n key += `_gridColumns:${gridColumns}`;\n key += `_itemSpacing:${itemSpacing}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\n if (Platform.OS === 'android') {\n key += `_playerStyle:${playerStyle}`;\n key += `_videoCompleteAction:${videoCompleteAction}`;\n key += `_showShareButton:${showShareButton}`;\n key += `_showPlaybackButton:${showPlaybackButton}`;\n key += `_showMuteButton:${showMuteButton}`;\n key += `_showBranding:${showBranding}`;\n key += `_ctaDelayType:${ctaDelayType}`;\n key += `_ctaDelayValue:${ctaDelayValue}`;\n key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;\n key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;\n key += `_ctaWidth:${ctaWidth}`;\n key += `_buttonConfiguration.videoDetailButton:${this._generateButtonInfoString(\n buttonConfiguration?.videoDetailButton\n )}`;\n key += `_buttonConfiguration.closeButton:${this._generateButtonInfoString(\n buttonConfiguration?.closeButton\n )}`;\n key += `_buttonConfiguration.muteButton:${this._generateButtonInfoString(\n buttonConfiguration?.muteButton\n )}`;\n key += `_buttonConfiguration.unmuteButton:${this._generateButtonInfoString(\n buttonConfiguration?.unmuteButton\n )}`;\n key += `_buttonConfiguration.playButton:${this._generateButtonInfoString(\n buttonConfiguration?.playButton\n )}`;\n key += `_buttonConfiguration.pauseButton:${this._generateButtonInfoString(\n buttonConfiguration?.pauseButton\n )}`;\n key += `_showVideoDetailTitle:${showVideoDetailTitle}`;\n }\n\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n enablePictureInPicture={undefined}\n videoFeedConfiguration={videoFeedConfiguration}\n videoPlayerConfiguration={videoPlayerConfiguration}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n onVideoFeedEmpty={this._onVideoFeedEmpty}\n onVideoFeedDidStartPictureInPicture={\n this._onVideoFeedDidStartPictureInPicture\n }\n onVideoFeedDidStopPictureInPicture={\n this._onVideoFeedDidStopPictureInPicture\n }\n mode={mode ?? 'row'}\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 | undefined {\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 _generateButtonInfoString(buttonInfo?: ButtonInfo): string {\n return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n let resultVideoFeedConfiguration = videoFeedConfiguration;\n\n if (\n resultVideoFeedConfiguration.gridColumns &&\n Math.floor(resultVideoFeedConfiguration.gridColumns) !==\n resultVideoFeedConfiguration.gridColumns\n ) {\n const gridColumns = Math.floor(resultVideoFeedConfiguration.gridColumns);\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n gridColumns,\n };\n }\n\n if (\n resultVideoFeedConfiguration.title &&\n resultVideoFeedConfiguration.title.numberOfLines &&\n Math.floor(resultVideoFeedConfiguration.title.numberOfLines) !==\n resultVideoFeedConfiguration.title.numberOfLines\n ) {\n const numberOfLines = Math.floor(\n resultVideoFeedConfiguration.title.numberOfLines\n );\n resultVideoFeedConfiguration = {\n ...resultVideoFeedConfiguration,\n title: {\n ...resultVideoFeedConfiguration.title,\n numberOfLines,\n },\n };\n }\n\n return resultVideoFeedConfiguration;\n }\n\n private _getVideoPlayerConfiguration():\n | VideoPlayerNativeConfiguration\n | undefined {\n const { videoPlayerConfiguration, enablePictureInPicture } = this.props;\n\n let resultVideoPlayerConfiguration:\n | VideoPlayerNativeConfiguration\n | undefined = videoPlayerConfiguration;\n if (typeof enablePictureInPicture === 'boolean') {\n if (!resultVideoPlayerConfiguration) {\n resultVideoPlayerConfiguration = {};\n }\n resultVideoPlayerConfiguration = {\n ...resultVideoPlayerConfiguration,\n enablePictureInPicture,\n };\n }\n\n return resultVideoPlayerConfiguration;\n }\n}\n\nexport default VideoFeed;\n"]}
@@ -6,7 +6,8 @@ import LiveStream from './LiveStream';
6
6
  import LiveStreamChatEventName from './models/LiveStreamChatEventName';
7
7
  import LiveStreamEventName from './models/LiveStreamEventName';
8
8
  import VideoPlaybackEventName from './models/VideoPlaybackEventName';
9
+ import VideoFeedUtil from './utils/VideoFeedUtil';
9
10
  import VideoShopping from './VideoShopping';
10
11
  export default FireworkSDK;
11
- export { FireworkSDK, FWNavigator, LiveStream, LiveStreamChatEventName, LiveStreamEventName, StoryBlock, VideoFeed, VideoPlaybackEventName, VideoShopping };
12
+ export { FireworkSDK, FWNavigator, LiveStream, LiveStreamChatEventName, LiveStreamEventName, StoryBlock, VideoFeed, VideoFeedUtil, VideoPlaybackEventName, VideoShopping };
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoShopping"],"mappings":"AAIA,OAAOA,UAAP,MAAuB,yBAAvB;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AAOA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AA6BA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;AAsCA,OAAOC,sBAAP,MAAmC,iCAAnC;AAsBA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,eAAeN,WAAf;AAEA,SAcEA,WAdF,EAgBEC,WAhBF,EA0BEC,UA1BF,EA4BEC,uBA5BF,EA+BEC,mBA/BF,EA4DEN,UA5DF,EAmEEC,SAnEF,EAiFEM,sBAjFF,EA6FEC,aA7FF","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 ButtonInfo from './models/ButtonInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n CustomTapProductCardEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n PlayerHandler,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type GradientDrawable from './models/GradientDrawable';\nimport type { GradientDrawableOrientation } from './models/GradientDrawable';\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 OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ProductCardConfiguration,\n ProductCardCTAButtonStyle,\n ProductCardCTAButtonText,\n ProductCardIconConfiguration,\n ProductCardLabelConfiguration,\n ProductCardPriceConfiguration,\n ProductCardPriceLabelAxis,\n ProductCardTheme,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type PushRNContainerParams from './models/PushRNContainerParams';\nimport type { RNAppProps } from './models/PushRNContainerParams';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedPadding,\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 VideoPlayerButtonConfiguration from './models/VideoPlayerButtonConfiguration';\nimport type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n} from './models/VideoPlayerCTADelay';\nimport type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';\nimport type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';\nimport type {\n VideoPlayerLogoConfiguration,\n VideoPlayerLogoOption,\n} from './models/VideoPlayerLogoConfiguration';\nimport type { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomTapProductCardCallback,\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 ButtonInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n CustomTapProductCardCallback,\n CustomTapProductCardEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n GradientDrawable,\n GradientDrawableOrientation,\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 OpenVideoPlayerConfiguration,\n PlayerHandler,\n Product,\n ProductCardConfiguration,\n ProductCardCTAButtonStyle,\n ProductCardCTAButtonText,\n ProductCardIconConfiguration,\n ProductCardLabelConfiguration,\n ProductCardPriceConfiguration,\n ProductCardPriceLabelAxis,\n ProductCardTheme,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n PushRNContainerParams,\n RNAppProps,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockConfiguration,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerButtonConfiguration,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerLogoConfiguration,\n VideoPlayerLogoOption,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoFeedUtil","VideoShopping"],"mappings":"AAIA,OAAOA,UAAP,MAAuB,yBAAvB;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AAOA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AA6BA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;AAsCA,OAAOC,sBAAP,MAAmC,iCAAnC;AAeA,OAAOC,aAAP,MAA0B,uBAA1B;AAQA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,eAAeP,WAAf;AAEA,SAcEA,WAdF,EAgBEC,WAhBF,EA0BEC,UA1BF,EA4BEC,uBA5BF,EA+BEC,mBA/BF,EA4DEN,UA5DF,EAmEEC,SAnEF,EA6EEO,aA7EF,EAkFED,sBAlFF,EA8FEE,aA9FF","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 ButtonInfo from './models/ButtonInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n CustomTapProductCardEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n PlayerHandler,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type GradientDrawable from './models/GradientDrawable';\nimport type { GradientDrawableOrientation } from './models/GradientDrawable';\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 OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ProductCardConfiguration,\n ProductCardCTAButtonStyle,\n ProductCardCTAButtonText,\n ProductCardIconConfiguration,\n ProductCardLabelConfiguration,\n ProductCardPriceConfiguration,\n ProductCardPriceLabelAxis,\n ProductCardTheme,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type PushRNContainerParams from './models/PushRNContainerParams';\nimport type { RNAppProps } from './models/PushRNContainerParams';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedPadding,\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 VideoPlayerButtonConfiguration from './models/VideoPlayerButtonConfiguration';\nimport type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n} from './models/VideoPlayerCTADelay';\nimport type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';\nimport type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';\nimport type {\n VideoPlayerLogoConfiguration,\n VideoPlayerLogoOption,\n} from './models/VideoPlayerLogoConfiguration';\nimport type { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport VideoFeedUtil from './utils/VideoFeedUtil';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomTapProductCardCallback,\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 ButtonInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n CustomTapProductCardCallback,\n CustomTapProductCardEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n GradientDrawable,\n GradientDrawableOrientation,\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 OpenVideoPlayerConfiguration,\n PlayerHandler,\n Product,\n ProductCardConfiguration,\n ProductCardCTAButtonStyle,\n ProductCardCTAButtonText,\n ProductCardIconConfiguration,\n ProductCardLabelConfiguration,\n ProductCardPriceConfiguration,\n ProductCardPriceLabelAxis,\n ProductCardTheme,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n PushRNContainerParams,\n RNAppProps,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockConfiguration,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoFeedUtil,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerButtonConfiguration,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerLogoConfiguration,\n VideoPlayerLogoOption,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
@@ -0,0 +1,65 @@
1
+ import { Platform } from 'react-native';
2
+
3
+ class VideoFeedUtil {
4
+ static calculateGridFeedHeight(_ref) {
5
+ let {
6
+ videoFeedConfiguration = {},
7
+ rows,
8
+ columns,
9
+ width
10
+ } = _ref;
11
+
12
+ if (Platform.OS === 'ios') {
13
+ var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3, _contentPadding$left, _contentPadding$right, _contentPadding$top, _contentPadding$botto;
14
+
15
+ const contentPadding = (_videoFeedConfigurati = videoFeedConfiguration.contentPadding) !== null && _videoFeedConfigurati !== void 0 ? _videoFeedConfigurati : {
16
+ top: 10,
17
+ right: 10,
18
+ bottom: 10,
19
+ left: 10
20
+ };
21
+ const itemSpacing = (_videoFeedConfigurati2 = videoFeedConfiguration.itemSpacing) !== null && _videoFeedConfigurati2 !== void 0 ? _videoFeedConfigurati2 : 10;
22
+ const aspectRatio = (_videoFeedConfigurati3 = videoFeedConfiguration.aspectRatio) !== null && _videoFeedConfigurati3 !== void 0 ? _videoFeedConfigurati3 : 4 / 6;
23
+ const horizontalMargin = ((_contentPadding$left = contentPadding.left) !== null && _contentPadding$left !== void 0 ? _contentPadding$left : 10) + ((_contentPadding$right = contentPadding.right) !== null && _contentPadding$right !== void 0 ? _contentPadding$right : 10);
24
+ const verticalMargin = ((_contentPadding$top = contentPadding.top) !== null && _contentPadding$top !== void 0 ? _contentPadding$top : 10) + ((_contentPadding$botto = contentPadding.bottom) !== null && _contentPadding$botto !== void 0 ? _contentPadding$botto : 10);
25
+ const totalHorizontalSpacing = (columns - 1) * itemSpacing;
26
+ const totalVerticalSpacing = (rows - 1) * itemSpacing;
27
+ const availableItemWidth = width - (totalHorizontalSpacing + horizontalMargin);
28
+ const singleItemWidth = availableItemWidth / columns;
29
+ const singleItemHeight = singleItemWidth / aspectRatio;
30
+ const feedHeight = singleItemHeight * rows + totalVerticalSpacing + verticalMargin;
31
+ return Math.ceil(feedHeight);
32
+ } else {
33
+ var _videoFeedConfigurati4, _contentPadding$left2, _contentPadding$right2, _contentPadding$top2, _contentPadding$botto2;
34
+
35
+ const itemSpacing = (_videoFeedConfigurati4 = videoFeedConfiguration.itemSpacing) !== null && _videoFeedConfigurati4 !== void 0 ? _videoFeedConfigurati4 : 8;
36
+ const contentPadding = {
37
+ top: itemSpacing / 2,
38
+ right: itemSpacing / 2,
39
+ bottom: itemSpacing / 2,
40
+ left: itemSpacing / 2
41
+ };
42
+ const aspectRatio = 9 / 16;
43
+ const horizontalMargin = ((_contentPadding$left2 = contentPadding.left) !== null && _contentPadding$left2 !== void 0 ? _contentPadding$left2 : 4) + ((_contentPadding$right2 = contentPadding.right) !== null && _contentPadding$right2 !== void 0 ? _contentPadding$right2 : 4);
44
+ const verticalMargin = ((_contentPadding$top2 = contentPadding.top) !== null && _contentPadding$top2 !== void 0 ? _contentPadding$top2 : 4) + ((_contentPadding$botto2 = contentPadding.bottom) !== null && _contentPadding$botto2 !== void 0 ? _contentPadding$botto2 : 4);
45
+ const totalHorizontalSpacing = (columns - 1) * itemSpacing;
46
+ const totalVerticalSpacing = (rows - 1) * itemSpacing;
47
+ const availableItemWidth = width - totalHorizontalSpacing - horizontalMargin;
48
+ const singleItemWidth = availableItemWidth / columns;
49
+ let singleItemHeight = 0;
50
+
51
+ if (videoFeedConfiguration.titlePosition === 'stacked') {
52
+ singleItemHeight = singleItemWidth / aspectRatio + 30;
53
+ } else {
54
+ singleItemHeight = singleItemWidth / aspectRatio;
55
+ }
56
+
57
+ const feedHeight = singleItemHeight * rows + totalVerticalSpacing + verticalMargin;
58
+ return Math.ceil(feedHeight);
59
+ }
60
+ }
61
+
62
+ }
63
+
64
+ export default VideoFeedUtil;
65
+ //# sourceMappingURL=VideoFeedUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["VideoFeedUtil.ts"],"names":["Platform","VideoFeedUtil","calculateGridFeedHeight","videoFeedConfiguration","rows","columns","width","OS","contentPadding","top","right","bottom","left","itemSpacing","aspectRatio","horizontalMargin","verticalMargin","totalHorizontalSpacing","totalVerticalSpacing","availableItemWidth","singleItemWidth","singleItemHeight","feedHeight","Math","ceil","titlePosition"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;;AAGA,MAAMC,aAAN,CAAoB;AACY,SAAvBC,uBAAuB,OAUnB;AAAA,QAVoB;AAC7BC,MAAAA,sBAAsB,GAAG,EADI;AAE7BC,MAAAA,IAF6B;AAG7BC,MAAAA,OAH6B;AAI7BC,MAAAA;AAJ6B,KAUpB;;AACT,QAAIN,QAAQ,CAACO,EAAT,KAAgB,KAApB,EAA2B;AAAA;;AACzB,YAAMC,cAAc,4BAAGL,sBAAsB,CAACK,cAA1B,yEAA4C;AAC9DC,QAAAA,GAAG,EAAE,EADyD;AAE9DC,QAAAA,KAAK,EAAE,EAFuD;AAG9DC,QAAAA,MAAM,EAAE,EAHsD;AAI9DC,QAAAA,IAAI,EAAE;AAJwD,OAAhE;AAMA,YAAMC,WAAW,6BAAGV,sBAAsB,CAACU,WAA1B,2EAAyC,EAA1D;AACA,YAAMC,WAAW,6BAAGX,sBAAsB,CAACW,WAA1B,2EAAyC,IAAI,CAA9D;AACA,YAAMC,gBAAgB,GACpB,yBAACP,cAAc,CAACI,IAAhB,uEAAwB,EAAxB,8BAA+BJ,cAAc,CAACE,KAA9C,yEAAuD,EAAvD,CADF;AAEA,YAAMM,cAAc,GAClB,wBAACR,cAAc,CAACC,GAAhB,qEAAuB,EAAvB,8BAA8BD,cAAc,CAACG,MAA7C,yEAA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AEA,YAAMK,eAAe,GAAGD,kBAAkB,GAAGd,OAA7C;AACA,UAAIgB,gBAAgB,GAAG,CAAvB;;AACA,UAAIlB,sBAAsB,CAACsB,aAAvB,KAAyC,SAA7C,EAAwD;AACtDJ,QAAAA,gBAAgB,GAAGD,eAAe,GAAGN,WAAlB,GAAgC,EAAnD;AACD,OAFD,MAEO;AACLO,QAAAA,gBAAgB,GAAGD,eAAe,GAAGN,WAArC;AACD;;AAED,YAAMQ,UAAU,GACdD,gBAAgB,GAAGjB,IAAnB,GAA0Bc,oBAA1B,GAAiDF,cADnD;AAGA,aAAOO,IAAI,CAACC,IAAL,CAAUF,UAAV,CAAP;AACD;AACF;;AAnEiB;;AAsEpB,eAAerB,aAAf","sourcesContent":["import { Platform } from 'react-native';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\n\nclass VideoFeedUtil {\n static calculateGridFeedHeight({\n videoFeedConfiguration = {},\n rows,\n columns,\n width,\n }: {\n videoFeedConfiguration?: VideoFeedConfiguration;\n rows: number;\n columns: number;\n width: number;\n }): number {\n if (Platform.OS === 'ios') {\n const contentPadding = videoFeedConfiguration.contentPadding ?? {\n top: 10,\n right: 10,\n bottom: 10,\n left: 10,\n };\n const itemSpacing = videoFeedConfiguration.itemSpacing ?? 10;\n const aspectRatio = videoFeedConfiguration.aspectRatio ?? 4 / 6;\n const horizontalMargin =\n (contentPadding.left ?? 10) + (contentPadding.right ?? 10);\n const verticalMargin =\n (contentPadding.top ?? 10) + (contentPadding.bottom ?? 10);\n const totalHorizontalSpacing = (columns - 1) * itemSpacing;\n const totalVerticalSpacing = (rows - 1) * itemSpacing;\n\n const availableItemWidth =\n width - (totalHorizontalSpacing + horizontalMargin);\n const singleItemWidth = availableItemWidth / columns;\n const singleItemHeight = singleItemWidth / aspectRatio;\n const feedHeight =\n singleItemHeight * rows + totalVerticalSpacing + verticalMargin;\n\n return Math.ceil(feedHeight);\n } else {\n const itemSpacing = videoFeedConfiguration.itemSpacing ?? 8;\n const contentPadding = {\n top: itemSpacing / 2,\n right: itemSpacing / 2,\n bottom: itemSpacing / 2,\n left: itemSpacing / 2,\n };\n const aspectRatio = 9 / 16;\n const horizontalMargin =\n (contentPadding.left ?? 4) + (contentPadding.right ?? 4);\n const verticalMargin =\n (contentPadding.top ?? 4) + (contentPadding.bottom ?? 4);\n const totalHorizontalSpacing = (columns - 1) * itemSpacing;\n const totalVerticalSpacing = (rows - 1) * itemSpacing;\n\n const availableItemWidth =\n width - totalHorizontalSpacing - horizontalMargin;\n const singleItemWidth = availableItemWidth / columns;\n let singleItemHeight = 0;\n if (videoFeedConfiguration.titlePosition === 'stacked') {\n singleItemHeight = singleItemWidth / aspectRatio + 30;\n } else {\n singleItemHeight = singleItemWidth / aspectRatio;\n }\n\n const feedHeight =\n singleItemHeight * rows + totalVerticalSpacing + verticalMargin;\n\n return Math.ceil(feedHeight);\n }\n }\n}\n\nexport default VideoFeedUtil;\n"]}
@@ -43,7 +43,6 @@ declare class VideoShopping {
43
43
  private _onCustomClickLinkButton?;
44
44
  /**
45
45
  * This callback is triggered when the user clicks product card.
46
- * Only supported on iOS.
47
46
  *
48
47
  * The host app can customize the tap event processing logic of
49
48
  * the product card by setting the callback.
@@ -13,6 +13,11 @@ export interface IStoryBlockMethods {
13
13
  * Pause the story block.
14
14
  */
15
15
  pause: () => void;
16
+ /**
17
+ * Open the fullscreen story block.
18
+ * Only supported on Android.
19
+ */
20
+ openFullscreen: () => void;
16
21
  }
17
22
  /**
18
23
  * The props type of StoryBlock component.
@@ -64,17 +69,23 @@ export interface IStoryBlockProps {
64
69
  */
65
70
  cornerRadius?: number;
66
71
  /**
67
- * Ad configuration of the feed. Only supported on iOS.
72
+ * Ad configuration of the feed.
68
73
  */
69
74
  adConfiguration?: AdConfiguration;
70
- /**
71
- * The configuration of the story block.
72
- */
73
75
  storyBlockConfiguration?: StoryBlockConfiguration;
74
76
  /**
75
77
  * The feed loading result callback. It means loading successfully when error equals to undefined.
76
78
  */
77
79
  onStoryBlockLoadFinished?: (error?: FWError) => void;
80
+ /**
81
+ * The callback is triggered when there are no items in the story block.
82
+ * The callback is triggered in the following cases:
83
+ * 1. Loading successfully but the back end returns an empty list.
84
+ * 2. The load failed and list is empty.
85
+ * onStoryBlockLoadFinished will also be triggered when onStoryBlockEmpty is triggered.
86
+ * Only supported on Android.
87
+ */
88
+ onStoryBlockEmpty?: (error?: FWError) => void;
78
89
  /**
79
90
  * Start Picture in Picture callback. Only supported on iOS.
80
91
  */
@@ -70,13 +70,22 @@ export interface IVideoFeedProps {
70
70
  */
71
71
  videoPlayerConfiguration?: VideoPlayerConfiguration;
72
72
  /**
73
- * Ad configuration of the feed. Only supported on iOS.
73
+ * Ad configuration of the feed.
74
74
  */
75
75
  adConfiguration?: AdConfiguration;
76
76
  /**
77
77
  * The feed loading result callback. It means loading successfully when error equals to undefined.
78
78
  */
79
79
  onVideoFeedLoadFinished?: (error?: FWError) => void;
80
+ /**
81
+ * The callback is triggered when there are no items in the story block.
82
+ * The callback is triggered in the following cases:
83
+ * 1. Loading successfully but the back end returns an empty list.
84
+ * 2. The load failed and list is empty.
85
+ * onVideoFeedLoadFinished will also be triggered when onVideoFeedEmpty is triggered.
86
+ * Only supported on Android.
87
+ */
88
+ onVideoFeedEmpty?: (error?: FWError) => void;
80
89
  /**
81
90
  * Start Picture in Picture callback. Only supported on iOS.
82
91
  */
@@ -101,9 +110,11 @@ declare class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState
101
110
  };
102
111
  private _nativeComponentRef;
103
112
  private _subscriptions;
113
+ private _loaded;
104
114
  constructor(props: IVideoFeedProps);
105
115
  refresh: () => void;
106
116
  private _onVideoFeedLoadFinished;
117
+ private _onVideoFeedEmpty;
107
118
  private _onVideoFeedDidStartPictureInPicture;
108
119
  private _onVideoFeedDidStopPictureInPicture;
109
120
  /**
@@ -52,7 +52,8 @@ import type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';
52
52
  import type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';
53
53
  import type { VideoPlayerLogoConfiguration, VideoPlayerLogoOption } from './models/VideoPlayerLogoConfiguration';
54
54
  import type { VideoPlayerStyle } from './models/VideoPlayerStyle';
55
+ import VideoFeedUtil from './utils/VideoFeedUtil';
55
56
  import type { CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomTapProductCardCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
56
57
  import VideoShopping from './VideoShopping';
57
58
  export default FireworkSDK;
58
- export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, ButtonInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, CustomTapProductCardCallback, CustomTapProductCardEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, PlayerHandler, Product, ProductCardConfiguration, ProductCardCTAButtonStyle, ProductCardCTAButtonText, ProductCardIconConfiguration, ProductCardLabelConfiguration, ProductCardPriceConfiguration, ProductCardPriceLabelAxis, ProductCardTheme, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerButtonConfiguration, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerLogoConfiguration, VideoPlayerLogoOption, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
59
+ export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, ButtonInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, CustomTapProductCardCallback, CustomTapProductCardEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, PlayerHandler, Product, ProductCardConfiguration, ProductCardCTAButtonStyle, ProductCardCTAButtonText, ProductCardIconConfiguration, ProductCardLabelConfiguration, ProductCardPriceConfiguration, ProductCardPriceLabelAxis, ProductCardTheme, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoFeedUtil, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerButtonConfiguration, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerLogoConfiguration, VideoPlayerLogoOption, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
@@ -2,7 +2,6 @@ export default interface ButtonInfo {
2
2
  /**
3
3
  * The name of image in the asset catalogs.
4
4
  * For example, you need to add the image in the Images.xcassets(or Assets.xcassets etc.)
5
- * Only supported on iOS.
6
5
  */
7
6
  imageName?: string;
8
7
  /**
@@ -129,7 +129,7 @@ export interface ProductCardConfiguration {
129
129
  */
130
130
  ctaButtonStyle?: ProductCardCTAButtonStyle;
131
131
  /**
132
- * Price is hidden or not.
132
+ * The price configuration of product card.
133
133
  */
134
134
  priceConfiguration?: ProductCardPriceConfiguration;
135
135
  /**
@@ -160,7 +160,7 @@ export interface ProductCardConfiguration {
160
160
  }
161
161
  export default interface ProductInfoViewConfiguration {
162
162
  /**
163
- * Configuration of shopping CTA button. Only supported on iOS.
163
+ * Configuration of shopping CTA button.
164
164
  */
165
165
  ctaButton?: ShoppingCTAButtonConfiguration;
166
166
  /**
@@ -168,7 +168,7 @@ export default interface ProductInfoViewConfiguration {
168
168
  */
169
169
  linkButton?: LinkButtonConfiguration;
170
170
  /**
171
- * Configuration of product card. Only supported on iOS.
171
+ * Configuration of product card.
172
172
  */
173
173
  productCard?: ProductCardConfiguration;
174
174
  }
@@ -63,12 +63,10 @@ export interface StoryBlockConfiguration {
63
63
  /**
64
64
  * The host app could use this property to customize the button images of the video player.
65
65
  * On iOS, the property only applies to full-screen story block but not to compact story block.
66
- * Only supported on iOS.
67
66
  */
68
67
  buttonConfiguration?: VideoPlayerButtonConfiguration;
69
68
  /**
70
69
  * Specifies if the title should be shown.
71
- * Only supported on ios.
72
70
  */
73
71
  showVideoDetailTitle?: boolean;
74
72
  /**
@@ -3,37 +3,31 @@ export default interface VideoPlayerButtonConfiguration {
3
3
  /**
4
4
  * Specifies the video detail button info.
5
5
  * Image will be drawn in a 40pt x 40pt frame.
6
- * Only supported on iOS.
7
6
  */
8
7
  videoDetailButton?: ButtonInfo;
9
8
  /**
10
9
  * Specifies the close button info.
11
10
  * Image will be drawn in a 40pt x 40pt frame.
12
- * Only supported on iOS.
13
11
  */
14
12
  closeButton?: ButtonInfo;
15
13
  /**
16
14
  * Specifies the mute button info.
17
15
  * Image will be drawn in a 40pt x 40pt frame.
18
- * Only supported on iOS.
19
16
  */
20
17
  muteButton?: ButtonInfo;
21
18
  /**
22
19
  * Specifies the unmute button info.
23
20
  * Image will be drawn in a 40pt x 40pt frame.
24
- * Only supported on iOS.
25
21
  */
26
22
  unmuteButton?: ButtonInfo;
27
23
  /**
28
24
  * Specifies the play info.
29
25
  * Image will be drawn at the center of the player view.
30
- * Only supported on iOS.
31
26
  */
32
27
  playButton?: ButtonInfo;
33
28
  /**
34
29
  * Specifies the pause info.
35
30
  * Image will be drawn at the center of the player view.
36
- * Only supported on iOS.
37
31
  */
38
32
  pauseButton?: ButtonInfo;
39
33
  }
@@ -61,12 +61,10 @@ export default interface VideoPlayerConfiguration {
61
61
  ctaWidth?: VideoPlayerCTAWidth;
62
62
  /**
63
63
  * The host app could use this property to customize the button images of the video player.
64
- * Only supported on iOS.
65
64
  */
66
65
  buttonConfiguration?: VideoPlayerButtonConfiguration;
67
66
  /**
68
67
  * Indicates if the video player shows title.
69
- * Only supported on iOS.
70
68
  */
71
69
  showVideoDetailTitle?: boolean;
72
70
  /**
@@ -0,0 +1,10 @@
1
+ import type VideoFeedConfiguration from '../models/VideoFeedConfiguration';
2
+ declare class VideoFeedUtil {
3
+ static calculateGridFeedHeight({ videoFeedConfiguration, rows, columns, width, }: {
4
+ videoFeedConfiguration?: VideoFeedConfiguration;
5
+ rows: number;
6
+ columns: number;
7
+ width: number;
8
+ }): number;
9
+ }
10
+ export default VideoFeedUtil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-firework-sdk",
3
- "version": "2.8.6",
3
+ "version": "2.9.0",
4
4
  "description": "Firework React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -86,7 +86,6 @@ class VideoShopping {
86
86
 
87
87
  /**
88
88
  * This callback is triggered when the user clicks product card.
89
- * Only supported on iOS.
90
89
  *
91
90
  * The host app can customize the tap event processing logic of
92
91
  * the product card by setting the callback.
@@ -100,9 +99,7 @@ class VideoShopping {
100
99
  value: CustomTapProductCardCallback | undefined
101
100
  ) {
102
101
  this._onCustomTapProductCard = value;
103
- if (Platform.OS === 'ios') {
104
- ShoppingModule.setCustomTapProductCardEnabled(!!value);
105
- }
102
+ ShoppingModule.setCustomTapProductCardEnabled(!!value);
106
103
  }
107
104
  private _onCustomTapProductCard?: CustomTapProductCardCallback | undefined;
108
105