feat: support start time

This commit is contained in:
Fredrik Burmester
2024-10-16 08:21:42 +02:00
parent 951a9d08ba
commit fcffee1981
3 changed files with 10 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ export type VlcPlayerSource = {
autoplay?: boolean;
initOptions?: any[];
mediaOptions?: { [key: string]: any };
startPosition?: number;
};
export type TrackInfo = {

View File

@@ -101,6 +101,10 @@ const VlcPlayerView = React.forwardRef<VlcPlayerViewRef, VlcPlayerViewProps>(
const processedSource: VlcPlayerSource =
typeof source === "string" ? { uri: source } : source;
if (processedSource.startPosition !== undefined) {
processedSource.startPosition = Math.floor(processedSource.startPosition);
}
return (
<NativeView
{...otherProps}