Go back to vlc4

This commit is contained in:
Alex Kim
2025-07-12 17:54:40 +10:00
parent ebe36774b0
commit b6eb8249b0
11 changed files with 41 additions and 534 deletions

View File

@@ -1,8 +1,6 @@
import { requireNativeViewManager } from "expo-modules-core";
import * as React from "react";
import { VideoPlayer, useSettings } from "@/utils/atoms/settings";
import { Platform, ViewStyle } from "react-native";
import { ViewStyle } from "react-native";
import type {
VlcPlayerSource,
VlcPlayerViewProps,
@@ -14,22 +12,10 @@ interface NativeViewRef extends VlcPlayerViewRef {
}
const VLCViewManager = requireNativeViewManager("VlcPlayer");
const VLC3ViewManager = requireNativeViewManager("VlcPlayer3");
// Create a forwarded ref version of the native view
const NativeView = React.forwardRef<NativeViewRef, VlcPlayerViewProps>(
(props, ref) => {
const [settings] = useSettings();
if (Platform.OS === "ios" || Platform.isTVOS) {
if (settings.defaultPlayer === VideoPlayer.VLC_3) {
console.log("[Apple] Using Vlc Player 3");
return <VLC3ViewManager {...props} ref={ref} />;
}
}
console.log("Using default Vlc Player");
return <VLCViewManager {...props} ref={ref} />;
},
(props, ref) => <VLCViewManager {...props} ref={ref} />,
);
const VlcPlayerView = React.forwardRef<VlcPlayerViewRef, VlcPlayerViewProps>(