kingslay / KSPlayer

A video player for iOS、macOS、tvOS、visionOS , based on AVPlayer and FFmpeg, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, SwiftUI, support subtitles.
https://apps.apple.com/app/tracyplayer/id6450770064
GNU General Public License v3.0
980 stars 198 forks source link

VisionOS: 在ImmersiveSpace中渲染基于Metal的VR视频 #706

Open Vertroid opened 9 months ago

Vertroid commented 9 months ago

您好,这边算是Swift和visionOS的初学者,目前正在尝试了解KSMEPlayer相关的实现。 想了解下如果我这边想尝试直接在ImmersiveSpace中渲染Sphere或Box,这个模块应该朝着什么方向去修改呢?目前是没法直接显示,不知道是不是KSVideoPlayer本身封装成UIView的原因

kingslay commented 9 months ago

我这个项目是支持sphere和box的。 需要你对KSOptions进行设置。但是我没有在ImmersiveSpace上试过。不知道效果如何。

public enum DisplayEnum {
    case plane
    // swiftlint:disable identifier_name
    case vr
    // swiftlint:enable identifier_name
    case vrBox
}
Vertroid commented 9 months ago

好的,这些选项我也都大致了解过了,目前我只是简单粗暴把KSVideoPlayer放到了CompositorLayer里面(KSOptions里面先配置了KSMEPlayer,VR之类的设置),但是只有黑屏,不知道能不能单独拿出里面的Renderer

kingslay commented 2 months ago

你可以试下我的app,应该是不会黑屏的