Fixed subtitle sizes

This commit is contained in:
Alex Kim
2024-10-29 00:49:22 +11:00
parent a1fe226d22
commit ad43ee7585
3 changed files with 4 additions and 8 deletions

View File

@@ -193,6 +193,7 @@ export default function page() {
uri: playUrl, uri: playUrl,
autoplay: true, autoplay: true,
isNetwork: false, isNetwork: false,
initOptions: ["--sub-text-scale=60"],
}} }}
style={{ width: "100%", height: "100%" }} style={{ width: "100%", height: "100%" }}
onVideoProgress={onProgress} onVideoProgress={onProgress}

View File

@@ -352,6 +352,7 @@ export default function page() {
autoplay: true, autoplay: true,
isNetwork: true, isNetwork: true,
startPosition, startPosition,
initOptions: ["--sub-text-scale=60"],
}} }}
style={{ width: "100%", height: "100%" }} style={{ width: "100%", height: "100%" }}
onVideoProgress={onProgress} onVideoProgress={onProgress}

View File

@@ -95,9 +95,8 @@ class VlcPlayerView: ExpoView {
guard let self = self else { return } guard let self = self else { return }
let mediaOptions = source["mediaOptions"] as? [String: Any] let mediaOptions = source["mediaOptions"] as? [String: Any]
let initOptions = source["initOptions"] as? [Any] let initOptions = source["initOptions"] as? [Any] ?? []
let uri = source["uri"] as? String let uri = source["uri"] as? String
let initType = source["initType"] as? Int ?? 0
let autoplay = source["autoplay"] as? Bool ?? false let autoplay = source["autoplay"] as? Bool ?? false
let isNetwork = source["isNetwork"] as? Bool ?? false let isNetwork = source["isNetwork"] as? Bool ?? false
let startPosition = source["startPosition"] as? Int32 ?? 0 let startPosition = source["startPosition"] as? Int32 ?? 0
@@ -109,12 +108,7 @@ class VlcPlayerView: ExpoView {
} }
self.onVideoLoadStart?(["target": self.reactTag ?? NSNull()]) self.onVideoLoadStart?(["target": self.reactTag ?? NSNull()])
self.mediaPlayer = VLCMediaPlayer(options: initOptions)
if initType == 2, let options = initOptions {
self.mediaPlayer = VLCMediaPlayer(options: options)
} else {
self.mediaPlayer = VLCMediaPlayer()
}
self.mediaPlayer?.delegate = self self.mediaPlayer?.delegate = self
self.mediaPlayer?.drawable = self.videoView self.mediaPlayer?.drawable = self.videoView