Start At Configuration
Wievers like to continue watching the video from where they have left. That's where startAt parameter comes in handy. With this parameter, you can specify where the video playback should start from. This parameter empowers users to have a more tailored and efficient video-watching experience by providing them with direct control over where their viewing journey begins.
To configure the starting position of the video in Lura Player, you can use the following configuration.
Attribute | Type | Description |
---|---|---|
startAt | number | Starting position of the content in seconds. |
info
The startAt parameter is applicable exclusively to VOD (Video On Demand) assets and should not be utilized for live streams.
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 = {
...
content: {
startAt: 30
}
...
};
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,
},
});