Skip to main content

useYouboraExtension()

useYouboraExtension(): undefined | YouboraExtension

Returns the Youbora extension for the current player instance.

Use this hook to set Youbora metadata for a player instance.

⚠️ Must be used within a PlayerProvider or AVPlayerViewControllerProvider component.

Returns

undefined | YouboraExtension

The YouboraExtension instance associated to the player.

Example

const youboraExtension = useYouboraExtension();

useEffect(() => {
youboraExtension.setMetadata({
live: false,
assetId: 'assetId',
accountCode: 'testAcccountCode',
analyticsOptions: {
appName: 'AplicationName',
},
});
}, [youboraExtension]);