react-native-firework-sdk 1.0.4 → 1.1.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/LICENSE +202 -0
- package/README.md +2 -40
- package/android/build.gradle +6 -3
- package/android/gradle.properties +2 -1
- package/android/proguard-rules.pro +22 -0
- package/android/publish.gradle +4 -3
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +5 -2
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +226 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWCommandConstant.kt +1 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWVideoPlayerConstant.kt +13 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +9 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWEventName.kt +10 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +9 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt +11 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +28 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedItemDetailsModel.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedModel.kt +7 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +18 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedSource.kt +2 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedTitlePosition.kt +1 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoPlaybackDetails.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +23 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoShoppingProduct.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/WeakProperty.kt +19 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/FireworkSDKPackage.kt +10 -5
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +175 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWLiveStreamInterface.kt +5 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FWVideoShoppingInterface.kt +3 -2
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FireworkSDKInterface.kt +4 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +88 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FWVideoShoppingModule.kt +53 -39
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FireworkSDKModule.kt +23 -22
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/pages/FWVideoShoppingCartActivity.kt +4 -4
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/utils/FWEventUtils.kt +61 -7
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWJsonUtils.kt +29 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWLogUtils.kt +2 -2
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWUrlUtils.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +94 -0
- package/android/src/main/res/layout/fw_bridge_fragment_playlistfeed.xml +18 -0
- package/android/src/main/res/layout/{fwrn_fragment_shoppingcart.xml → fw_bridge_fragment_shoppingcart.xml} +1 -1
- package/android/src/main/res/layout/{fwrn_fragment_videofeed.xml → fw_bridge_fragment_videofeed.xml} +2 -1
- package/android/src/main/res/values/colors.xml +4 -0
- package/ios/{Component → Components}/VideoFeed.swift +60 -3
- package/ios/{Component → Components}/VideoFeedConfiguration.swift +2 -0
- package/ios/{Component → Components}/VideoFeedManager.m +2 -0
- package/ios/{Component → Components}/VideoFeedManager.swift +0 -0
- package/ios/{Component → Components}/VideoPlayerConfiguration.swift +7 -0
- package/ios/Models/{FireworkJsEvent.swift → NativeToRN/FireworkEventName.swift} +20 -0
- package/ios/Models/{FireworkSDK+JsModel.swift → NativeToRN/FireworkSDK+Json.swift} +33 -3
- package/ios/Models/{RCTConvert+FireworkSDKModule.swift → RNToNative/RCTConvert+FireworkSDKModule.swift} +20 -0
- package/ios/Models/{RCTConvert+Shopping.swift → RNToNative/RCTConvert+Shopping.swift} +15 -0
- package/ios/Models/{RCTConvert+VideoFeed.swift → RNToNative/RCTConvert+VideoFeed.swift} +2 -1
- package/ios/Modules/FireworkSDKModule/AdBadgeConfiguration.swift +18 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +1 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +10 -14
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +2 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +16 -4
- package/ios/Modules/LiveStream/LiveStreamModule.m +14 -0
- package/ios/Modules/LiveStream/LiveStreamModule.swift +43 -0
- package/ios/Modules/Shopping/ShoppingModule.m +1 -1
- package/ios/Modules/Shopping/ShoppingModule.swift +10 -9
- package/lib/commonjs/FireworkSDK.js +61 -38
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +60 -0
- package/lib/commonjs/LiveStream.js.map +1 -0
- package/lib/commonjs/VideoShopping.js +20 -18
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +47 -2
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/AdBadgeConfiguration.js +2 -0
- package/lib/commonjs/models/{ADConfig.js.map → AdBadgeConfiguration.js.map} +0 -0
- package/lib/commonjs/models/AdConfig.js +2 -0
- package/lib/{module/models/ADConfig.js.map → commonjs/models/AdConfig.js.map} +0 -0
- package/lib/commonjs/models/FWEventName.js +24 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -0
- package/lib/commonjs/models/FWEvents.js +0 -14
- package/lib/commonjs/models/FWEvents.js.map +1 -1
- package/lib/commonjs/models/LiveStreamChatEventName.js +15 -0
- package/lib/commonjs/models/LiveStreamChatEventName.js.map +1 -0
- package/lib/commonjs/models/LiveStreamEventDetails.js +2 -0
- package/lib/commonjs/models/LiveStreamEventDetails.js.map +1 -0
- package/lib/commonjs/models/LiveStreamEventName.js +17 -0
- package/lib/commonjs/models/LiveStreamEventName.js.map +1 -0
- package/lib/commonjs/models/LiveStreamMessageDetails.js +2 -0
- package/lib/commonjs/models/LiveStreamMessageDetails.js.map +1 -0
- package/lib/commonjs/models/VideoFeedSource.js +6 -0
- package/lib/commonjs/models/VideoFeedSource.js.map +1 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/commonjs/modules/FireworkSDKModule.js +3 -1
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/modules/LiveStreamModule.js +22 -0
- package/lib/commonjs/modules/LiveStreamModule.js.map +1 -0
- package/lib/commonjs/modules/ShoppingModule.js +3 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +50 -34
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +51 -0
- package/lib/module/LiveStream.js.map +1 -0
- package/lib/module/VideoShopping.js +14 -13
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/VideoFeed.js +42 -3
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/AdBadgeConfiguration.js +2 -0
- package/lib/module/models/AdBadgeConfiguration.js.map +1 -0
- package/lib/module/models/AdConfig.js +2 -0
- package/lib/module/models/AdConfig.js.map +1 -0
- package/lib/module/models/FWEventName.js +17 -0
- package/lib/module/models/FWEventName.js.map +1 -0
- package/lib/module/models/FWEvents.js +1 -12
- package/lib/module/models/FWEvents.js.map +1 -1
- package/lib/module/models/LiveStreamChatEventName.js +8 -0
- package/lib/module/models/LiveStreamChatEventName.js.map +1 -0
- package/lib/module/models/LiveStreamEventDetails.js +2 -0
- package/lib/module/models/LiveStreamEventDetails.js.map +1 -0
- package/lib/module/models/LiveStreamEventName.js +10 -0
- package/lib/module/models/LiveStreamEventName.js.map +1 -0
- package/lib/module/models/LiveStreamMessageDetails.js +2 -0
- package/lib/module/models/LiveStreamMessageDetails.js.map +1 -0
- package/lib/module/models/VideoFeedSource.js +2 -0
- package/lib/module/models/VideoFeedSource.js.map +1 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js +3 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/LiveStreamModule.js +12 -0
- package/lib/module/modules/LiveStreamModule.js.map +1 -0
- package/lib/module/modules/ShoppingModule.js +3 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +26 -24
- package/lib/typescript/LiveStream.d.ts +21 -0
- package/lib/typescript/VideoShopping.d.ts +6 -6
- package/lib/typescript/components/VideoFeed.d.ts +11 -4
- package/lib/typescript/index.d.ts +15 -6
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +15 -0
- package/lib/typescript/models/{ADConfig.d.ts → AdConfig.d.ts} +1 -1
- package/lib/typescript/models/FWEventName.d.ts +14 -0
- package/lib/typescript/models/FWEvents.d.ts +15 -12
- package/lib/typescript/models/FeedItemDetails.d.ts +11 -4
- package/lib/typescript/models/LiveStreamChatEventName.d.ts +7 -0
- package/lib/typescript/models/LiveStreamEventDetails.d.ts +3 -0
- package/lib/typescript/models/LiveStreamEventName.d.ts +15 -0
- package/lib/typescript/models/LiveStreamMessageDetails.d.ts +14 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +7 -3
- package/lib/typescript/models/VideoFeedSource.d.ts +2 -0
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +1 -2
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +1 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +13 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +8 -4
- package/lib/typescript/modules/LiveStreamModule.d.ts +8 -0
- package/lib/typescript/modules/ShoppingModule.d.ts +4 -2
- package/package.json +3 -4
- package/react-native-firework-sdk.podspec +3 -1
- package/src/FireworkSDK.ts +49 -33
- package/src/LiveStream.ts +51 -0
- package/src/VideoShopping.ts +15 -13
- package/src/components/VideoFeed.tsx +69 -7
- package/src/index.tsx +32 -15
- package/src/models/AdBadgeConfiguration.ts +16 -0
- package/src/models/{ADConfig.ts → AdConfig.ts} +1 -1
- package/src/models/FWEventName.ts +14 -0
- package/src/models/FWEvents.ts +17 -13
- package/src/models/FeedItemDetails.ts +12 -4
- package/src/models/LiveStreamChatEventName.ts +8 -0
- package/src/models/LiveStreamEventDetails.ts +4 -0
- package/src/models/LiveStreamEventName.ts +16 -0
- package/src/models/LiveStreamMessageDetails.ts +14 -0
- package/src/models/VideoFeedConfiguration.ts +7 -3
- package/src/models/VideoFeedSource.ts +2 -0
- package/src/models/VideoPlaybackDetails.ts +1 -3
- package/src/models/VideoPlaybackEventName.ts +1 -1
- package/src/models/VideoPlayerConfiguration.ts +14 -0
- package/src/modules/FireworkSDKModule.ts +10 -4
- package/src/modules/LiveStreamModule.ts +26 -0
- package/src/modules/ShoppingModule.ts +14 -7
- package/android/src/main/java/com/reactnativefireworksdk/components/videofeed/FWVideoFeed.kt +0 -124
- package/android/src/main/java/com/reactnativefireworksdk/manager/FWVideoFeedManager.kt +0 -88
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedConfigModel.kt +0 -27
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedMode.kt +0 -7
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoPlayerConfigModel.kt +0 -20
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWVideoPlayerUtils.kt +0 -18
- package/lib/commonjs/models/ADConfig.js +0 -2
- package/lib/module/models/ADConfig.js +0 -2
|
@@ -5,6 +5,7 @@ export interface VideoPlayerCTAStyle {
|
|
|
5
5
|
textColor?: string;
|
|
6
6
|
fontSize?: number;
|
|
7
7
|
}
|
|
8
|
+
export declare type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
|
|
8
9
|
export default interface VideoPlayerConfiguration {
|
|
9
10
|
/**
|
|
10
11
|
* Sets the proportion of the video player to its container.
|
|
@@ -22,4 +23,16 @@ export default interface VideoPlayerConfiguration {
|
|
|
22
23
|
* The style of CTA button style. Only supported on iOS.
|
|
23
24
|
*/
|
|
24
25
|
ctaButtonStyle?: VideoPlayerCTAStyle;
|
|
26
|
+
/**
|
|
27
|
+
* Indicates if the video player shows playback button.
|
|
28
|
+
*/
|
|
29
|
+
showPlaybackButton?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates if the video player shows mute button.
|
|
32
|
+
*/
|
|
33
|
+
showMuteButton?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The property is valid only if showMuteButton is true.
|
|
36
|
+
*/
|
|
37
|
+
launchBehavior?: VideoLaunchBehavior;
|
|
25
38
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
1
|
+
import { NativeEventEmitter, NativeModule } from 'react-native';
|
|
2
|
+
import type AdBadgeConfiguration from 'src/models/AdBadgeConfiguration';
|
|
3
|
+
import type AdConfig from '../models/AdConfig';
|
|
3
4
|
import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
|
|
4
5
|
interface IFireworkSDKModule extends NativeModule {
|
|
5
|
-
init(userId?: string, adConfig?:
|
|
6
|
+
init(userId?: string, adConfig?: AdConfig): void;
|
|
6
7
|
openVideoPlayer(url: string, config?: VideoPlayerConfiguration): void;
|
|
7
8
|
setCustomCTAClickEnabled(enabled: boolean): void;
|
|
8
|
-
setShareBaseURL(url?: string):
|
|
9
|
+
setShareBaseURL(url?: string): Promise<any>;
|
|
9
10
|
setVideoPlaybackEventEnabled(enabled: boolean): void;
|
|
11
|
+
setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;
|
|
10
12
|
}
|
|
13
|
+
declare const FireworkSDKModuleEventEmitter: NativeEventEmitter;
|
|
14
|
+
export { FireworkSDKModuleEventEmitter, };
|
|
11
15
|
declare const _default: IFireworkSDKModule;
|
|
12
16
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NativeEventEmitter, NativeModule } from 'react-native';
|
|
2
|
+
interface ILiveStreamModule extends NativeModule {
|
|
3
|
+
init(): void;
|
|
4
|
+
}
|
|
5
|
+
declare const LiveStreamModuleEventEmitter: NativeEventEmitter;
|
|
6
|
+
export { LiveStreamModuleEventEmitter };
|
|
7
|
+
declare const _default: ILiveStreamModule;
|
|
8
|
+
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { NativeModule } from 'react-native';
|
|
1
|
+
import { NativeEventEmitter, NativeModule } from 'react-native';
|
|
2
2
|
import type Product from '../models/Product';
|
|
3
3
|
import type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';
|
|
4
4
|
interface IShoppingModule extends NativeModule {
|
|
5
5
|
init(): void;
|
|
6
|
-
|
|
6
|
+
updateVideoProducts(products: Product[], callbackId: number | string): void;
|
|
7
7
|
updateProductViewConfig(config: ProductInfoViewConfiguration, callbackId: number | string): void;
|
|
8
8
|
updateAddToCartStatus(res: string, tips: string, callbackId: number | string): void;
|
|
9
9
|
jumpToCartPage(callbackId: number | string): void;
|
|
@@ -11,5 +11,7 @@ interface IShoppingModule extends NativeModule {
|
|
|
11
11
|
setCartIconVisible(visible: boolean): void;
|
|
12
12
|
setCartItemCount(count: number): void;
|
|
13
13
|
}
|
|
14
|
+
declare const ShoppingModuleEventEmitter: NativeEventEmitter;
|
|
15
|
+
export { ShoppingModuleEventEmitter };
|
|
14
16
|
declare const _default: IShoppingModule;
|
|
15
17
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-firework-sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Firework React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
8
|
-
"react-native": "src/index",
|
|
9
8
|
"source": "src/index",
|
|
10
9
|
"files": [
|
|
11
10
|
"src",
|
|
@@ -37,9 +36,9 @@
|
|
|
37
36
|
],
|
|
38
37
|
"repository": "",
|
|
39
38
|
"author": "",
|
|
40
|
-
"license": "
|
|
39
|
+
"license": "Apache-2.0",
|
|
41
40
|
"bugs": {
|
|
42
|
-
"url": ""
|
|
41
|
+
"url": "https://github.com/loopsocial/react-native-firework-sdk/issues"
|
|
43
42
|
},
|
|
44
43
|
"homepage": "https://github.com/loopsocial/react-native-firework-sdk",
|
|
45
44
|
"publishConfig": {
|
package/src/FireworkSDK.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { NativeEventEmitter } from 'react-native';
|
|
1
|
+
import type { NativeEventEmitter } from 'react-native';
|
|
2
|
+
import LiveStream from './LiveStream';
|
|
2
3
|
|
|
3
|
-
import type
|
|
4
|
+
import type AdBadgeConfiguration from './models/AdBadgeConfiguration';
|
|
5
|
+
import type AdConfig from './models/AdConfig';
|
|
6
|
+
import { FWEventName } from './models/FWEventName';
|
|
4
7
|
import type {
|
|
5
8
|
CustomCTAClickEvent,
|
|
6
9
|
SDKInitEvent,
|
|
10
|
+
VideoFeedClickEvent,
|
|
7
11
|
VideoPlaybackEvent,
|
|
8
12
|
} from './models/FWEvents';
|
|
9
|
-
import { FWEventName, VideoFeedClickEvent } from './models/FWEvents';
|
|
10
13
|
import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
|
|
11
|
-
import FireworkSDKModule from './modules/FireworkSDKModule';
|
|
14
|
+
import FireworkSDKModule, { FireworkSDKModuleEventEmitter } from './modules/FireworkSDKModule';
|
|
15
|
+
import LiveStreamModule from './modules/LiveStreamModule';
|
|
12
16
|
import ShoppingModule from './modules/ShoppingModule';
|
|
13
17
|
import VideoShopping from './VideoShopping';
|
|
14
18
|
|
|
@@ -22,66 +26,72 @@ export type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;
|
|
|
22
26
|
*/
|
|
23
27
|
class FireworkSDK {
|
|
24
28
|
private static _instance?: FireworkSDK;
|
|
25
|
-
private _onCustomCTAClick: CustomCTAClickCallback | undefined;
|
|
26
|
-
private _onVideoPlayback?: VideoPlaybackCallback | undefined;
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* The callback of SDK initialization.
|
|
30
32
|
*/
|
|
31
|
-
public
|
|
32
|
-
private _shareBaseURL: string | undefined;
|
|
33
|
+
public onSDKInit?: SDKInitCallback;
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
+
* the callback of clicking Video Feed.
|
|
36
37
|
*/
|
|
37
|
-
public
|
|
38
|
+
public onVideoFeedClick?: VideoFeedClickCallback;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
+
* The callback of clicking custom CTA.
|
|
41
42
|
*/
|
|
42
43
|
public get onCustomCTAClick(): CustomCTAClickCallback | undefined {
|
|
43
44
|
return this._onCustomCTAClick;
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Set Custom Clicking CTA callback.
|
|
48
|
-
*/
|
|
49
46
|
public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {
|
|
50
47
|
this._onCustomCTAClick = value;
|
|
51
48
|
FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);
|
|
52
49
|
}
|
|
50
|
+
private _onCustomCTAClick: CustomCTAClickCallback | undefined;
|
|
53
51
|
|
|
54
52
|
/**
|
|
55
|
-
*
|
|
53
|
+
* The callback of video playback.
|
|
56
54
|
*/
|
|
57
55
|
public get onVideoPlayback(): VideoPlaybackCallback | undefined {
|
|
58
56
|
return this._onVideoPlayback;
|
|
59
57
|
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Set Video Playback callback.
|
|
63
|
-
*/
|
|
64
58
|
public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {
|
|
65
59
|
this._onVideoPlayback = value;
|
|
66
60
|
FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);
|
|
67
61
|
}
|
|
62
|
+
private _onVideoPlayback?: VideoPlaybackCallback | undefined;
|
|
68
63
|
|
|
69
64
|
/**
|
|
70
|
-
*
|
|
65
|
+
* The share base URL of videos.
|
|
71
66
|
*/
|
|
72
67
|
public get shareBaseURL(): string | undefined {
|
|
73
68
|
return this._shareBaseURL;
|
|
74
69
|
}
|
|
70
|
+
public set shareBaseURL(value: string | undefined) {
|
|
71
|
+
this._shareBaseURL = value;
|
|
72
|
+
FireworkSDKModule.setShareBaseURL(value).then(() => {
|
|
73
|
+
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
private _shareBaseURL: string | undefined;
|
|
75
77
|
|
|
76
78
|
/**
|
|
77
|
-
*
|
|
79
|
+
* The configuration for ad badges.
|
|
78
80
|
*/
|
|
79
|
-
public
|
|
80
|
-
this.
|
|
81
|
-
FireworkSDKModule.setShareBaseURL(value);
|
|
81
|
+
public get adBadgeConfiguration(): AdBadgeConfiguration | undefined {
|
|
82
|
+
return this._adBadgeConfiguration;
|
|
82
83
|
}
|
|
84
|
+
public set adBadgeConfiguration(value: AdBadgeConfiguration | undefined) {
|
|
85
|
+
this._adBadgeConfiguration = value;
|
|
86
|
+
FireworkSDKModule.setAdBadgeConfiguration(value).then(() => {
|
|
87
|
+
this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
private _adBadgeConfiguration?: AdBadgeConfiguration | undefined;
|
|
83
91
|
|
|
84
|
-
private eventEmitter: NativeEventEmitter
|
|
92
|
+
private get eventEmitter(): NativeEventEmitter {
|
|
93
|
+
return FireworkSDKModuleEventEmitter;
|
|
94
|
+
}
|
|
85
95
|
|
|
86
96
|
/**
|
|
87
97
|
* Get VideoShopping object.
|
|
@@ -90,6 +100,13 @@ class FireworkSDK {
|
|
|
90
100
|
return VideoShopping.getInstance();
|
|
91
101
|
}
|
|
92
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Get LiveStream object.
|
|
105
|
+
*/
|
|
106
|
+
public get liveStream(): LiveStream {
|
|
107
|
+
return LiveStream.getInstance();
|
|
108
|
+
}
|
|
109
|
+
|
|
93
110
|
/**
|
|
94
111
|
* Get global single instance of FireworkSDK class.
|
|
95
112
|
* @returns FireworkSDK
|
|
@@ -103,8 +120,6 @@ class FireworkSDK {
|
|
|
103
120
|
}
|
|
104
121
|
|
|
105
122
|
private constructor() {
|
|
106
|
-
this.eventEmitter = new NativeEventEmitter(FireworkSDKModule);
|
|
107
|
-
|
|
108
123
|
this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {
|
|
109
124
|
if (this.onSDKInit) {
|
|
110
125
|
this.onSDKInit(event ?? {});
|
|
@@ -133,17 +148,18 @@ class FireworkSDK {
|
|
|
133
148
|
/**
|
|
134
149
|
* Initializes Firework SDK.
|
|
135
150
|
* @param {string?} userId An id to uniquely identify device or user.
|
|
136
|
-
* @param {
|
|
151
|
+
* @param {AdConfig?} adConfig Configuration of Ad.
|
|
137
152
|
*/
|
|
138
|
-
public init(userId?: string, adConfig?:
|
|
153
|
+
public init(userId?: string, adConfig?: AdConfig) {
|
|
139
154
|
FireworkSDKModule.init(userId, adConfig);
|
|
140
155
|
ShoppingModule.init();
|
|
156
|
+
LiveStreamModule.init();
|
|
141
157
|
}
|
|
142
158
|
|
|
143
159
|
/**
|
|
144
160
|
* Open Video URL.
|
|
145
|
-
* @param {string} url
|
|
146
|
-
* @param {VideoPlayerConfiguration} config
|
|
161
|
+
* @param {string} url
|
|
162
|
+
* @param {VideoPlayerConfiguration} config
|
|
147
163
|
*/
|
|
148
164
|
public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {
|
|
149
165
|
FireworkSDKModule.openVideoPlayer(url, config ?? {});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { NativeEventEmitter } from "react-native";
|
|
2
|
+
import { FWEventName } from "./models/FWEventName";
|
|
3
|
+
import type { LiveStreamChatEvent, LiveStreamEvent } from "./models/FWEvents";
|
|
4
|
+
import { LiveStreamModuleEventEmitter } from "./modules/LiveStreamModule";
|
|
5
|
+
|
|
6
|
+
export type onLiveStreamEventCallback = (event: LiveStreamEvent) => void;
|
|
7
|
+
export type onLiveStreamChatEventCallback = (event: LiveStreamChatEvent) => void;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The entry class of live stream.
|
|
11
|
+
*/
|
|
12
|
+
class LiveStream {
|
|
13
|
+
private static _instance?: LiveStream;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The callback of live stream event.
|
|
17
|
+
*/
|
|
18
|
+
public onLiveStreamEvent?: onLiveStreamEventCallback;
|
|
19
|
+
/**
|
|
20
|
+
* The callback of live stream chat event.
|
|
21
|
+
*/
|
|
22
|
+
public onLiveStreamChatEvent?: onLiveStreamChatEventCallback;
|
|
23
|
+
|
|
24
|
+
private get eventEmitter(): NativeEventEmitter {
|
|
25
|
+
return LiveStreamModuleEventEmitter;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static getInstance() {
|
|
29
|
+
if (!LiveStream._instance) {
|
|
30
|
+
LiveStream._instance = new LiveStream();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return LiveStream._instance!;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private constructor() {
|
|
37
|
+
this.eventEmitter.addListener(FWEventName.onLiveStreamEvent, (event) => {
|
|
38
|
+
if (this.onLiveStreamEvent) {
|
|
39
|
+
this.onLiveStreamEvent(event ?? {});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
this.eventEmitter.addListener(FWEventName.onLiveStreamChatEvent, (event) => {
|
|
44
|
+
if (this.onLiveStreamChatEvent) {
|
|
45
|
+
this.onLiveStreamChatEvent(event ?? {});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default LiveStream;
|
package/src/VideoShopping.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { NativeEventEmitter } from 'react-native';
|
|
1
|
+
import type { NativeEventEmitter } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import type AddToCartResult from './models/AddToCartResult';
|
|
4
|
-
import {
|
|
4
|
+
import type {
|
|
5
5
|
AddToCartEvent,
|
|
6
|
-
FWEventName,
|
|
7
6
|
UpdateProductDetailsEvent,
|
|
8
7
|
WillDisplayProductEvent,
|
|
9
8
|
} from './models/FWEvents';
|
|
9
|
+
import { FWEventName } from './models/FWEventName';
|
|
10
10
|
import type Product from './models/Product';
|
|
11
11
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
12
|
-
import ShoppingModule from './modules/ShoppingModule';
|
|
12
|
+
import ShoppingModule, { ShoppingModuleEventEmitter } from './modules/ShoppingModule';
|
|
13
13
|
|
|
14
14
|
export type AddToCartCallback = (
|
|
15
15
|
event: AddToCartEvent
|
|
@@ -21,7 +21,7 @@ export type ClickCartIconCallback = () => Promise<
|
|
|
21
21
|
|
|
22
22
|
export type UpdateProductDetailsCallback = (
|
|
23
23
|
event: UpdateProductDetailsEvent
|
|
24
|
-
) => Promise<Product | undefined | null>;
|
|
24
|
+
) => Promise<Product[] | undefined | null>;
|
|
25
25
|
|
|
26
26
|
export type WillDisplayProductCallback = (
|
|
27
27
|
event: WillDisplayProductEvent
|
|
@@ -30,11 +30,10 @@ export type WillDisplayProductCallback = (
|
|
|
30
30
|
type CallbackInfo = { callbackId?: number | string };
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* The entry class of video shopping.
|
|
34
34
|
*/
|
|
35
35
|
class VideoShopping {
|
|
36
36
|
private static _instance?: VideoShopping;
|
|
37
|
-
private _cartIconVisible: boolean = true;
|
|
38
37
|
|
|
39
38
|
/**
|
|
40
39
|
* This callback is triggered when the user clicks the "Add to cart" button.
|
|
@@ -53,7 +52,7 @@ class VideoShopping {
|
|
|
53
52
|
/**
|
|
54
53
|
* This callback is triggered when the video will be shown.
|
|
55
54
|
*
|
|
56
|
-
* The host app can return a Product
|
|
55
|
+
* The host app can return a Product list to update the latest product information.
|
|
57
56
|
*/
|
|
58
57
|
public onUpdateProductDetails?: UpdateProductDetailsCallback;
|
|
59
58
|
|
|
@@ -74,10 +73,13 @@ class VideoShopping {
|
|
|
74
73
|
this._cartIconVisible = value;
|
|
75
74
|
ShoppingModule.setCartIconVisible(value);
|
|
76
75
|
}
|
|
76
|
+
private _cartIconVisible: boolean = true;
|
|
77
77
|
|
|
78
78
|
public currentCartPage?: React.ReactNode;
|
|
79
79
|
|
|
80
|
-
private eventEmitter: NativeEventEmitter
|
|
80
|
+
private get eventEmitter(): NativeEventEmitter {
|
|
81
|
+
return ShoppingModuleEventEmitter;
|
|
82
|
+
}
|
|
81
83
|
|
|
82
84
|
public static getInstance() {
|
|
83
85
|
if (!VideoShopping._instance) {
|
|
@@ -88,7 +90,6 @@ class VideoShopping {
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
private constructor() {
|
|
91
|
-
this.eventEmitter = new NativeEventEmitter(ShoppingModule);
|
|
92
93
|
this.eventEmitter.addListener(FWEventName.AddToCart, (event) => {
|
|
93
94
|
this.handleAddToCartEvent(event);
|
|
94
95
|
});
|
|
@@ -157,11 +158,12 @@ class VideoShopping {
|
|
|
157
158
|
if (this.onUpdateProductDetails) {
|
|
158
159
|
const callbackId = event.callbackId;
|
|
159
160
|
delete event.callbackId;
|
|
160
|
-
const
|
|
161
|
+
const productList = await this.onUpdateProductDetails(
|
|
161
162
|
event as UpdateProductDetailsEvent
|
|
162
163
|
);
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
console.log('handleUpdateProductDetailsEvent productList', JSON.stringify(productList));
|
|
165
|
+
if (productList) {
|
|
166
|
+
ShoppingModule.updateVideoProducts(productList, callbackId!);
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import type { NativeSyntheticEvent, TargetedEvent } from 'react-native';
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
EmitterSubscription,
|
|
6
|
+
findNodeHandle,
|
|
7
|
+
StyleProp,
|
|
8
|
+
UIManager,
|
|
9
|
+
ViewStyle,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
|
|
12
|
+
import FireworkSDK from '../FireworkSDK';
|
|
6
13
|
import type FWError from '../models/FWError';
|
|
14
|
+
import { FWEventName } from '../models/FWEventName';
|
|
15
|
+
import type VideoFeedConfiguration from '../models/VideoFeedConfiguration';
|
|
16
|
+
import type VideoFeedSource from '../models/VideoFeedSource';
|
|
17
|
+
import type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';
|
|
18
|
+
import { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';
|
|
7
19
|
import FWVideoFeed from './FWVideoFeed';
|
|
8
20
|
|
|
9
|
-
export type VideoFeedSource = 'discover' | 'channel' | 'playlist';
|
|
10
21
|
export type VideoFeedMode = 'row' | 'column' | 'grid';
|
|
11
22
|
|
|
12
23
|
export interface IVideoFeedProps {
|
|
@@ -26,6 +37,11 @@ export interface IVideoFeedProps {
|
|
|
26
37
|
* Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.
|
|
27
38
|
*/
|
|
28
39
|
playlist?: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.
|
|
43
|
+
*/
|
|
44
|
+
playlistGroup?: string;
|
|
29
45
|
/**
|
|
30
46
|
* One of three available display modes. Defaults to row.
|
|
31
47
|
*/
|
|
@@ -57,6 +73,9 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
57
73
|
};
|
|
58
74
|
|
|
59
75
|
nativeComponentRef = React.createRef<any>();
|
|
76
|
+
|
|
77
|
+
subscriptions: EmitterSubscription[] = [];
|
|
78
|
+
|
|
60
79
|
/**
|
|
61
80
|
* Force refreshing the video feed.
|
|
62
81
|
*/
|
|
@@ -81,20 +100,63 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
81
100
|
this.props.onVideoFeedLoadFinished();
|
|
82
101
|
}
|
|
83
102
|
}
|
|
84
|
-
};
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
componentDidMount() {
|
|
106
|
+
const subscriptionOfShareBaseURLUpdated = FireworkSDKModuleEventEmitter.addListener(
|
|
107
|
+
FWEventName.ShareBaseURLUpdated,
|
|
108
|
+
() => {
|
|
109
|
+
this.setState({});
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
this.subscriptions.push(subscriptionOfShareBaseURLUpdated);
|
|
113
|
+
|
|
114
|
+
const subscriptionOfAdBadgeConfigurationUpdated = FireworkSDKModuleEventEmitter.addListener(
|
|
115
|
+
FWEventName.AdBadgeConfigurationUpdated,
|
|
116
|
+
() => {
|
|
117
|
+
this.setState({});
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
componentWillUnmount() {
|
|
124
|
+
this.subscriptions.forEach((value) => {
|
|
125
|
+
value.remove();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
this.subscriptions = [];
|
|
129
|
+
}
|
|
85
130
|
|
|
86
131
|
render() {
|
|
87
132
|
const {
|
|
88
133
|
source,
|
|
89
134
|
channel = '',
|
|
90
135
|
playlist = '',
|
|
136
|
+
playlistGroup = '',
|
|
91
137
|
mode = 'row',
|
|
92
138
|
videoFeedConfiguration,
|
|
93
139
|
} = this.props;
|
|
94
140
|
const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;
|
|
95
141
|
const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';
|
|
142
|
+
const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
|
|
143
|
+
const adBadgeConfiguration =
|
|
144
|
+
FireworkSDK.getInstance().adBadgeConfiguration ?? {};
|
|
145
|
+
const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
|
|
146
|
+
const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
|
|
147
|
+
const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
|
|
96
148
|
|
|
97
|
-
|
|
149
|
+
let key = `source:${source}`;
|
|
150
|
+
key += `_channel:${channel}`;
|
|
151
|
+
key += `_playlist:${playlist}`;
|
|
152
|
+
key += `_playlistGroup:${playlistGroup}`;
|
|
153
|
+
key += `_mode:${mode}`;
|
|
154
|
+
key += `_titleHidden:${titleHidden}`;
|
|
155
|
+
key += `_titlePosition:${titlePosition}`;
|
|
156
|
+
key += `_shareBaseURL:${shareBaseURL}`;
|
|
157
|
+
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
158
|
+
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|
|
159
|
+
key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
|
|
98
160
|
|
|
99
161
|
return (
|
|
100
162
|
<FWVideoFeed
|
|
@@ -103,7 +165,7 @@ export default class VideoFeed extends React.Component<IVideoFeedProps> {
|
|
|
103
165
|
ref={this.nativeComponentRef}
|
|
104
166
|
onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}
|
|
105
167
|
mode={mode}
|
|
106
|
-
style={Object.assign({}, this.props.style, {zIndex: -1})}
|
|
168
|
+
style={Object.assign({}, this.props.style, { zIndex: -1 })}
|
|
107
169
|
/>
|
|
108
170
|
);
|
|
109
171
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { AppRegistry } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import CartContainer from './components/CartContainer';
|
|
4
|
-
import type {
|
|
5
|
-
IVideoFeedProps,
|
|
6
|
-
VideoFeedMode,
|
|
7
|
-
VideoFeedSource,
|
|
8
|
-
} from './components/VideoFeed';
|
|
4
|
+
import type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';
|
|
9
5
|
import VideoFeed from './components/VideoFeed';
|
|
10
6
|
import type {
|
|
11
7
|
CustomCTAClickCallback,
|
|
@@ -14,23 +10,34 @@ import type {
|
|
|
14
10
|
VideoPlaybackCallback,
|
|
15
11
|
} from './FireworkSDK';
|
|
16
12
|
import FireworkSDK from './FireworkSDK';
|
|
17
|
-
import type
|
|
13
|
+
import type {
|
|
14
|
+
onLiveStreamChatEventCallback,
|
|
15
|
+
onLiveStreamEventCallback,
|
|
16
|
+
} from './LiveStream';
|
|
17
|
+
import LiveStream from './LiveStream';
|
|
18
|
+
import type AdBadgeConfiguration from './models/AdBadgeConfiguration';
|
|
19
|
+
import type { AdBadgeTextType } from './models/AdBadgeConfiguration';
|
|
20
|
+
import type AdConfig from './models/AdConfig';
|
|
18
21
|
import type AddToCartResult from './models/AddToCartResult';
|
|
19
22
|
import type FeedItemDetails from './models/FeedItemDetails';
|
|
20
23
|
import type FWError from './models/FWError';
|
|
21
24
|
import type {
|
|
22
25
|
AddToCartEvent,
|
|
23
26
|
CustomCTAClickEvent,
|
|
27
|
+
LiveStreamChatEvent,
|
|
28
|
+
LiveStreamEvent,
|
|
24
29
|
SDKInitEvent,
|
|
25
30
|
UpdateProductDetailsEvent,
|
|
26
31
|
VideoPlaybackEvent,
|
|
27
32
|
WillDisplayProductEvent,
|
|
28
33
|
} from './models/FWEvents';
|
|
34
|
+
import type LiveStreamEventDetails from './models/LiveStreamEventDetails';
|
|
35
|
+
import LiveStreamEventName from './models/LiveStreamEventName';
|
|
36
|
+
import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
|
|
37
|
+
import LiveStreamChatEventName from './models/LiveStreamChatEventName';
|
|
29
38
|
import type Product from './models/Product';
|
|
30
39
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
31
|
-
import type {
|
|
32
|
-
AddToCartButtonConfiguration,
|
|
33
|
-
} from './models/ProductInfoViewConfiguration';
|
|
40
|
+
import type { AddToCartButtonConfiguration } from './models/ProductInfoViewConfiguration';
|
|
34
41
|
import type ProductUnit from './models/ProductUnit';
|
|
35
42
|
import type { ProductPrice } from './models/ProductUnit';
|
|
36
43
|
import type VideoFeedConfiguration from './models/VideoFeedConfiguration';
|
|
@@ -39,14 +46,13 @@ import type {
|
|
|
39
46
|
VideoFeedTitleConfiguration,
|
|
40
47
|
VideoFeedTitlePosition,
|
|
41
48
|
} from './models/VideoFeedConfiguration';
|
|
49
|
+
import type VideoFeedSource from './models/VideoFeedSource';
|
|
42
50
|
import type VideoPlaybackDetails from './models/VideoPlaybackDetails';
|
|
43
|
-
import type {
|
|
44
|
-
VideoBadge,
|
|
45
|
-
VideoPlayerSize,
|
|
46
|
-
} from './models/VideoPlaybackDetails';
|
|
51
|
+
import type { VideoPlayerSize } from './models/VideoPlaybackDetails';
|
|
47
52
|
import VideoPlaybackEventName from './models/VideoPlaybackEventName';
|
|
48
53
|
import type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';
|
|
49
54
|
import type {
|
|
55
|
+
VideoLaunchBehavior,
|
|
50
56
|
VideoPlayerCompleteAction,
|
|
51
57
|
VideoPlayerCTAStyle,
|
|
52
58
|
VideoPlayerStyle,
|
|
@@ -64,7 +70,9 @@ AppRegistry.registerComponent('FWShoppingCartPage', () => CartContainer);
|
|
|
64
70
|
export default FireworkSDK;
|
|
65
71
|
|
|
66
72
|
export {
|
|
67
|
-
|
|
73
|
+
AdBadgeConfiguration,
|
|
74
|
+
AdBadgeTextType,
|
|
75
|
+
AdConfig,
|
|
68
76
|
AddToCartButtonConfiguration,
|
|
69
77
|
AddToCartCallback,
|
|
70
78
|
AddToCartEvent,
|
|
@@ -75,6 +83,15 @@ export {
|
|
|
75
83
|
FeedItemDetails,
|
|
76
84
|
FWError,
|
|
77
85
|
IVideoFeedProps,
|
|
86
|
+
LiveStream,
|
|
87
|
+
LiveStreamChatEvent,
|
|
88
|
+
LiveStreamEvent,
|
|
89
|
+
LiveStreamEventDetails,
|
|
90
|
+
LiveStreamEventName,
|
|
91
|
+
LiveStreamMessageDetails,
|
|
92
|
+
LiveStreamChatEventName,
|
|
93
|
+
onLiveStreamChatEventCallback,
|
|
94
|
+
onLiveStreamEventCallback,
|
|
78
95
|
Product,
|
|
79
96
|
ProductInfoViewConfiguration,
|
|
80
97
|
ProductPrice,
|
|
@@ -83,7 +100,6 @@ export {
|
|
|
83
100
|
SDKInitEvent,
|
|
84
101
|
UpdateProductDetailsCallback,
|
|
85
102
|
UpdateProductDetailsEvent,
|
|
86
|
-
VideoBadge,
|
|
87
103
|
VideoFeed,
|
|
88
104
|
VideoFeedClickCallback,
|
|
89
105
|
VideoFeedConfiguration,
|
|
@@ -92,6 +108,7 @@ export {
|
|
|
92
108
|
VideoFeedSource,
|
|
93
109
|
VideoFeedTitleConfiguration,
|
|
94
110
|
VideoFeedTitlePosition,
|
|
111
|
+
VideoLaunchBehavior,
|
|
95
112
|
VideoPlaybackCallback,
|
|
96
113
|
VideoPlaybackDetails,
|
|
97
114
|
VideoPlaybackEvent,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type AdBadgeTextType = 'ad' | 'sponsored';
|
|
2
|
+
|
|
3
|
+
export default interface AdBadgeConfiguration {
|
|
4
|
+
/**
|
|
5
|
+
* The text type of the ad badge.
|
|
6
|
+
*/
|
|
7
|
+
badgeTextType?: AdBadgeTextType;
|
|
8
|
+
/**
|
|
9
|
+
* The background color of the ad badge. Only supported on iOS.
|
|
10
|
+
*/
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The color of the ad badge text. Only supported on iOS.
|
|
14
|
+
*/
|
|
15
|
+
textColor?: string;
|
|
16
|
+
}
|