react-native-firework-sdk 1.2.1 → 1.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/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +6 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +18 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWDataUtils.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +1 -6
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +24 -9
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/typescript/components/VideoFeed.d.ts +5 -5
- package/lib/typescript/models/FeedItemDetails.d.ts +25 -3
- package/package.json +1 -1
- package/src/components/VideoFeed.tsx +5 -8
- package/src/models/FeedItemDetails.ts +23 -3
|
@@ -7,6 +7,11 @@ import kotlinx.android.parcel.Parcelize
|
|
|
7
7
|
data class FWVideoFeedItemDetailsModel(
|
|
8
8
|
val index: Int?,
|
|
9
9
|
val id: String?,
|
|
10
|
-
val
|
|
10
|
+
val duration: Int?,
|
|
11
11
|
val source: String?,
|
|
12
|
+
val title: String?,
|
|
13
|
+
val playlistGroup: String?,
|
|
14
|
+
val playlist: String?,
|
|
15
|
+
val channel: String?,
|
|
16
|
+
val dynamicContentParameters: HashMap<String, List<String>>?,
|
|
12
17
|
) : Parcelable
|
package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt
CHANGED
|
@@ -43,7 +43,15 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
|
|
|
43
43
|
videoFeedView?.addOnItemClickedListener(object: OnItemClickedListener {
|
|
44
44
|
override fun onItemClicked(index: Int, title: String, id: String, videoDuration: Long) {
|
|
45
45
|
val fwVideoFeedItemDetailsModel = FWVideoFeedItemDetailsModel(
|
|
46
|
-
index,
|
|
46
|
+
index,
|
|
47
|
+
id,
|
|
48
|
+
videoDuration.toInt(),
|
|
49
|
+
videoFeed.videoFeedPropsModel.source,
|
|
50
|
+
title,
|
|
51
|
+
videoFeed.videoFeedPropsModel.playlistGroup,
|
|
52
|
+
videoFeed.videoFeedPropsModel.playlist,
|
|
53
|
+
videoFeed.videoFeedPropsModel.channel,
|
|
54
|
+
videoFeed.videoFeedPropsModel.dynamicContentParameters
|
|
47
55
|
)
|
|
48
56
|
FWEventUtils.sendVideoFeedClickEvent(reactContext, fwVideoFeedItemDetailsModel)
|
|
49
57
|
}
|
|
@@ -80,7 +88,15 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
|
|
|
80
88
|
playlistGroupFeedView?.itemClickHandler = object : OnPlaylistGroupItemClickedListener {
|
|
81
89
|
override fun onItemClicked(index: Int, id: String?): Boolean {
|
|
82
90
|
val fwVideoFeedItemDetailsModel = FWVideoFeedItemDetailsModel(
|
|
83
|
-
index,
|
|
91
|
+
index,
|
|
92
|
+
id,
|
|
93
|
+
0,
|
|
94
|
+
videoFeed?.videoFeedPropsModel?.source,
|
|
95
|
+
"",
|
|
96
|
+
videoFeed?.videoFeedPropsModel?.playlistGroup,
|
|
97
|
+
videoFeed?.videoFeedPropsModel?.playlist,
|
|
98
|
+
videoFeed?.videoFeedPropsModel?.channel,
|
|
99
|
+
videoFeed?.videoFeedPropsModel?.dynamicContentParameters
|
|
84
100
|
)
|
|
85
101
|
FWEventUtils.sendVideoFeedClickEvent(reactContext, fwVideoFeedItemDetailsModel)
|
|
86
102
|
return false
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.reactnative.utils
|
|
2
2
|
import com.facebook.react.bridge.*
|
|
3
|
+
import com.fireworksdk.bridge.utils.FWJsonUtils
|
|
3
4
|
import org.json.JSONArray
|
|
4
5
|
import org.json.JSONException
|
|
5
6
|
import org.json.JSONObject
|
|
6
7
|
|
|
8
|
+
inline fun <reified T : Any> T.asMap(): WritableMap {
|
|
9
|
+
val jsonString = FWJsonUtils.toJson(this)
|
|
10
|
+
val jsonObject = JSONObject(jsonString)
|
|
11
|
+
return FWDataUtils.convertJsonObjectToWritableMap(jsonObject)?: Arguments.createMap()
|
|
12
|
+
}
|
|
7
13
|
|
|
8
14
|
object FWDataUtils {
|
|
9
15
|
|
|
@@ -61,12 +61,7 @@ object FWEventUtils {
|
|
|
61
61
|
|
|
62
62
|
fun sendVideoFeedClickEvent(reactContext: ReactContext, info: FWVideoFeedItemDetailsModel) {
|
|
63
63
|
val eventMap = Arguments.createMap()
|
|
64
|
-
|
|
65
|
-
contentMap.putInt("index", info.index?:0)
|
|
66
|
-
contentMap.putString("id", info.id)
|
|
67
|
-
contentMap.putInt("duration", info.videoDuration?:0)
|
|
68
|
-
contentMap.putString("source", info.source)
|
|
69
|
-
eventMap.putMap("info", contentMap)
|
|
64
|
+
eventMap.putMap("info", info.asMap())
|
|
70
65
|
sendEvent(reactContext, FWEventName.VideoFeedClick.rawValue, eventMap)
|
|
71
66
|
}
|
|
72
67
|
|
|
@@ -55,25 +55,40 @@ extension VideoFeedError {
|
|
|
55
55
|
|
|
56
56
|
extension FeedEventDetails {
|
|
57
57
|
var jsObject: [String: Any] {
|
|
58
|
+
var result: [String: Any] = [
|
|
59
|
+
"index": index,
|
|
60
|
+
"id": id,
|
|
61
|
+
"duration": duration,
|
|
62
|
+
]
|
|
63
|
+
if let title = caption {
|
|
64
|
+
result["title"] = title
|
|
65
|
+
}
|
|
66
|
+
|
|
58
67
|
var sourceStr: String = ""
|
|
59
68
|
switch(source) {
|
|
60
69
|
case .discover:
|
|
61
70
|
sourceStr = "discover"
|
|
62
|
-
case .channel(channelID:
|
|
71
|
+
case .channel(channelID: let channelID):
|
|
63
72
|
sourceStr = "channel"
|
|
64
|
-
|
|
73
|
+
result["channel"] = channelID
|
|
74
|
+
case .channelPlaylist(channelID: let channelID, playlistID: let playlistID):
|
|
65
75
|
sourceStr = "playlist"
|
|
66
|
-
|
|
76
|
+
result["channel"] = channelID
|
|
77
|
+
result["playlist"] = playlistID
|
|
78
|
+
case .playlistGroup(groupID: let playlistGroupID):
|
|
67
79
|
sourceStr = "playlistGroup"
|
|
80
|
+
result["playlistGroup"] = playlistGroupID
|
|
81
|
+
case .dynamicContent(channelID: let channelID, parameters: let parameters):
|
|
82
|
+
sourceStr = "dynamicContent"
|
|
83
|
+
result["channel"] = channelID
|
|
84
|
+
result["dynamicContentParameters"] = parameters
|
|
68
85
|
default:
|
|
69
86
|
break
|
|
70
87
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"source": sourceStr
|
|
76
|
-
]
|
|
88
|
+
|
|
89
|
+
result["source"] = sourceStr;
|
|
90
|
+
|
|
91
|
+
return result
|
|
77
92
|
}
|
|
78
93
|
}
|
|
79
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","nativeNodeHandle","nativeComponentRef","current","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","FireworkSDK","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;;;;AAAA;;AAGA;;AAQA;;AAEA;;A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AACA,UAAIL,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AAjIqE;;;;gBAAnDhE,S,kBACG;AACpBsC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\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 VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of three available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.\n */\n channel?: string;\n /**\n * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n\n /**\n * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n\n /**\n * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\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"]}
|
|
1
|
+
{"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","nativeNodeHandle","nativeComponentRef","current","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","FireworkSDK","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;;;;AAAA;;AAGA;;AAQA;;AAEA;;AAIA;;AACA;;;;;;;;AAoDA,MAAMA,mBAAmB,GAAG,aAA5B;;AAEe,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDD,eAAME,SAAN,EALiD;;AAAA,2CAO/B,EAP+B;;AAAA,qCAYrD,MAAM;AACrB,YAAMC,gBAAgB,GAAG,iCAAe,KAAKC,kBAAL,CAAwBC,OAAvC,CAAzB;;AAEAC,6BAAUC,0BAAV,CACE,iCAAeJ,gBAAf,CADF,EAEEG,uBAAUE,oBAAV,CAA+BV,mBAA/B,EAAoDW,QAApD,CAA6DC,OAF/D,EAGE,EAHF;AAKD,KApBqE;;AAAA,sDAuBpEC,KADiC,IAE9B;AACH,YAAM;AAAEC,QAAAA,IAAF;AAAQC,QAAAA;AAAR,UAAmBF,KAAK,CAACG,WAA/B;;AACA,UAAI,KAAKC,KAAL,CAAWC,uBAAf,EAAwC;AACtC,YAAIJ,IAAJ,EAAU;AACR,eAAKG,KAAL,CAAWC,uBAAX,CAAmC;AAAEJ,YAAAA,IAAF;AAAQC,YAAAA;AAAR,WAAnC;AACD,SAFD,MAEO;AACL,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C,KAAL,CAAW6C,KAA7B,EAAoC;AAAEC,QAAAA,MAAM,EAAE,CAAC;AAAX,OAApC;AANT,OADF;AAUD;;AAEON,EAAAA,uCAAuC,GAAW;AACxD,UAAM;AAAEO,MAAAA;AAAF,QAA+B,KAAK/C,KAA1C;;AACA,QAAI,CAAC+C,wBAAL,EAA+B;AAC7B,aAAO,EAAP;AACD;;AAED,QAAIC,YAAY,GAAG,EAAnB;AACA,UAAMC,aAAa,GAAGN,MAAM,CAACO,IAAP,CAAYH,wBAAZ,EAAsCI,IAAtC,EAAtB;;AACA,SAAK,MAAMV,GAAX,IAAkBQ,aAAlB,EAAiC;AAC/B,YAAMlC,KAAK,GAAGgC,wBAAwB,CAACN,GAAD,CAAtC;AACA,YAAMW,WAAW,GAAGrC,KAAK,CAACsC,IAAN,CAAW,GAAX,CAApB;;AACA,UAAIL,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AAjIqE;;;;gBAAnDhE,S,kBACG;AACpBsC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\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 VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\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.\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.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","nativeNodeHandle","nativeComponentRef","current","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAEEC,cAFF,EAIEC,SAJF,QAMO,cANP;AAQA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,WAAP,MAAwB,eAAxB;A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WAAW,GAAGpC,KAAK,CAACqC,IAAN,CAAW,GAAX,CAApB;;AACA,UAAIL,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AAjIqE;;gBAAnD3D,S,kBACG;AACpBkC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\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 VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of three available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.\n */\n channel?: string;\n /**\n * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n\n /**\n * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n\n /**\n * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\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"]}
|
|
1
|
+
{"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","nativeNodeHandle","nativeComponentRef","current","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAEEC,cAFF,EAIEC,SAJF,QAMO,cANP;AAQA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAoDA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA,eAAe,MAAMC,SAAN,SAAwBR,KAAK,CAACS,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDT,KAAK,CAACU,SAAN,EALiD;;AAAA,2CAO/B,EAP+B;;AAAA,qCAYrD,MAAM;AACrB,YAAMC,gBAAgB,GAAGV,cAAc,CAAC,KAAKW,kBAAL,CAAwBC,OAAzB,CAAvC;AAEAX,MAAAA,SAAS,CAACY,0BAAV,CACEb,cAAc,CAACU,gBAAD,CADhB,EAEET,SAAS,CAACa,oBAAV,CAA+BR,mBAA/B,EAAoDS,QAApD,CAA6DC,OAF/D,EAGE,EAHF;AAKD,KApBqE;;AAAA,sDAuBpEC,KADiC,IA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I,IAAAA,GAAG,IAAK,6BAA4BF,8BAA+B,EAAnE;AAEA,wBACE,oBAAC,WAAD;AACE,MAAA,GAAG,EAAEE;AADP,OAEM,KAAKtC,KAFX;AAGE,MAAA,GAAG,EAAE,KAAKV,kBAHZ;AAIE,MAAA,uBAAuB,EAAE,KAAKiD,wBAJhC;AAKE,MAAA,IAAI,EAAEnB,IALR;AAME,MAAA,KAAK,EAAEoB,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,KAAKzC,KAAL,CAAW0C,KAA7B,EAAoC;AAAEC,QAAAA,MAAM,EAAE,CAAC;AAAX,OAApC;AANT,OADF;AAUD;;AAEON,EAAAA,uCAAuC,GAAW;AACxD,UAAM;AAAEO,MAAAA;AAAF,QAA+B,KAAK5C,KAA1C;;AACA,QAAI,CAAC4C,wBAAL,EAA+B;AAC7B,aAAO,EAAP;AACD;;AAED,QAAIC,YAAY,GAAG,EAAnB;AACA,UAAMC,aAAa,GAAGN,MAAM,CAACO,IAAP,CAAYH,wBAAZ,EAAsCI,IAAtC,EAAtB;;AACA,SAAK,MAAMV,GAAX,IAAkBQ,aAAlB,EAAiC;AAC/B,YAAMjC,KAAK,GAAG+B,wBAAwB,CAACN,GAAD,CAAtC;AACA,YAAMW,WAAW,GAAGpC,KAAK,CAACqC,IAAN,CAAW,GAAX,CAApB;;AACA,UAAIL,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AAjIqE;;gBAAnD3D,S,kBACG;AACpBkC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\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 VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\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.\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.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\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"]}
|
|
@@ -11,23 +11,23 @@ export interface IVideoFeedProps {
|
|
|
11
11
|
*/
|
|
12
12
|
style?: StyleProp<ViewStyle>;
|
|
13
13
|
/**
|
|
14
|
-
* One of
|
|
14
|
+
* One of five available video feed sources.
|
|
15
15
|
*/
|
|
16
16
|
source: VideoFeedSource;
|
|
17
17
|
/**
|
|
18
|
-
* Channel
|
|
18
|
+
* Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.
|
|
19
19
|
*/
|
|
20
20
|
channel?: string;
|
|
21
21
|
/**
|
|
22
|
-
* Playlist
|
|
22
|
+
* Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.
|
|
23
23
|
*/
|
|
24
24
|
playlist?: string;
|
|
25
25
|
/**
|
|
26
|
-
* PlaylistGroup
|
|
26
|
+
* PlaylistGroup id of the feed. Required when the source is set as playlistGroup.
|
|
27
27
|
*/
|
|
28
28
|
playlistGroup?: string;
|
|
29
29
|
/**
|
|
30
|
-
* The
|
|
30
|
+
* The dynamic content parameters of the feed. Required when the source is set as dynamicContent.
|
|
31
31
|
*/
|
|
32
32
|
dynamicContentParameters?: {
|
|
33
33
|
[key: string]: string[];
|
|
@@ -6,16 +6,38 @@ export default interface FeedItemDetails {
|
|
|
6
6
|
index: number;
|
|
7
7
|
/**
|
|
8
8
|
* The unique id of the thumbnail.
|
|
9
|
-
* If the source is
|
|
9
|
+
* If the source is playlistGroup this value will represent the playlist's id; otherwise this value is the id of the selected video.
|
|
10
10
|
*/
|
|
11
11
|
id: string;
|
|
12
12
|
/**
|
|
13
13
|
* The total duration of the video.
|
|
14
|
-
* If the source is
|
|
14
|
+
* If the source is playlistGroup this value will always be 0; otherwise this value is the duration of the selected video.
|
|
15
15
|
*/
|
|
16
16
|
duration: number;
|
|
17
17
|
/**
|
|
18
|
-
* The
|
|
18
|
+
* The title of the feed item. Currently, the title doesn't have value on the Android side when the source is playlistGroup.
|
|
19
|
+
*/
|
|
20
|
+
title?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* The source of the feed.
|
|
19
23
|
*/
|
|
20
24
|
source: VideoFeedSource;
|
|
25
|
+
/**
|
|
26
|
+
* The channel id of the feed. The property has value when the source is channel or playlist or dynamicContent.
|
|
27
|
+
*/
|
|
28
|
+
channel?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Playlist id of the feed. The property has value when the source is playlist.
|
|
31
|
+
*/
|
|
32
|
+
playlist?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Playlist group id of the feed. The property has value when the source is playlistGroup.
|
|
35
|
+
*/
|
|
36
|
+
playlistGroup?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* The dynamic content parameters of the feed. The property has value when the source is dynamicContent.
|
|
39
|
+
*/
|
|
40
|
+
dynamicContentParameters?: {
|
|
41
|
+
[key: string]: string[];
|
|
42
|
+
} | null;
|
|
21
43
|
}
|
package/package.json
CHANGED
|
@@ -26,28 +26,25 @@ export interface IVideoFeedProps {
|
|
|
26
26
|
*/
|
|
27
27
|
style?: StyleProp<ViewStyle>;
|
|
28
28
|
/**
|
|
29
|
-
* One of
|
|
29
|
+
* One of five available video feed sources.
|
|
30
30
|
*/
|
|
31
31
|
source: VideoFeedSource;
|
|
32
32
|
/**
|
|
33
|
-
* Channel
|
|
33
|
+
* Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.
|
|
34
34
|
*/
|
|
35
35
|
channel?: string;
|
|
36
36
|
/**
|
|
37
|
-
* Playlist
|
|
37
|
+
* Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.
|
|
38
38
|
*/
|
|
39
39
|
playlist?: string;
|
|
40
|
-
|
|
41
40
|
/**
|
|
42
|
-
* PlaylistGroup
|
|
41
|
+
* PlaylistGroup id of the feed. Required when the source is set as playlistGroup.
|
|
43
42
|
*/
|
|
44
43
|
playlistGroup?: string;
|
|
45
|
-
|
|
46
44
|
/**
|
|
47
|
-
* The
|
|
45
|
+
* The dynamic content parameters of the feed. Required when the source is set as dynamicContent.
|
|
48
46
|
*/
|
|
49
47
|
dynamicContentParameters?: { [key: string]: string[] };
|
|
50
|
-
|
|
51
48
|
/**
|
|
52
49
|
* One of three available display modes. Defaults to row.
|
|
53
50
|
*/
|
|
@@ -7,16 +7,36 @@ export default interface FeedItemDetails {
|
|
|
7
7
|
index: number;
|
|
8
8
|
/**
|
|
9
9
|
* The unique id of the thumbnail.
|
|
10
|
-
* If the source is
|
|
10
|
+
* If the source is playlistGroup this value will represent the playlist's id; otherwise this value is the id of the selected video.
|
|
11
11
|
*/
|
|
12
12
|
id: string;
|
|
13
13
|
/**
|
|
14
14
|
* The total duration of the video.
|
|
15
|
-
* If the source is
|
|
15
|
+
* If the source is playlistGroup this value will always be 0; otherwise this value is the duration of the selected video.
|
|
16
16
|
*/
|
|
17
17
|
duration: number;
|
|
18
18
|
/**
|
|
19
|
-
* The
|
|
19
|
+
* The title of the feed item. Currently, the title doesn't have value on the Android side when the source is playlistGroup.
|
|
20
|
+
*/
|
|
21
|
+
title?: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The source of the feed.
|
|
20
24
|
*/
|
|
21
25
|
source: VideoFeedSource;
|
|
26
|
+
/**
|
|
27
|
+
* The channel id of the feed. The property has value when the source is channel or playlist or dynamicContent.
|
|
28
|
+
*/
|
|
29
|
+
channel?: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Playlist id of the feed. The property has value when the source is playlist.
|
|
32
|
+
*/
|
|
33
|
+
playlist?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Playlist group id of the feed. The property has value when the source is playlistGroup.
|
|
36
|
+
*/
|
|
37
|
+
playlistGroup?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* The dynamic content parameters of the feed. The property has value when the source is dynamicContent.
|
|
40
|
+
*/
|
|
41
|
+
dynamicContentParameters?: { [key: string]: string[] } | null;
|
|
22
42
|
}
|