react-native-firework-sdk 2.1.0 → 2.2.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.
- package/FireworkVideoUI.xcframework/Info.plist +40 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +280 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +556 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -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/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +245 -0
- package/README.md +1 -1
- package/android/build.gradle +1 -2
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +3 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +10 -6
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +14 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +11 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +8 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +19 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductDeserializer.kt +11 -11
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +5 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +5 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +45 -4
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +112 -36
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +7 -4
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +26 -32
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +6 -0
- package/ios/Components/StoryBlock.swift +5 -6
- package/ios/Components/StoryBlockManager.m +1 -0
- package/ios/Components/StoryBlockManager.swift +4 -0
- package/ios/Components/VideoFeed.swift +12 -8
- package/ios/Components/VideoFeedManager.m +1 -0
- package/ios/Components/VideoFeedManager.swift +4 -0
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +261 -471
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +13 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +18 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +147 -0
- package/ios/{Utils/AppLanguage/Bundle+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift} +7 -7
- package/ios/{Utils/AppLanguage/NumberFormatter+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift} +5 -5
- package/ios/{Utils/AppLanguage/URLSession+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift} +7 -7
- package/ios/{Utils/AppLanguage/UIImageView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift} +8 -8
- package/ios/{Utils/AppLanguage/UILabel+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift} +17 -17
- package/ios/{Utils/AppLanguage/UITextField+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift} +16 -16
- package/ios/{Utils/AppLanguage/UITextView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift} +16 -16
- package/ios/{Utils/AppLanguage/UIView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift} +7 -7
- package/ios/{Utils/AppLanguage/UIViewController+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift} +19 -5
- package/ios/{Utils/AppLanguage/UIWindow+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift} +5 -5
- package/ios/{Utils/AppLanguage/FWLanguageUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift} +4 -4
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +42 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +160 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +35 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +199 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +59 -0
- package/ios/{Utils/Extensions/DispatchQueue+FWOnce.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift} +4 -4
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +18 -0
- package/ios/{Utils/Extensions/UIView+FWUIHierarchy.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift} +4 -5
- package/ios/{Utils/FWSwizzleUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift} +2 -2
- package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +766 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +37 -0
- package/ios/FireworkVideoUI/Podfile +15 -0
- package/ios/FireworkVideoUI/Podfile.lock +16 -0
- package/ios/Models/NativeToRN/FireworkEventName.swift +4 -0
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +5 -1
- package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +8 -100
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +34 -16
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +23 -7
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +0 -1
- package/ios/Modules/LiveStream/LiveStreamModule.swift +1 -0
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +0 -8
- package/ios/Modules/Shopping/ShoppingModule.swift +0 -18
- package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +4 -6
- package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +4 -1
- package/ios/scripts/react_native_firework_sdk_pods.rb +22 -26
- package/lib/commonjs/FireworkSDK.js +40 -17
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +2 -2
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +1 -1
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +9 -9
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +6 -4
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWEventName.js +1 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/VideoPlaybackEventName.js +3 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/module/FireworkSDK.js +39 -17
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +2 -2
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +1 -1
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +9 -7
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +6 -4
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWEventName.js +1 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/VideoPlaybackEventName.js +3 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +8 -4
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +1 -1
- package/lib/typescript/components/StoryBlock.d.ts +7 -0
- package/lib/typescript/components/VideoFeed.d.ts +7 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/models/FWEventName.d.ts +1 -0
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +0 -31
- package/lib/typescript/models/SDKInitOptions.d.ts +6 -1
- package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +16 -0
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +13 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +4 -0
- package/package.json +7 -2
- package/react-native-firework-sdk.podspec +10 -5
- package/src/FireworkSDK.ts +41 -15
- package/src/LiveStream.ts +2 -2
- package/src/VideoShopping.ts +1 -1
- package/src/components/StoryBlock.tsx +12 -3
- package/src/components/VideoFeed.tsx +12 -4
- package/src/index.ts +0 -2
- package/src/models/FWEventName.ts +1 -0
- package/src/models/ProductInfoViewConfiguration.ts +0 -32
- package/src/models/SDKInitOptions.ts +6 -1
- package/src/models/StoryBlockSource.ts +2 -1
- package/src/models/VideoFeedSource.ts +2 -1
- package/src/models/VideoPlaybackDetails.ts +16 -0
- package/src/models/VideoPlaybackEventName.ts +13 -1
- package/src/models/VideoPlayerConfiguration.ts +4 -0
- package/ios/Utils/AppLanguage/FWAppLanguageManager.swift +0 -139
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.h +0 -25
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.m +0 -75
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.h +0 -21
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.m +0 -124
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.h +0 -11
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.m +0 -86
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.h +0 -16
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.m +0 -55
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.h +0 -18
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.m +0 -39
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.h +0 -54
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.m +0 -141
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.h +0 -16
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.m +0 -20
- package/ios/Utils/FWRTL/Classes/Utils/FWRTLDefinitions.h +0 -52
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.h +0 -19
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.m +0 -49
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.h +0 -21
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.m +0 -38
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.h +0 -18
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.m +0 -43
- /package/ios/Support/MultiHostStreaming/{src → Sources}/MultiHostStreamingSDK.swift +0 -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","videoFeedConfiguration","_getVideoFeedConfiguration","titleHidden","title","hidden","titlePosition","shareBaseURL","getInstance","getShareBaseURL","adBadgeConfiguration","getAdBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","enableAutoplay","gridColumns","requiresAds","adsFetchTimeout","vastAttributesString","_generateVastAttributesString","showAdBadge","videoLaunchBehavior","getVideoLaunchBehavior","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;AA0DA,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,CAACC,SAAL,CAAe,KAAKC,KAApB,CAA2B,EAAjE;AAEA,YAAMC,gBAAgB,GAAGhB,cAAc,CAAC,KAAKiB,mBAAL,CAAyBC,OAA1B,CAAvC;AAEA,UAAIC,SAA0B,GAC5BjB,SAAS,CAACkB,oBAAV,CAA+BZ,mBAA/B,EAAoDa,QAApD,CAA6DC,OAD/D;;AAEA,UAAIrB,QAAQ,CAACsB,EAAT,KAAgB,SAApB,EAA+B;AAC7BJ,QAAAA,SAAS,GAAGA,SAAS,CAACK,QAAV,EAAZ;AACD;;AAEDtB,MAAAA,SAAS,CAACuB,0BAAV,CACEzB,cAAc,CAACgB,gBAAD,CADhB,EAEEG,SAFF,EAGE,EAHF;AAKD,KA5BsD;;AAAA,sDA8BnBO,KAAD,IAAsC;AACvEpB,MAAAA,YAAY,CAACM,GAAb,CACG,sCAAqCC,IAAI,CAACC,SAAL,CAAeY,KAAK,CAACC,WAArB,CAAkC,EAD1E;AAGA,YAAM;AAAEC,QAAAA;AAAF,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EOnC,EAAAA,0BAA0B,GAAuC;AACvE,UAAM;AAAED,MAAAA;AAAF,QAA6B,KAAKzC,KAAxC;;AACA,QAAI,CAACyC,sBAAL,EAA6B;AAC3B,aAAOA,sBAAP;AACD;;AAED,QACEA,sBAAsB,CAACoB,WAAvB,IACAyB,IAAI,CAACC,KAAL,CAAW9C,sBAAsB,CAACoB,WAAlC,MACEpB,sBAAsB,CAACoB,WAH3B,EAIE;AACA,aAAO,EACL,GAAGpB,sBADE;AAELoB,QAAAA,WAAW,EAAEyB,IAAI,CAACC,KAAL,CAAW9C,sBAAsB,CAACoB,WAAlC;AAFR,OAAP;AAID,KATD,MASO;AACL,aAAOpB,sBAAP;AACD;AACF;;AAlPsD;;gBAAnD/C,S,kBAIkB;AACpB4C,EAAAA,IAAI,EAAE;AADc,C;;AAiPxB,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 * 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 } = this.props;\n const videoFeedConfiguration = this._getVideoFeedConfiguration();\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const shareBaseURL = FireworkSDK.getInstance().getShareBaseURL() ?? '';\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().getVideoLaunchBehavior() ?? 'default';\n const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';\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 += `_shareBaseURL:${shareBaseURL}`;\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\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","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,MAAMC,SAAN,SAAwBV,KAAK,CAACW,SAA9B,CAAyD;AAAA;AAAA;;AAAA,8DAQzBX,KAAK,CAACY,SAAN,EARyB;;AAAA,4CAUP,EAVO;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AIkB;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"]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -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;AAwBA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;
|
|
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;AAwBA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;AA0BA,OAAOC,sBAAP,MAAmC,iCAAnC;AAeA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,eAAeN,WAAf;AAEA,SAWEA,WAXF,EAaEC,WAbF,EAqBEC,UArBF,EAuBEC,uBAvBF,EA0BEC,mBA1BF,EA2CEN,UA3CF,EAiDEC,SAjDF,EA+DEM,sBA/DF,EAuEEC,aAvEF","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 FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\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 Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedContentPadding,\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 VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCompleteAction,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerStyle,\n} from './models/VideoPlayerConfiguration';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\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 CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\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 Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedContentPadding,\n VideoFeedMode,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
|
|
@@ -15,6 +15,7 @@ export let FWEventName;
|
|
|
15
15
|
FWEventName["VideoLaunchBehaviorUpdated"] = "fw:video-launch-behavior-updated";
|
|
16
16
|
FWEventName["AdBadgeConfigurationUpdated"] = "fw:ad-badge-configuration-updated";
|
|
17
17
|
FWEventName["AppLanguageUpdated"] = "fw:app-language-updated";
|
|
18
|
+
FWEventName["NativeAppLanguageUpdated"] = "fw:native-app-language-updated";
|
|
18
19
|
FWEventName["LogMessage"] = "fw:log-message";
|
|
19
20
|
FWEventName["CustomLinkButtonClick"] = "fw:shopping:custom-link-button-click";
|
|
20
21
|
})(FWEventName || (FWEventName = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":"AAAA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ShoppingCTAButtonClick = 'fw:shopping:cta-button-click',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n AppLanguageUpdated = 'fw:app-language-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["FWEventName.ts"],"names":["FWEventName"],"mappings":"AAAA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["export enum FWEventName {\n SDKInit = 'fw:sdk-init',\n CustomCTAClick = 'fw:custom-cta-click',\n VideoPlayback = 'fw:video-playback',\n VideoFeedClick = 'fw:video-feed-click',\n AddToCart = 'fw:shopping:add-to-cart',\n ShoppingCTAButtonClick = 'fw:shopping:cta-button-click',\n ClickCartIcon = 'fw:shopping:click-cart-icon',\n UpdateProductDetails = 'fw:shopping:update-product-details',\n LiveStream = 'fw:livestream',\n LiveStreamChat = 'fw:livestream-chat',\n ShareBaseURLUpdated = 'fw:share-base-url-updated',\n VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',\n AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',\n AppLanguageUpdated = 'fw:app-language-updated',\n NativeAppLanguageUpdated = 'fw:native-app-language-updated',\n LogMessage = 'fw:log-message',\n CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',\n}\n"]}
|
|
@@ -3,10 +3,13 @@ var VideoPlaybackEventName;
|
|
|
3
3
|
(function (VideoPlaybackEventName) {
|
|
4
4
|
VideoPlaybackEventName["Impression"] = "fw:video:impression";
|
|
5
5
|
VideoPlaybackEventName["Start"] = "fw:video:start";
|
|
6
|
+
VideoPlaybackEventName["Pause"] = "fw:video:pause";
|
|
7
|
+
VideoPlaybackEventName["Resume"] = "fw:video:resume";
|
|
6
8
|
VideoPlaybackEventName["FirstQuartile"] = "fw:video:first-quartile";
|
|
7
9
|
VideoPlaybackEventName["Midpoint"] = "fw:video:midpoint";
|
|
8
10
|
VideoPlaybackEventName["ThirdQuartile"] = "fw:video:third-quartile";
|
|
9
11
|
VideoPlaybackEventName["Complete"] = "fw:video:complete";
|
|
12
|
+
VideoPlaybackEventName["AdStart"] = "fw:video:ad-start";
|
|
10
13
|
VideoPlaybackEventName["AdEnd"] = "fw:video:ad-end";
|
|
11
14
|
VideoPlaybackEventName["ClickCTA"] = "fw:video:click-cta";
|
|
12
15
|
VideoPlaybackEventName["ClickShare"] = "fw:video:click-share";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["VideoPlaybackEventName.ts"],"names":["VideoPlaybackEventName"],"mappings":"IAAKA,sB;;WAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;GAAAA,sB,KAAAA,sB;;
|
|
1
|
+
{"version":3,"sources":["VideoPlaybackEventName.ts"],"names":["VideoPlaybackEventName"],"mappings":"IAAKA,sB;;WAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;AAAAA,EAAAA,sB;GAAAA,sB,KAAAA,sB;;AAmDL,eAAeA,sBAAf","sourcesContent":["enum VideoPlaybackEventName {\n /**\n * When video is shown to the user.\n */\n Impression = 'fw:video:impression',\n /**\n * Video started.\n */\n Start = 'fw:video:start',\n /**\n * Video paused.\n */\n Pause = 'fw:video:pause',\n /**\n * Video resume.\n */\n Resume = 'fw:video:resume',\n /**\n * Video reached 25%.\n */\n FirstQuartile = 'fw:video:first-quartile',\n /**\n * Video reached 50%.\n */\n Midpoint = 'fw:video:midpoint',\n /**\n * Video reached 75%.\n */\n ThirdQuartile = 'fw:video:third-quartile',\n /**\n * Video reached 100%.\n */\n Complete = 'fw:video:complete',\n /**\n * Ad video started playing.\n */\n AdStart = 'fw:video:ad-start',\n /**\n * Ad video completed playing.\n */\n AdEnd = 'fw:video:ad-end',\n /**\n * When a visitor clicks on CTA button (if available).\n */\n ClickCTA = 'fw:video:click-cta',\n /**\n * When user clicks on \"Share\" button.\n */\n ClickShare = 'fw:video:click-share',\n}\n\nexport default VideoPlaybackEventName;\n"]}
|
|
@@ -31,15 +31,17 @@ declare class FireworkSDK {
|
|
|
31
31
|
set onCustomCTAClick(value: CustomCTAClickCallback | undefined);
|
|
32
32
|
private _onCustomCTAClick;
|
|
33
33
|
/**
|
|
34
|
-
* The callback of video playback.
|
|
34
|
+
* The callback of video playback.
|
|
35
35
|
*/
|
|
36
36
|
get onVideoPlayback(): VideoPlaybackCallback | undefined;
|
|
37
37
|
set onVideoPlayback(value: VideoPlaybackCallback | undefined);
|
|
38
38
|
private _onVideoPlayback?;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* The global share base URL of the video.
|
|
41
|
+
* The {@link VideoPlayerConfiguration.shareBaseURL} in {@link VideoPlayerConfiguration} will override this.
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
get shareBaseURL(): string | undefined;
|
|
44
|
+
set shareBaseURL(value: string | undefined);
|
|
43
45
|
private _shareBaseURL;
|
|
44
46
|
/**
|
|
45
47
|
* Get the configuration for ad badges. Only supported on iOS.
|
|
@@ -61,7 +63,7 @@ declare class FireworkSDK {
|
|
|
61
63
|
/**
|
|
62
64
|
* Get video launch behavior.
|
|
63
65
|
*/
|
|
64
|
-
|
|
66
|
+
get videoLaunchBehavior(): VideoLaunchBehavior | undefined;
|
|
65
67
|
private _videoLaunchBehavior;
|
|
66
68
|
private get eventEmitter();
|
|
67
69
|
/**
|
|
@@ -108,5 +110,7 @@ declare class FireworkSDK {
|
|
|
108
110
|
* @returns {Promise<boolean>} The result of changing app language.
|
|
109
111
|
*/
|
|
110
112
|
changeAppLanguage(language?: string | null): Promise<boolean>;
|
|
113
|
+
private updateInternalAppLanguage;
|
|
114
|
+
private updateInternalShareBaseURL;
|
|
111
115
|
}
|
|
112
116
|
export default FireworkSDK;
|
|
@@ -7,11 +7,11 @@ export type onLiveStreamChatEventCallback = (event: LiveStreamChatEvent) => void
|
|
|
7
7
|
declare class LiveStream {
|
|
8
8
|
private static _instance?;
|
|
9
9
|
/**
|
|
10
|
-
* The callback of live stream event.
|
|
10
|
+
* The callback of live stream event.
|
|
11
11
|
*/
|
|
12
12
|
onLiveStreamEvent?: onLiveStreamEventCallback;
|
|
13
13
|
/**
|
|
14
|
-
* The callback of live stream chat event.
|
|
14
|
+
* The callback of live stream chat event.
|
|
15
15
|
*/
|
|
16
16
|
onLiveStreamChatEvent?: onLiveStreamChatEventCallback;
|
|
17
17
|
private get eventEmitter();
|
|
@@ -47,7 +47,7 @@ declare class VideoShopping {
|
|
|
47
47
|
private _productInfoViewConfiguration?;
|
|
48
48
|
/**
|
|
49
49
|
* This callback is triggered when the user clicks
|
|
50
|
-
* the link button next to Add to cart button.
|
|
50
|
+
* the link button next to Add to cart button.
|
|
51
51
|
*
|
|
52
52
|
* The host app can customize the click event processing logic of
|
|
53
53
|
* the link button by setting the callback.
|
|
@@ -39,6 +39,13 @@ export interface IStoryBlockProps {
|
|
|
39
39
|
dynamicContentParameters?: {
|
|
40
40
|
[key: string]: string[];
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
|
|
44
|
+
* Queries are specified with boolean predicates on what hashtags are there on the video.
|
|
45
|
+
* For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
|
|
46
|
+
* Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
|
|
47
|
+
*/
|
|
48
|
+
hashtagFilterExpression?: string;
|
|
42
49
|
/**
|
|
43
50
|
* Specifies if Picture in Picture is enabled. Only supported on iOS.
|
|
44
51
|
*/
|
|
@@ -36,6 +36,13 @@ export interface IVideoFeedProps {
|
|
|
36
36
|
dynamicContentParameters?: {
|
|
37
37
|
[key: string]: string[];
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
|
|
41
|
+
* Queries are specified with boolean predicates on what hashtags are there on the video.
|
|
42
|
+
* For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
|
|
43
|
+
* Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
|
|
44
|
+
*/
|
|
45
|
+
hashtagFilterExpression?: string;
|
|
39
46
|
/**
|
|
40
47
|
* One of three available display modes. Defaults to row.
|
|
41
48
|
*/
|
|
@@ -23,7 +23,7 @@ import LiveStreamEventName from './models/LiveStreamEventName';
|
|
|
23
23
|
import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
|
|
24
24
|
import type Product from './models/Product';
|
|
25
25
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
26
|
-
import type {
|
|
26
|
+
import type { LinkButtonConfiguration, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText } from './models/ProductInfoViewConfiguration';
|
|
27
27
|
import type ProductUnit from './models/ProductUnit';
|
|
28
28
|
import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
|
|
29
29
|
import type SDKInitOptions from './models/SDKInitOptions';
|
|
@@ -42,4 +42,4 @@ import type { VideoPlayerCompleteAction, VideoPlayerCTADelay, VideoPlayerCTADela
|
|
|
42
42
|
import type { CustomClickCartIconCallback, CustomClickLinkButtonCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
|
|
43
43
|
import VideoShopping from './VideoShopping';
|
|
44
44
|
export default FireworkSDK;
|
|
45
|
-
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration,
|
|
45
|
+
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedContentPadding, VideoFeedMode, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
@@ -13,6 +13,7 @@ export declare enum FWEventName {
|
|
|
13
13
|
VideoLaunchBehaviorUpdated = "fw:video-launch-behavior-updated",
|
|
14
14
|
AdBadgeConfigurationUpdated = "fw:ad-badge-configuration-updated",
|
|
15
15
|
AppLanguageUpdated = "fw:app-language-updated",
|
|
16
|
+
NativeAppLanguageUpdated = "fw:native-app-language-updated",
|
|
16
17
|
LogMessage = "fw:log-message",
|
|
17
18
|
CustomLinkButtonClick = "fw:shopping:custom-link-button-click"
|
|
18
19
|
}
|
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated The interface will be removed since RN SDK V2.1.
|
|
4
|
-
* Use {@link ShoppingCTAButtonConfiguration} instead.
|
|
5
|
-
*/
|
|
6
|
-
export interface AddToCartButtonConfiguration {
|
|
7
|
-
/**
|
|
8
|
-
* The background color of "Add to cart" button.
|
|
9
|
-
*/
|
|
10
|
-
backgroundColor?: string;
|
|
11
|
-
/**
|
|
12
|
-
* The text color of "Add to cart" button.
|
|
13
|
-
*/
|
|
14
|
-
textColor?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The font size of "Add to cart" button.
|
|
17
|
-
*/
|
|
18
|
-
fontSize?: number;
|
|
19
|
-
/**
|
|
20
|
-
* The iOS font info of "Add to cart" button.
|
|
21
|
-
* The property is ignored when fontSize is not set.
|
|
22
|
-
* Only supported on iOS.
|
|
23
|
-
*/
|
|
24
|
-
iOSFontInfo?: IOSFontInfo;
|
|
25
|
-
}
|
|
26
2
|
export type ShoppingCTAButtonText = 'addToCart' | 'shopNow';
|
|
27
3
|
export interface ShoppingCTAButtonConfiguration {
|
|
28
4
|
/**
|
|
@@ -51,13 +27,6 @@ export interface LinkButtonConfiguration {
|
|
|
51
27
|
isHidden?: boolean;
|
|
52
28
|
}
|
|
53
29
|
export default interface ProductInfoViewConfiguration {
|
|
54
|
-
/**
|
|
55
|
-
* Configuration of "Add to cart" button. Only supported on iOS.
|
|
56
|
-
*
|
|
57
|
-
* @deprecated The property will be removed since RN SDK V2.1.
|
|
58
|
-
* Use {@link ctaButton} instead.
|
|
59
|
-
*/
|
|
60
|
-
addToCartButton?: AddToCartButtonConfiguration;
|
|
61
30
|
/**
|
|
62
31
|
* Configuration of shopping CTA button. Only supported on iOS.
|
|
63
32
|
*/
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
|
|
2
2
|
export default interface SDKInitOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Custom value to identify the current user.
|
|
5
|
+
*/
|
|
3
6
|
userId?: string;
|
|
4
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Behavior occurring after video is launched.
|
|
9
|
+
*/
|
|
5
10
|
videoLaunchBehavior?: VideoLaunchBehavior;
|
|
6
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent';
|
|
1
|
+
export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent' | 'hashtagPlaylist';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent';
|
|
1
|
+
export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent' | 'hashtagPlaylist';
|
|
@@ -27,4 +27,20 @@ export default interface VideoPlaybackDetails {
|
|
|
27
27
|
* Indicates if the video is associated with a call-to-action (CTA).
|
|
28
28
|
*/
|
|
29
29
|
hasCTA?: boolean | null;
|
|
30
|
+
/**
|
|
31
|
+
* The amount of time the video was playing at the time of the event.
|
|
32
|
+
*/
|
|
33
|
+
progress?: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* The type of the CTA button clicked: "buy" "download" "view" "book".
|
|
36
|
+
*/
|
|
37
|
+
ctaActionType?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* The url of the CTA button clicked.
|
|
40
|
+
*/
|
|
41
|
+
ctaActionURL?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* The associated feed ID
|
|
44
|
+
*/
|
|
45
|
+
feedId?: string | null;
|
|
30
46
|
}
|
|
@@ -7,6 +7,14 @@ declare enum VideoPlaybackEventName {
|
|
|
7
7
|
* Video started.
|
|
8
8
|
*/
|
|
9
9
|
Start = "fw:video:start",
|
|
10
|
+
/**
|
|
11
|
+
* Video paused.
|
|
12
|
+
*/
|
|
13
|
+
Pause = "fw:video:pause",
|
|
14
|
+
/**
|
|
15
|
+
* Video resume.
|
|
16
|
+
*/
|
|
17
|
+
Resume = "fw:video:resume",
|
|
10
18
|
/**
|
|
11
19
|
* Video reached 25%.
|
|
12
20
|
*/
|
|
@@ -24,7 +32,11 @@ declare enum VideoPlaybackEventName {
|
|
|
24
32
|
*/
|
|
25
33
|
Complete = "fw:video:complete",
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
35
|
+
* Ad video started playing.
|
|
36
|
+
*/
|
|
37
|
+
AdStart = "fw:video:ad-start",
|
|
38
|
+
/**
|
|
39
|
+
* Ad video completed playing.
|
|
28
40
|
*/
|
|
29
41
|
AdEnd = "fw:video:ad-end",
|
|
30
42
|
/**
|
|
@@ -69,4 +69,8 @@ export default interface VideoPlayerConfiguration {
|
|
|
69
69
|
* Specifies the delay before the highlight animation occurs. Only supported on iOS.
|
|
70
70
|
*/
|
|
71
71
|
ctaHighlightDelay?: VideoPlayerCTADelay;
|
|
72
|
+
/**
|
|
73
|
+
* The share base URL of the video.
|
|
74
|
+
*/
|
|
75
|
+
shareBaseURL?: string;
|
|
72
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-firework-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Firework React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
"ios",
|
|
14
14
|
"cpp",
|
|
15
15
|
"react-native-firework-sdk.podspec",
|
|
16
|
+
"FireworkVideoUI.xcframework",
|
|
16
17
|
"!lib/typescript/example",
|
|
17
18
|
"!android/build",
|
|
18
19
|
"!ios/build",
|
|
20
|
+
"!ios/FireworkVideoUI/build",
|
|
21
|
+
"!ios/FireworkVideoUI/Pods",
|
|
22
|
+
"!ios/FireworkVideoUI/scripts",
|
|
19
23
|
"!**/__tests__",
|
|
20
24
|
"!**/__fixtures__",
|
|
21
25
|
"!**/__mocks__",
|
|
22
|
-
"!docs/"
|
|
26
|
+
"!docs/",
|
|
27
|
+
"!README_PUBLIC_REPO.md"
|
|
23
28
|
],
|
|
24
29
|
"scripts": {
|
|
25
30
|
"test": "jest",
|
|
@@ -14,10 +14,6 @@ Pod::Spec.new do |s|
|
|
|
14
14
|
s.source = { git: 'https://github.com/loopsocial/bogano.git', tag: "#{s.version}" }
|
|
15
15
|
|
|
16
16
|
s.swift_version = '5.0'
|
|
17
|
-
# s.header_dir = 'ios'
|
|
18
|
-
# s.public_header_files = 'ios/*.h'
|
|
19
|
-
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
20
|
-
s.exclude_files = 'ios/Support/**/*.{h,m,mm,swift}'
|
|
21
17
|
s.script_phase = { name: 'Copy module header files', script: '
|
|
22
18
|
module_header_path="${PODS_TARGET_SRCROOT}/ios/react_native_firework_sdk.h"
|
|
23
19
|
target_header_directory="${PODS_ROOT}/Headers/Public/react_native_firework_sdk/"
|
|
@@ -28,6 +24,15 @@ then
|
|
|
28
24
|
cp -f $module_header_path $target_header_directory
|
|
29
25
|
fi
|
|
30
26
|
', execution_position: :before_compile }
|
|
27
|
+
|
|
28
|
+
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
29
|
+
s.exclude_files = [
|
|
30
|
+
'ios/Support/**/*',
|
|
31
|
+
'ios/FireworkVideoUI/**/*'
|
|
32
|
+
]
|
|
33
|
+
s.preserve_paths = "FireworkVideoUI.xcframework"
|
|
34
|
+
s.vendored_frameworks = "FireworkVideoUI.xcframework"
|
|
35
|
+
|
|
31
36
|
s.dependency 'React-Core'
|
|
32
|
-
s.dependency 'FireworkVideo', '1.
|
|
37
|
+
s.dependency 'FireworkVideo', '1.9.0'
|
|
33
38
|
end
|
package/src/FireworkSDK.ts
CHANGED
|
@@ -57,7 +57,7 @@ class FireworkSDK {
|
|
|
57
57
|
private _onCustomCTAClick: CustomCTAClickCallback | undefined;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* The callback of video playback.
|
|
60
|
+
* The callback of video playback.
|
|
61
61
|
*/
|
|
62
62
|
public get onVideoPlayback(): VideoPlaybackCallback | undefined {
|
|
63
63
|
return this._onVideoPlayback;
|
|
@@ -69,11 +69,17 @@ class FireworkSDK {
|
|
|
69
69
|
private _onVideoPlayback?: VideoPlaybackCallback | undefined;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* The global share base URL of the video.
|
|
73
|
+
* The {@link VideoPlayerConfiguration.shareBaseURL} in {@link VideoPlayerConfiguration} will override this.
|
|
73
74
|
*/
|
|
74
|
-
public
|
|
75
|
+
public get shareBaseURL(): string | undefined {
|
|
75
76
|
return this._shareBaseURL;
|
|
76
77
|
}
|
|
78
|
+
public set shareBaseURL(value: string | undefined) {
|
|
79
|
+
FireworkSDKModule.setShareBaseURL(value ?? '').then(() => {
|
|
80
|
+
this.updateInternalShareBaseURL(value);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
77
83
|
private _shareBaseURL: string | undefined;
|
|
78
84
|
|
|
79
85
|
/**
|
|
@@ -119,7 +125,7 @@ class FireworkSDK {
|
|
|
119
125
|
/**
|
|
120
126
|
* Get video launch behavior.
|
|
121
127
|
*/
|
|
122
|
-
public
|
|
128
|
+
public get videoLaunchBehavior(): VideoLaunchBehavior | undefined {
|
|
123
129
|
return this._videoLaunchBehavior;
|
|
124
130
|
}
|
|
125
131
|
private _videoLaunchBehavior: VideoLaunchBehavior | undefined;
|
|
@@ -203,6 +209,19 @@ class FireworkSDK {
|
|
|
203
209
|
this.onVideoFeedClick(event ?? {});
|
|
204
210
|
}
|
|
205
211
|
});
|
|
212
|
+
|
|
213
|
+
if (Platform.OS === 'ios') {
|
|
214
|
+
this.eventEmitter.addListener(
|
|
215
|
+
FWEventName.NativeAppLanguageUpdated,
|
|
216
|
+
(event) => {
|
|
217
|
+
FWLoggerUtil.log(
|
|
218
|
+
`Receive NativeAppLanguageUpdated event appLanguage: ${event.appLanguage}`
|
|
219
|
+
);
|
|
220
|
+
const language = event.appLanguage;
|
|
221
|
+
this.updateInternalAppLanguage(language);
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
206
225
|
}
|
|
207
226
|
|
|
208
227
|
/**
|
|
@@ -213,12 +232,6 @@ class FireworkSDK {
|
|
|
213
232
|
FWLoggerUtil.log('Call FireworkSDK init method');
|
|
214
233
|
|
|
215
234
|
FireworkSDKModule.init(options).then(() => {
|
|
216
|
-
const shareBaseURLChanged = this._shareBaseURL !== options?.shareBaseURL;
|
|
217
|
-
this._shareBaseURL = options?.shareBaseURL;
|
|
218
|
-
if (shareBaseURLChanged) {
|
|
219
|
-
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
235
|
const videoLaunchBehaviorUpdated =
|
|
223
236
|
this._videoLaunchBehavior !== options?.videoLaunchBehavior;
|
|
224
237
|
this._videoLaunchBehavior = options?.videoLaunchBehavior;
|
|
@@ -259,17 +272,30 @@ class FireworkSDK {
|
|
|
259
272
|
if (Platform.OS === 'ios') {
|
|
260
273
|
const result = await FireworkSDKModule.changeAppLanguage(language);
|
|
261
274
|
if (result) {
|
|
262
|
-
|
|
263
|
-
this._appLanguage = language;
|
|
264
|
-
if (valueHasChanged) {
|
|
265
|
-
this.eventEmitter.emit(FWEventName.AppLanguageUpdated);
|
|
266
|
-
}
|
|
275
|
+
this.updateInternalAppLanguage(language);
|
|
267
276
|
}
|
|
268
277
|
return result;
|
|
269
278
|
}
|
|
270
279
|
|
|
271
280
|
return false;
|
|
272
281
|
}
|
|
282
|
+
|
|
283
|
+
private updateInternalAppLanguage(language?: string | null) {
|
|
284
|
+
const valueHasChanged = this._appLanguage !== language;
|
|
285
|
+
this._appLanguage = language;
|
|
286
|
+
if (valueHasChanged) {
|
|
287
|
+
this.eventEmitter.emit(FWEventName.AppLanguageUpdated);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
private updateInternalShareBaseURL(shareBaseURL?: string) {
|
|
292
|
+
const shareBaseURLChanged = this._shareBaseURL !== shareBaseURL;
|
|
293
|
+
console.log('updateInternalShareBaseURL shareBaseURL', shareBaseURL);
|
|
294
|
+
this._shareBaseURL = shareBaseURL;
|
|
295
|
+
if (shareBaseURLChanged) {
|
|
296
|
+
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
273
299
|
}
|
|
274
300
|
|
|
275
301
|
export default FireworkSDK;
|
package/src/LiveStream.ts
CHANGED
|
@@ -16,11 +16,11 @@ class LiveStream {
|
|
|
16
16
|
private static _instance?: LiveStream;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* The callback of live stream event.
|
|
19
|
+
* The callback of live stream event.
|
|
20
20
|
*/
|
|
21
21
|
public onLiveStreamEvent?: onLiveStreamEventCallback;
|
|
22
22
|
/**
|
|
23
|
-
* The callback of live stream chat event.
|
|
23
|
+
* The callback of live stream chat event.
|
|
24
24
|
*/
|
|
25
25
|
public onLiveStreamChatEvent?: onLiveStreamChatEventCallback;
|
|
26
26
|
|
package/src/VideoShopping.ts
CHANGED
|
@@ -102,7 +102,7 @@ class VideoShopping {
|
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* This callback is triggered when the user clicks
|
|
105
|
-
* the link button next to Add to cart button.
|
|
105
|
+
* the link button next to Add to cart button.
|
|
106
106
|
*
|
|
107
107
|
* The host app can customize the click event processing logic of
|
|
108
108
|
* the link button by setting the callback.
|