Skip to main content

Getting Started

This section explains the basics of how to use the JavaScript/Typescript SDK component of Lura Player. This SDK can be used to enhance the functionality of your video embeds or to implement rich page-level video interactions.

To get started, copy the following code in an MySampleComponent.tsx file and start exploring in the console.

import { useRef } from 'react';
import LuraPlayer from 'lura-react-native-core';


export default function MySampleComponent(){
const playerRef = useRef<LuraPlayer>(null);
const config = {
token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2aWQiOiI0MzY2NjIzIiwiaXNzIjoiM1FMWjdaV0JsRko1Vk16Y2pyczJPbTd3VTdEanIzNFkifQ.CruM1W3gIEyQTBTqfaY5gTdf7b_2SSNg4gj6JGOj4Mg"
};
...
playerRef.current?.play();
...
playerRef.current?.setVolume(0.3);
...

return (
<View>
<LuraPlayer ref={playerRef} config={config}/>
</View>
);
}