Skip to main content

Chromecast (Google Cast)

The Cast SDK allows a user to select streaming audio-visual content using a sender (Lura Player), and play it on (or cast it to) another device known as the receiver, while controlling playback using the sender.

To enable Google Cast SDK on your player, you need to do the following configuration:

AttributeTypeOptionalDescription
appIdstringfalseReceiver application ID.
import React, { useRef } from "react";
import { LuraPlayer, LuraPlayerProps } from "lura-react-native-core";

export default function MySampleComponent() {
const playerRef = useRef<LuraPlayer>(null);

const config = {
token:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2aWQiOiI0MzY2NjIzIiwiaXNzIjoiM1FMWjdaV0JsRko1Vk16Y2pyczJPbTd3VTdEanIzNFkifQ.CruM1W3gIEyQTBTqfaY5gTdf7b_2SSNg4gj6JGOj4Mg",
googlecast: {
appId: "12345678",
},
};

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