reports icon indicating copy to clipboard operation
reports copied to clipboard

FB9042670: Support videos with alpha channel in AVPlayerView

Open sindresorhus opened this issue 4 years ago • 3 comments

  • 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

HEVC video with alpha channel.zip

sindresorhus avatar Mar 14 '21 17:03 sindresorhus

Looking at this example it seems to work (also for me)

https://developer.apple.com/documentation/avfoundation/using-hevc-video-with-alpha

obrhoff avatar Oct 14 '25 07:10 obrhoff

That sample code has no usage of AVPlayerView.

sindresorhus avatar Oct 14 '25 08:10 sindresorhus

Ah true. They simply use AVPlayer for it.

obrhoff avatar Oct 14 '25 08:10 obrhoff