(null);
+
+ useImperativeHandle(ref, () => ({
+ play: async () => {
+ await nativeRef.current?.play();
+ },
+ pause: async () => {
+ await nativeRef.current?.pause();
+ },
+ seekTo: async (position: number) => {
+ await nativeRef.current?.seekTo(position);
+ },
+ seekBy: async (offset: number) => {
+ await nativeRef.current?.seekBy(offset);
+ },
+ setSpeed: async (speed: number) => {
+ await nativeRef.current?.setSpeed(speed);
+ },
+ getSpeed: async () => {
+ return await nativeRef.current?.getSpeed();
+ },
+ isPaused: async () => {
+ return await nativeRef.current?.isPaused();
+ },
+ getCurrentPosition: async () => {
+ return await nativeRef.current?.getCurrentPosition();
+ },
+ getDuration: async () => {
+ return await nativeRef.current?.getDuration();
+ },
+ startPictureInPicture: async () => {
+ await nativeRef.current?.startPictureInPicture();
+ },
+ stopPictureInPicture: async () => {
+ await nativeRef.current?.stopPictureInPicture();
+ },
+ isPictureInPictureSupported: async () => {
+ return await nativeRef.current?.isPictureInPictureSupported();
+ },
+ isPictureInPictureActive: async () => {
+ return await nativeRef.current?.isPictureInPictureActive();
+ },
+ getSubtitleTracks: async () => {
+ return await nativeRef.current?.getSubtitleTracks();
+ },
+ setSubtitleTrack: async (trackId: number) => {
+ await nativeRef.current?.setSubtitleTrack(trackId);
+ },
+ disableSubtitles: async () => {
+ await nativeRef.current?.disableSubtitles();
+ },
+ getCurrentSubtitleTrack: async () => {
+ return await nativeRef.current?.getCurrentSubtitleTrack();
+ },
+ addSubtitleFile: async (url: string) => {
+ await nativeRef.current?.addSubtitleFile(url);
+ },
+ setSubtitlePosition: async (position: number) => {
+ await nativeRef.current?.setSubtitlePosition(position);
+ },
+ setSubtitleScale: async (scale: number) => {
+ await nativeRef.current?.setSubtitleScale(scale);
+ },
+ setSubtitleMarginY: async (margin: number) => {
+ await nativeRef.current?.setSubtitleMarginY(margin);
+ },
+ setSubtitleAlignX: async (alignment: "left" | "center" | "right") => {
+ await nativeRef.current?.setSubtitleAlignX(alignment);
+ },
+ setSubtitleAlignY: async (alignment: "top" | "center" | "bottom") => {
+ await nativeRef.current?.setSubtitleAlignY(alignment);
+ },
+ setSubtitleFontSize: async (size: number) => {
+ await nativeRef.current?.setSubtitleFontSize(size);
+ },
+ }));
+
+ return ;
+ },
+);
diff --git a/modules/mpv-player/src/MpvPlayerView.web.tsx b/modules/mpv-player/src/MpvPlayerView.web.tsx
new file mode 100644
index 00000000..5b874cc9
--- /dev/null
+++ b/modules/mpv-player/src/MpvPlayerView.web.tsx
@@ -0,0 +1,14 @@
+import { MpvPlayerViewProps } from "./MpvPlayer.types";
+
+export default function MpvPlayerView(props: MpvPlayerViewProps) {
+ return (
+
+
+ );
+}
diff --git a/modules/mpv-player/src/index.ts b/modules/mpv-player/src/index.ts
new file mode 100644
index 00000000..5537cee7
--- /dev/null
+++ b/modules/mpv-player/src/index.ts
@@ -0,0 +1,3 @@
+export * from "./MpvPlayer.types";
+export { default as MpvPlayerModule } from "./MpvPlayerModule";
+export { default as MpvPlayerView } from "./MpvPlayerView";