mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +00:00
Add jassub/libpgs support on the web
This commit is contained in:
+12
-6
@@ -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} />;
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user