AVPlayerVideoOutput on visionOS

I'm trying to decode MV-HEVC videos on visionOS, but I noticed the normal API for using AVPlayer (AVPlayerVideoOutput and some new methods for setting videoOutput on AVPlayer) are not available in visionOS 1.0.

They're only available in iOS 17.2 and macOS 14.2 and the header claims visionOS 1.1 but it doesn't say that in the Apple documentation anywhere. Does this mean there's really no way to work on this functionality at this time (!) This seems like a major omission given we can't even target visionOS 1.1 with the beta version of Xcode. Can you please move this API forward into visionOS 1.0.

maybe try

    let entity = Entity()
    let url = URL(string: url)
    let asset = AVURLAsset(url: url!)
    let playerItem = AVPlayerItem(asset: asset)

    let player = AVPlayer()
    
    var videoPlayerComponent = VideoPlayerComponent(avPlayer: player)
    videoPlayerComponent.isPassthroughTintingEnabled = true
    
    entity.components[VideoPlayerComponent.self] = videoPlayerComponent
    
    entity.scale *= 1
    player.replaceCurrentItem(with: playerItem)
    
    player.play()

    return entity
}

@state var urlString = ""
RealityView{content in
    content.add(makeMvEntity(url: urlString))
}

Thanks so much for that and I’ll see if there some work around I can develop for grabbing the view contents and sending them into Metal, since I need the raw pixel data to do processing on it.

AVPlayerVideoOutput on visionOS
 
 
Q