Add jassub/libpgs support on the web

This commit is contained in:
2026-07-13 11:31:31 +02:00
parent 1c7f922996
commit 3c9e850f31
13 changed files with 376 additions and 116 deletions
+12 -6
View File
@@ -1,3 +1,5 @@
import { memo } from "react";
import type { ViewStyle } from "react-native";
import {
getHostComponent,
type HybridViewMethods,
@@ -7,14 +9,18 @@ import { usePlayer } from "./provider";
import type { OmniPlayer } from "./specs/omni-player.nitro";
import type { Props } from "./specs/omni-view.nitro";
import type { OmniViewProps } from "./types/view";
import type { ViewStyle } from "react-native";
import { memo } from "react";
const NativeView = memo(
getHostComponent<Props, HybridViewMethods>("OmniView", () => OmniConfig),
);
export const OmniView = memo((props: OmniViewProps & { style: ViewStyle }) => {
const player = usePlayer() as OmniPlayer;
return <NativeView player={player} {...props} />;
});
export const OmniView = memo(
({
// Web-only; not forwarded to the native view.
subtitleAssets: _subtitleAssets,
...props
}: OmniViewProps & { style: ViewStyle }) => {
const player = usePlayer() as OmniPlayer;
return <NativeView player={player} {...props} />;
},
);