VideoFeed component provides onVideoFeedLoadFinished prop for setting video feed loading result callback.
<VideoFeed
style={{ height: 200 }}
source="discover"
onVideoFeedLoadFinished={(error) => {
/**
* if error is undefined, it means that video feed loaded successfully.
* Otherwise, it means that video feed failed to load.
*/
console.log('onVideoFeedLoadFinished error', error);
}}
/>
The callback is triggered when users click the CTA button on the video in the video player. We start the floating player in the following sample codes. The event type is CustomCTAClickEvent.
FireworkSDK.getInstance().onCustomCTAClick = async (event) => {
const result = await FireworkSDK.getInstance().navigator.startFloatingPlayer();
if (!result) {
/* when the result is false, the current fullscreen player may not
* enable the floating player. In that case, we could call the
* following method to close the fullscreen player.
*/
await FireworkSDK.getInstance().navigator.popNativeContainer();
}
// Navigate to the RN webview page of the host app.
navigation.navigate('LinkContent', { url: event.url });
}