react-native-firework-sdk 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FireworkVideoUI.xcframework/Info.plist +5 -5
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +1 -1
- package/ios/Components/VideoFeed.swift +9 -9
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +6 -2
- package/lib/commonjs/FireworkSDK.js +15 -19
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +23 -17
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +39 -30
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/module/FireworkSDK.js +14 -19
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/components/StoryBlock.js +24 -17
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +39 -30
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +3 -6
- package/lib/typescript/components/VideoFeed.d.ts +4 -4
- package/lib/typescript/models/FeedItemDetails.d.ts +7 -0
- package/package.json +1 -1
- package/src/FireworkSDK.ts +13 -22
- package/src/components/StoryBlock.tsx +26 -19
- package/src/components/VideoFeed.tsx +55 -39
- package/src/models/FeedItemDetails.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","log","JSON","stringify","props","nativeNodeHandle","_nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","adConfiguration","enablePictureInPicture","hashtagFilterExpression","videoFeedConfiguration","_getVideoFeedConfiguration","titleHidden","title","hidden","titlePosition","gShareBaseURL","getInstance","shareBaseURL","adBadgeConfiguration","getAdBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","enableAutoplay","gridColumns","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","showAdBadge","videoLaunchBehavior","appLanguage","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length","vastAttributes","attribute","Math","floor"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AAKA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAiEA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,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,KAAL,CAAW7C,sBAAsB,CAACoB,WAAlC;AAFR,OAAP;AAID,KATD,MASO;AACL,aAAOpB,sBAAP;AACD;AACF;;AAnPsD;;gBAAnDhD,S,kBAIkB;AACpB4C,EAAAA,IAAI,EAAE;AADc,C;;AAkPxB,eAAe5C,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 FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\n/**\n * The props of VideoFeed component.\n */\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.\n * Queries are specified with boolean predicates on what hashtags are there on the video.\n * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.\n * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.\n */\n hashtagFilterExpression?: string;\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Ad configuration of the feed. Only supported on iOS.\n */\n adConfiguration?: AdConfiguration;\n /**\n * Specifies if Picture in Picture is enabled.\n */\n enablePictureInPicture?: boolean;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps> {\n /**\n * @ignore\n */\n static defaultProps = {\n mode: 'row',\n };\n\n private _nativeComponentRef = React.createRef<any>();\n\n private _subscriptions: EmitterSubscription[] = [];\n\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this._nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);\n const subscriptionOfAppLanguageUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AppLanguageUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAppLanguageUpdated);\n }\n\n /**\n * @ignore\n */\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this._subscriptions.forEach((value) => {\n value.remove();\n });\n\n this._subscriptions = [];\n }\n\n /**\n * @ignore\n */\n render() {\n FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);\n\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n adConfiguration,\n enablePictureInPicture = false,\n hashtagFilterExpression = '',\n } = this.props;\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;\n\n const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;\n const requiresAds = adConfiguration?.requiresAds ?? false;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = this._generateVastAttributesString();\n const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;\n const videoLaunchBehavior =\n FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';\n const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_gShareBaseURL:${gShareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_enableAutoplay:${enableAutoplay}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n key += `_gridColumns:${gridColumns}`;\n key += `_requiresAds:${requiresAds}`;\n key += `_adsFetchTimeout:${adsFetchTimeout}`;\n key += `_vastAttributes:${vastAttributesString}`;\n key += `_showAdBadge:${showAdBadge}`;\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n key += `_appLanguage:${appLanguage}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n\n private _generateVastAttributesString(): string {\n const { adConfiguration } = this.props;\n const vastAttributes = adConfiguration?.vastAttributes ?? '';\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name ?? ''}:${attribute.value}`;\n }\n\n return resultString;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n if (\n videoFeedConfiguration.gridColumns &&\n Math.floor(videoFeedConfiguration.gridColumns!) !==\n videoFeedConfiguration.gridColumns\n ) {\n return {\n ...videoFeedConfiguration,\n gridColumns: Math.floor(videoFeedConfiguration.gridColumns!),\n };\n } else {\n return videoFeedConfiguration;\n }\n }\n}\n\nexport default VideoFeed;\n"]}
|
|
1
|
+
{"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","Platform","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWLoggerUtil","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","log","JSON","stringify","props","nativeNodeHandle","_nativeComponentRef","current","commandId","getViewManagerConfig","Commands","refresh","OS","toString","dispatchViewManagerCommand","event","nativeEvent","onVideoFeedLoadFinished","name","reason","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","_subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","subscriptionOfVideoLaunchBehaviorUpdated","VideoLaunchBehaviorUpdated","subscriptionOfAppLanguageUpdated","AppLanguageUpdated","componentWillUnmount","forEach","value","remove","render","gShareBaseURL","getInstance","shareBaseURL","appLanguage","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","videoLaunchBehavior","source","channel","playlist","playlistGroup","hashtagFilterExpression","mode","enablePictureInPicture","adConfiguration","videoPlayerConfiguration","dynamicContentParametersString","_generateDynamicContentParametersString","videoFeedConfiguration","_getVideoFeedConfiguration","titleHidden","title","hidden","titlePosition","enableAutoplay","gridColumns","showAdBadge","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length","vastAttributes","attribute","Math","floor"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAEEC,cAFF,EAIEC,QAJF,EAMEC,SANF,QAQO,cARP;AAUA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AAKA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAiEA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA;AACA;AACA;;AACA,MAAMC,SAAN,SAAwBV,KAAK,CAACW,SAA9B,CAAyD;AAAA;AAAA;;AAAA,8DAQzBX,KAAK,CAACY,SAAN,EARyB;;AAAA,4CAUP,EAVO;;AAAA,qCAYtC,MAAM;AACrBL,MAAAA,YAAY,CAACM,GAAb,CAAkB,qBAAoBC,IAAI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B,CAACO,WAAlC,MACEP,sBAAsB,CAACO,WAH3B,EAIE;AACA,aAAO,EACL,GAAGP,sBADE;AAELO,QAAAA,WAAW,EAAEsB,IAAI,CAACC,KAAL,CAAW9B,sBAAsB,CAACO,WAAlC;AAFR,OAAP;AAID,KATD,MASO;AACL,aAAOP,sBAAP;AACD;AACF;;AAnQsD;;gBAAnD/D,S,kBAIkB;AACpByD,EAAAA,IAAI,EAAE;AADc,C;;AAkQxB,eAAezD,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 FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type AdConfiguration from '../models/AdConfiguration';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\n/**\n * The props of VideoFeed component.\n */\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.The playlistGroup is only supported on iOS\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup. Only supported on iOS.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.\n * Queries are specified with boolean predicates on what hashtags are there on the video.\n * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.\n * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.\n */\n hashtagFilterExpression?: string;\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * 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. Only supported on iOS.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\n/**\n * VideoFeed component.\n */\nclass VideoFeed extends React.Component<IVideoFeedProps> {\n /**\n * @ignore\n */\n static defaultProps = {\n mode: 'row',\n };\n\n private _nativeComponentRef = React.createRef<any>();\n\n private _subscriptions: EmitterSubscription[] = [];\n\n public refresh = () => {\n FWLoggerUtil.log(`VideoFeed refresh ${JSON.stringify(this.props)}`);\n\n const nativeNodeHandle = findNodeHandle(this._nativeComponentRef.current);\n\n let commandId: string | number =\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh;\n if (Platform.OS === 'android') {\n commandId = commandId.toString();\n }\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n commandId,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (event: NativeSyntheticEvent<any>) => {\n FWLoggerUtil.log(\n `VideoFeed _onVideoFeedLoadFinished ${JSON.stringify(event.nativeEvent)}`\n );\n const { onVideoFeedLoadFinished } = this.props;\n\n const { name, reason } = event.nativeEvent;\n\n if (onVideoFeedLoadFinished) {\n if (name) {\n if (reason) {\n onVideoFeedLoadFinished({ name, reason });\n } else {\n onVideoFeedLoadFinished({ name });\n }\n } else {\n onVideoFeedLoadFinished();\n }\n }\n };\n\n /**\n * @ignore\n */\n componentDidMount() {\n FWLoggerUtil.log(\n `VideoFeed componentDidMount ${JSON.stringify(this.props)}`\n );\n\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n\n const subscriptionOfVideoLaunchBehaviorUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.VideoLaunchBehaviorUpdated,\n () => {\n FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');\n this.setState({});\n }\n );\n this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);\n\n if (Platform.OS === 'ios') {\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 /**\n * @ignore\n */\n componentWillUnmount() {\n FWLoggerUtil.log(\n `VideoFeed componentWillUnmount ${JSON.stringify(this.props)}`\n );\n\n this._subscriptions.forEach((value) => {\n value.remove();\n });\n\n this._subscriptions = [];\n }\n\n /**\n * @ignore\n */\n render() {\n FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);\n const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const videoLaunchBehavior =\n FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';\n\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n hashtagFilterExpression = '',\n mode = 'row',\n enablePictureInPicture = false,\n adConfiguration,\n videoPlayerConfiguration,\n } = this.props;\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;\n const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;\n const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;\n\n const shareBaseURL = videoPlayerConfiguration?.shareBaseURL ?? '';\n\n const requiresAds = adConfiguration?.requiresAds ?? false;\n const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;\n const vastAttributesString = this._generateVastAttributesString();\n\n let key = `gShareBaseURL:${gShareBaseURL}`;\n if (Platform.OS === 'ios') {\n key += `_appLanguage:${appLanguage}`;\n }\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_videoLaunchBehavior:${videoLaunchBehavior}`;\n\n key += `_source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n key += `_hashtagFilterExpression:${hashtagFilterExpression}`;\n key += `_mode:${mode}`;\n key += `_enablePictureInPicture:${enablePictureInPicture}`;\n\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_enableAutoplay:${enableAutoplay}`;\n key += `_gridColumns:${gridColumns}`;\n key += `_showAdBadge:${showAdBadge}`;\n\n key += `_shareBaseURL:${shareBaseURL}`;\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 videoFeedConfiguration={videoFeedConfiguration}\n ref={this._nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n\n private _generateVastAttributesString(): string {\n const { adConfiguration } = this.props;\n const vastAttributes = adConfiguration?.vastAttributes ?? '';\n if (!vastAttributes) {\n return '';\n }\n\n let resultString = '';\n for (const attribute of vastAttributes) {\n if (resultString.length > 0) {\n resultString += '_';\n }\n resultString += `${attribute.name ?? ''}:${attribute.value}`;\n }\n\n return resultString;\n }\n\n private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {\n const { videoFeedConfiguration } = this.props;\n if (!videoFeedConfiguration) {\n return videoFeedConfiguration;\n }\n\n if (\n videoFeedConfiguration.gridColumns &&\n Math.floor(videoFeedConfiguration.gridColumns!) !==\n videoFeedConfiguration.gridColumns\n ) {\n return {\n ...videoFeedConfiguration,\n gridColumns: Math.floor(videoFeedConfiguration.gridColumns!),\n };\n } else {\n return videoFeedConfiguration;\n }\n }\n}\n\nexport default VideoFeed;\n"]}
|
|
@@ -44,13 +44,10 @@ declare class FireworkSDK {
|
|
|
44
44
|
set shareBaseURL(value: string | undefined);
|
|
45
45
|
private _shareBaseURL;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* The configuration for ad badges.
|
|
48
48
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* Set the configuration for ad badges. Only supported on iOS.
|
|
52
|
-
*/
|
|
53
|
-
setAdBadgeConfiguration(value: AdBadgeConfiguration | undefined): Promise<void>;
|
|
49
|
+
get adBadgeConfiguration(): AdBadgeConfiguration | undefined;
|
|
50
|
+
set adBadgeConfiguration(value: AdBadgeConfiguration | undefined);
|
|
54
51
|
private _adBadgeConfiguration;
|
|
55
52
|
get appLanguage(): string | undefined | null;
|
|
56
53
|
private _appLanguage;
|
|
@@ -47,6 +47,10 @@ export interface IVideoFeedProps {
|
|
|
47
47
|
* One of three available display modes. Defaults to row.
|
|
48
48
|
*/
|
|
49
49
|
mode?: VideoFeedMode;
|
|
50
|
+
/**
|
|
51
|
+
* Specifies if Picture in Picture is enabled.
|
|
52
|
+
*/
|
|
53
|
+
enablePictureInPicture?: boolean;
|
|
50
54
|
/**
|
|
51
55
|
* Configuration of the feed.
|
|
52
56
|
*/
|
|
@@ -59,10 +63,6 @@ export interface IVideoFeedProps {
|
|
|
59
63
|
* Ad configuration of the feed. Only supported on iOS.
|
|
60
64
|
*/
|
|
61
65
|
adConfiguration?: AdConfiguration;
|
|
62
|
-
/**
|
|
63
|
-
* Specifies if Picture in Picture is enabled.
|
|
64
|
-
*/
|
|
65
|
-
enablePictureInPicture?: boolean;
|
|
66
66
|
/**
|
|
67
67
|
* The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.
|
|
68
68
|
*/
|
|
@@ -44,4 +44,11 @@ export default interface FeedItemDetails {
|
|
|
44
44
|
dynamicContentParameters?: {
|
|
45
45
|
[key: string]: string[];
|
|
46
46
|
} | null;
|
|
47
|
+
/**
|
|
48
|
+
* Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
|
|
49
|
+
* Queries are specified with boolean predicates on what hashtags are there on the video.
|
|
50
|
+
* For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
|
|
51
|
+
* Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
|
|
52
|
+
*/
|
|
53
|
+
hashtagFilterExpression?: string;
|
|
47
54
|
}
|
package/package.json
CHANGED
package/src/FireworkSDK.ts
CHANGED
|
@@ -76,25 +76,18 @@ class FireworkSDK {
|
|
|
76
76
|
return this._shareBaseURL;
|
|
77
77
|
}
|
|
78
78
|
public set shareBaseURL(value: string | undefined) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
79
|
+
this.updateInternalShareBaseURL(value);
|
|
80
|
+
FireworkSDKModule.setShareBaseURL(value ?? '');
|
|
82
81
|
}
|
|
83
82
|
private _shareBaseURL: string | undefined;
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
|
-
*
|
|
85
|
+
* The configuration for ad badges.
|
|
87
86
|
*/
|
|
88
|
-
public
|
|
87
|
+
public get adBadgeConfiguration(): AdBadgeConfiguration | undefined {
|
|
89
88
|
return this._adBadgeConfiguration;
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
* Set the configuration for ad badges. Only supported on iOS.
|
|
93
|
-
*/
|
|
94
|
-
public async setAdBadgeConfiguration(
|
|
95
|
-
value: AdBadgeConfiguration | undefined
|
|
96
|
-
): Promise<void> {
|
|
97
|
-
await FireworkSDKModule.setAdBadgeConfiguration(value ?? {});
|
|
90
|
+
public set adBadgeConfiguration(value: AdBadgeConfiguration | undefined) {
|
|
98
91
|
const valueHasChanged =
|
|
99
92
|
this._adBadgeConfiguration?.badgeTextType !== value?.badgeTextType ||
|
|
100
93
|
this._adBadgeConfiguration?.backgroundColor !== value?.backgroundColor ||
|
|
@@ -103,6 +96,7 @@ class FireworkSDK {
|
|
|
103
96
|
if (valueHasChanged) {
|
|
104
97
|
this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);
|
|
105
98
|
}
|
|
99
|
+
FireworkSDKModule.setAdBadgeConfiguration(value ?? {});
|
|
106
100
|
}
|
|
107
101
|
private _adBadgeConfiguration: AdBadgeConfiguration | undefined;
|
|
108
102
|
|
|
@@ -230,15 +224,13 @@ class FireworkSDK {
|
|
|
230
224
|
*/
|
|
231
225
|
public async init(options?: SDKInitOptions): Promise<void> {
|
|
232
226
|
FWLoggerUtil.log('Call FireworkSDK init method');
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
this.
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
});
|
|
227
|
+
const videoLaunchBehaviorUpdated =
|
|
228
|
+
this._videoLaunchBehavior !== options?.videoLaunchBehavior;
|
|
229
|
+
this._videoLaunchBehavior = options?.videoLaunchBehavior;
|
|
230
|
+
if (videoLaunchBehaviorUpdated) {
|
|
231
|
+
this.eventEmitter.emit(FWEventName.VideoLaunchBehaviorUpdated);
|
|
232
|
+
}
|
|
233
|
+
FireworkSDKModule.init(options);
|
|
242
234
|
ShoppingModule.init();
|
|
243
235
|
LiveStreamModule.init();
|
|
244
236
|
}
|
|
@@ -290,7 +282,6 @@ class FireworkSDK {
|
|
|
290
282
|
|
|
291
283
|
private updateInternalShareBaseURL(shareBaseURL?: string) {
|
|
292
284
|
const shareBaseURLChanged = this._shareBaseURL !== shareBaseURL;
|
|
293
|
-
console.log('updateInternalShareBaseURL shareBaseURL', shareBaseURL);
|
|
294
285
|
this._shareBaseURL = shareBaseURL;
|
|
295
286
|
if (shareBaseURLChanged) {
|
|
296
287
|
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
@@ -153,7 +153,9 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
153
153
|
FWEventName.AppLanguageUpdated,
|
|
154
154
|
() => {
|
|
155
155
|
FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');
|
|
156
|
-
|
|
156
|
+
if (Platform.OS === 'android') {
|
|
157
|
+
forceUpdate();
|
|
158
|
+
}
|
|
157
159
|
}
|
|
158
160
|
);
|
|
159
161
|
|
|
@@ -251,45 +253,50 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
251
253
|
};
|
|
252
254
|
|
|
253
255
|
const generateKey = (): string => {
|
|
256
|
+
const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
257
|
+
const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';
|
|
258
|
+
const adBadgeConfiguration =
|
|
259
|
+
FireworkSDK.getInstance().adBadgeConfiguration ?? {};
|
|
260
|
+
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
261
|
+
const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
|
|
262
|
+
const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
|
|
263
|
+
const videoLaunchBehavior =
|
|
264
|
+
FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
|
|
265
|
+
|
|
254
266
|
const {
|
|
255
267
|
source,
|
|
256
268
|
channel = '',
|
|
257
269
|
playlist = '',
|
|
270
|
+
hashtagFilterExpression = '',
|
|
258
271
|
enablePictureInPicture = false,
|
|
259
272
|
adConfiguration,
|
|
260
|
-
hashtagFilterExpression = '',
|
|
261
273
|
} = props;
|
|
262
|
-
|
|
263
|
-
const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
264
|
-
const videoLaunchBehavior =
|
|
265
|
-
FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
|
|
266
|
-
const adBadgeConfiguration =
|
|
267
|
-
FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};
|
|
268
|
-
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
269
|
-
const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
|
|
270
|
-
const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
|
|
271
274
|
const dynamicContentParametersString =
|
|
272
275
|
generateDynamicContentParametersString();
|
|
273
|
-
|
|
276
|
+
|
|
274
277
|
const requiresAds = adConfiguration?.requiresAds ?? false;
|
|
275
278
|
const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;
|
|
276
279
|
const vastAttributesString = generateVastAttributesString();
|
|
277
280
|
|
|
278
|
-
let key = `
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
281
|
+
let key = `gShareBaseURL:${gShareBaseURL}`;
|
|
282
|
+
if (Platform.OS === 'ios') {
|
|
283
|
+
key += `_appLanguage:${appLanguage}`;
|
|
284
|
+
}
|
|
283
285
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
284
286
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
285
287
|
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
288
|
+
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
289
|
+
|
|
290
|
+
key += `_source:${source}`;
|
|
291
|
+
key += `_channel:${channel}`;
|
|
292
|
+
key += `_playlist:${playlist}`;
|
|
286
293
|
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
294
|
+
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
287
295
|
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
288
|
-
|
|
296
|
+
|
|
289
297
|
key += `_requiresAds:${requiresAds}`;
|
|
290
298
|
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
291
299
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
292
|
-
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
293
300
|
|
|
294
301
|
return key;
|
|
295
302
|
};
|
|
@@ -62,6 +62,10 @@ export interface IVideoFeedProps {
|
|
|
62
62
|
* One of three available display modes. Defaults to row.
|
|
63
63
|
*/
|
|
64
64
|
mode?: VideoFeedMode;
|
|
65
|
+
/**
|
|
66
|
+
* Specifies if Picture in Picture is enabled.
|
|
67
|
+
*/
|
|
68
|
+
enablePictureInPicture?: boolean;
|
|
65
69
|
/**
|
|
66
70
|
* Configuration of the feed.
|
|
67
71
|
*/
|
|
@@ -74,10 +78,6 @@ export interface IVideoFeedProps {
|
|
|
74
78
|
* Ad configuration of the feed. Only supported on iOS.
|
|
75
79
|
*/
|
|
76
80
|
adConfiguration?: AdConfiguration;
|
|
77
|
-
/**
|
|
78
|
-
* Specifies if Picture in Picture is enabled.
|
|
79
|
-
*/
|
|
80
|
-
enablePictureInPicture?: boolean;
|
|
81
81
|
/**
|
|
82
82
|
* The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.
|
|
83
83
|
*/
|
|
@@ -177,15 +177,18 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
177
177
|
}
|
|
178
178
|
);
|
|
179
179
|
this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
180
|
+
|
|
181
|
+
if (Platform.OS === 'ios') {
|
|
182
|
+
const subscriptionOfAppLanguageUpdated =
|
|
183
|
+
FireworkSDKModuleEventEmitter.addListener(
|
|
184
|
+
FWEventName.AppLanguageUpdated,
|
|
185
|
+
() => {
|
|
186
|
+
FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');
|
|
187
|
+
this.setState({});
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
this._subscriptions.push(subscriptionOfAppLanguageUpdated);
|
|
191
|
+
}
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
/**
|
|
@@ -208,65 +211,78 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
208
211
|
*/
|
|
209
212
|
render() {
|
|
210
213
|
FWLoggerUtil.log(`VideoFeed render ${JSON.stringify(this.props)}`);
|
|
214
|
+
const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
215
|
+
const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';
|
|
216
|
+
const adBadgeConfiguration =
|
|
217
|
+
FireworkSDK.getInstance().adBadgeConfiguration ?? {};
|
|
218
|
+
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
219
|
+
const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
|
|
220
|
+
const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
|
|
221
|
+
const videoLaunchBehavior =
|
|
222
|
+
FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
|
|
211
223
|
|
|
212
224
|
const {
|
|
213
225
|
source,
|
|
214
226
|
channel = '',
|
|
215
227
|
playlist = '',
|
|
216
228
|
playlistGroup = '',
|
|
229
|
+
hashtagFilterExpression = '',
|
|
217
230
|
mode = 'row',
|
|
218
|
-
adConfiguration,
|
|
219
231
|
enablePictureInPicture = false,
|
|
220
|
-
|
|
232
|
+
adConfiguration,
|
|
233
|
+
videoPlayerConfiguration,
|
|
221
234
|
} = this.props;
|
|
235
|
+
const dynamicContentParametersString =
|
|
236
|
+
this._generateDynamicContentParametersString();
|
|
237
|
+
|
|
222
238
|
const videoFeedConfiguration = this._getVideoFeedConfiguration();
|
|
223
239
|
const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;
|
|
224
240
|
const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';
|
|
225
|
-
const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
226
|
-
const adBadgeConfiguration =
|
|
227
|
-
FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};
|
|
228
|
-
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
229
|
-
const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
|
|
230
|
-
const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
|
|
231
|
-
const dynamicContentParametersString =
|
|
232
|
-
this._generateDynamicContentParametersString();
|
|
233
241
|
const enableAutoplay = videoFeedConfiguration?.enableAutoplay ?? false;
|
|
234
|
-
|
|
235
242
|
const gridColumns = videoFeedConfiguration?.gridColumns ?? 2;
|
|
243
|
+
const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;
|
|
244
|
+
|
|
245
|
+
const shareBaseURL = videoPlayerConfiguration?.shareBaseURL ?? '';
|
|
246
|
+
|
|
236
247
|
const requiresAds = adConfiguration?.requiresAds ?? false;
|
|
237
248
|
const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;
|
|
238
249
|
const vastAttributesString = this._generateVastAttributesString();
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
250
|
+
|
|
251
|
+
let key = `gShareBaseURL:${gShareBaseURL}`;
|
|
252
|
+
if (Platform.OS === 'ios') {
|
|
253
|
+
key += `_appLanguage:${appLanguage}`;
|
|
254
|
+
}
|
|
255
|
+
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
256
|
+
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
257
|
+
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
258
|
+
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
259
|
+
|
|
260
|
+
key += `_source:${source}`;
|
|
244
261
|
key += `_channel:${channel}`;
|
|
245
262
|
key += `_playlist:${playlist}`;
|
|
246
263
|
key += `_playlistGroup:${playlistGroup}`;
|
|
264
|
+
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
265
|
+
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
247
266
|
key += `_mode:${mode}`;
|
|
267
|
+
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
268
|
+
|
|
248
269
|
key += `_titleHidden:${titleHidden}`;
|
|
249
270
|
key += `_titlePosition:${titlePosition}`;
|
|
250
|
-
key += `_gShareBaseURL:${gShareBaseURL}`;
|
|
251
|
-
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
252
|
-
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
253
|
-
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
254
|
-
key += `_dynamicContentParameters:${dynamicContentParametersString}`;
|
|
255
271
|
key += `_enableAutoplay:${enableAutoplay}`;
|
|
256
|
-
key += `_enablePictureInPicture:${enablePictureInPicture}`;
|
|
257
272
|
key += `_gridColumns:${gridColumns}`;
|
|
273
|
+
key += `_showAdBadge:${showAdBadge}`;
|
|
274
|
+
|
|
275
|
+
key += `_shareBaseURL:${shareBaseURL}`;
|
|
276
|
+
|
|
258
277
|
key += `_requiresAds:${requiresAds}`;
|
|
259
278
|
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
260
279
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
261
|
-
key += `_showAdBadge:${showAdBadge}`;
|
|
262
|
-
key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
|
|
263
|
-
key += `_appLanguage:${appLanguage}`;
|
|
264
|
-
key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
|
|
265
280
|
|
|
266
281
|
return (
|
|
267
282
|
<FWVideoFeed
|
|
268
283
|
key={key}
|
|
269
284
|
{...this.props}
|
|
285
|
+
videoFeedConfiguration={videoFeedConfiguration}
|
|
270
286
|
ref={this._nativeComponentRef}
|
|
271
287
|
onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}
|
|
272
288
|
mode={mode}
|
|
@@ -43,4 +43,11 @@ export default interface FeedItemDetails {
|
|
|
43
43
|
* The dynamic content parameters of the feed. The property has value when the source is dynamicContent.
|
|
44
44
|
*/
|
|
45
45
|
dynamicContentParameters?: { [key: string]: string[] } | null;
|
|
46
|
+
/**
|
|
47
|
+
* Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
|
|
48
|
+
* Queries are specified with boolean predicates on what hashtags are there on the video.
|
|
49
|
+
* For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
|
|
50
|
+
* Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
|
|
51
|
+
*/
|
|
52
|
+
hashtagFilterExpression?: string;
|
|
46
53
|
}
|