FB9042670: Support videos with alpha channel in AVPlayerView
- Date: 2021-03-15
- Resolution: Open
- Area: AVKit
- OS: macOS 11.2.1
- Type: Suggestion
Description
WWDC 2019 announced support for HEVC video with alpha channel support and mentioned that AVPlayer and AVPlayerLayer then supported it. However, it seems like AVPlayerView never received support for alpha channel. It would be great if AVPlayerView supported alpha channel too. If you play a video with an alpha channel, it just gets a black background.
You can reproduce this by downloading the https://apps.apple.com/no/app/gifski/id1351639930?mt=12 app and dragging the attached video (which has an alpha channel) into it and notice how the video has a black background in the player there. However, if you Quick Look that video in Finder, it shows with a transparent background.
Files
Looking at this example it seems to work (also for me)
https://developer.apple.com/documentation/avfoundation/using-hevc-video-with-alpha
That sample code has no usage of AVPlayerView.
Ah true. They simply use AVPlayer for it.