Open funniray opened 5 months ago
try following code
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
metalLayer.frame = view.bounds
metalLayer.contentsGravity = .resizeAspect
}
@alexiscn
The code did work and the view does fill the screen, however the metal layer's resolution never changed. I would prefer the resolution of the metal layer to be correct so that subtitles are rendered properly.
You can see in the clip below that the resolution of the metal layer never changed
https://github.com/cxfksword/MPVKit/assets/16416198/0123c438-3ca0-428b-b845-d6507809e04b
You may have a look the plex fix the sizing issue on moltenvk . It seems they have a solution to fix the problem. But I could not make it work.
After quite a bit of trial and error -- and trying the plex fork of mpv -- I don't believe it's currently possible. It doesn't seem like anything that Plex has published so far has had fully working moltenvk resizing... I've tried multiple commits, but nothing appears to work :/
@alexiscn @funniray were either of you able to get the layer to resize correctly when device rotates / orientation changes ?
was any of you able to get the layer to resize correctly when device rotates / orientation changes ?
Nope, I just ended up using openGL for iOS/macOS and then only using metal on tvOS as it's unlikely for a tv to resize.
Hey there,
I've been playing with the demo projects provided, but I don't seem to be able to get MPV to detect the metal layer resizing... I've added the following to
MPVMetalViewController
I can see with the performance overlay that the metal layer has resized, however, the video content isn't modified.
Is there any way to get resizing to work with libmpv on iOS?