feat(mpv): add opaque subtitle background with adjustable opacity (iOS only)

This commit is contained in:
Fredrik Burmester
2026-02-01 17:29:31 +01:00
parent ab526f2c6b
commit bc575c26c1
9 changed files with 142 additions and 51 deletions

View File

@@ -84,6 +84,17 @@ export default React.forwardRef<MpvPlayerViewRef, MpvPlayerViewProps>(
setSubtitleFontSize: async (size: number) => {
await nativeRef.current?.setSubtitleFontSize(size);
},
setSubtitleBackgroundColor: async (color: string) => {
await nativeRef.current?.setSubtitleBackgroundColor(color);
},
setSubtitleBorderStyle: async (
style: "outline-and-shadow" | "background-box",
) => {
await nativeRef.current?.setSubtitleBorderStyle(style);
},
setSubtitleAssOverride: async (mode: "no" | "force") => {
await nativeRef.current?.setSubtitleAssOverride(mode);
},
// Audio controls
getAudioTracks: async () => {
return await nativeRef.current?.getAudioTracks();