feat: scale factor and aspect ratio (#942)

This commit is contained in:
Fredrik Burmester
2025-08-18 14:24:45 +02:00
committed by GitHub
parent 4fed25a3ab
commit 9410239c48
10 changed files with 361 additions and 43 deletions

View File

@@ -243,6 +243,26 @@ class VlcPlayerView: ExpoView {
return tracks
}
@objc func setVideoAspectRatio(_ aspectRatio: String?) {
DispatchQueue.main.async {
if let aspectRatio = aspectRatio {
// Convert String to C string for VLC
let cString = strdup(aspectRatio)
self.mediaPlayer?.videoAspectRatio = cString
} else {
// Reset to default (let VLC determine aspect ratio)
self.mediaPlayer?.videoAspectRatio = nil
}
}
}
@objc func setVideoScaleFactor(_ scaleFactor: Float) {
DispatchQueue.main.async {
self.mediaPlayer?.scaleFactor = scaleFactor
print("Set video scale factor: \(scaleFactor)")
}
}
@objc func stop(completion: (() -> Void)? = nil) {
guard !isStopping else {
completion?()