我正在使用 twilio 发送视频并在场景包中使用该视频作为纹理。但问题是它在 iPhone X 上运行良好,但Unsupported IOSurface format: 0x26424741
在 iPhone XR 和 XS 上却出现了这个错误。
这就是我正在做的事情:
获取视频:
func subscribed(to videoTrack: TVIRemoteVideoTrack, publication: TVIRemoteVideoTrackPublication, for participant: TVIRemoteParticipant) {
print("Participant \(participant.identity) added a video track.")
let remoteView = TVIVideoView.init(frame: UIWindow().frame,
delegate:self)
videoTrack.addRenderer(remoteView!)
delegate.participantAdded(with: remoteView!)
}
代表:
func participantAdded(with videoView: UIView) {
sceneView.addVideo(with: videoView)
}
并将视频添加到飞机:
func addVideo(with view: UIView){
videoPlane.geometry?.firstMaterial?.diffuse.contents = view
}