Lura Configuration
The MCP platform by Akta Tech LLC. is a feature complete OTT Platform that removes the need for manual configuration of the playback media and allows the configurations to be used with multiple assets.
To configure the Lura Player based on your pre-configured play configuration in MCP, you can use the following attributes in your configuration.
Attribute | Type | Description |
---|---|---|
appKey | string | AppKey generated in MCP based on the pre-adjusted play configuration |
assetId | string | AssetId of the VOD or the Live Stream |
token | string | (Optional) When specified the provided token will be used in entitlements requests. |
import React, { useRef, useEffect, useState } from "react";
import { SafeAreaView, StyleSheet, View } from "react-native";
import { LuraPlayer, type UnifiedPlayer, type Configuration } from "@akta-tech/lura-player-react-native";
import { LuraPlayerControls } from "@akta-tech/lura-player-react-native-ui";
export default function App() {
const playerRef = useRef<UnifiedPlayer>(null);
const config: Configuration = {
...
lura: {
appKey: "<YOUR_APP_KEY>",
assetId: "<ASSET_ID>",
},
...
};
useEffect(() => {
playerRef.current?.setConfig(config)
}, [playerRef]);
return (
<View>
<SafeAreaView />
<LuraPlayer ref={playerRef} style={styles.player}>
<LuraPlayerControls></LuraPlayerControls>
</LuraPlayer>
</View>
);
}
const styles = StyleSheet.create({
player: {
backgroundColor: "#000",
width: "100%",
maxWidth: 640,
aspectRatio: 16 / 9,
},
});
import React, { useRef, useEffect, useState } from "react";
import { SafeAreaView, StyleSheet, View } from "react-native";
import { LuraPlayer, type UnifiedPlayer, type Configuration } from "@akta-tech/lura-player-react-native";
import { LuraPlayerControls } from "@akta-tech/lura-player-react-native-ui";
export default function App() {
const playerRef = useRef<UnifiedPlayer>(null);
const config: Configuration = {
...
lura: {
token: "<OPTIONAL_TOKEN>",
},
...
};
useEffect(() => {
playerRef.current?.setConfig(config)
}, [playerRef]);
return (
<View>
<SafeAreaView />
<LuraPlayer ref={playerRef} style={styles.player}>
<LuraPlayerControls></LuraPlayerControls>
</LuraPlayer>
</View>
);
}
const styles = StyleSheet.create({
player: {
backgroundColor: "#000",
width: "100%",
maxWidth: 640,
aspectRatio: 16 / 9,
},
});
In addition to the Lura configuration, you can include additional configuration that will be merged with the Play Configuration in the MCP. This can be useful when you need to adjust certain parameters dynamically while keeping others configured through the MCP. For example, you might want to insert client-side ads based on the viewer's subscription plan or device, while still using the analytic credentials specified in the Play Configuration.
import React, { useRef, useEffect, useState } from "react";
import { SafeAreaView, StyleSheet, View } from "react-native";
import { LuraPlayer, type UnifiedPlayer, type Configuration } from "@akta-tech/lura-player-react-native";
import { LuraPlayerControls } from "@akta-tech/lura-player-react-native-ui";
export default function App() {
const playerRef = useRef<UnifiedPlayer>(null);
const config: Configuration = {
...
lura: {
appKey: "<YOUR_APP_KEY>",
assetId: "<ASSET_ID>",
},
controls: {
autoplay: true,
volume: 1.0
}
...
};
useEffect(() => {
playerRef.current?.setConfig(config)
}, [playerRef]);
return (
<View>
<SafeAreaView />
<LuraPlayer ref={playerRef} style={styles.player}>
<LuraPlayerControls></LuraPlayerControls>
</LuraPlayer>
</View>
);
}
const styles = StyleSheet.create({
player: {
backgroundColor: "#000",
width: "100%",
maxWidth: 640,
aspectRatio: 16 / 9,
},
});