What is hasProtectedContent for AVAsset

865 Views Asked by At

I notice this property hasProtectedContent in the AVAsset which is very vaguely defined.

Assets containing protected content may not be playable without successful authorization, even if the value of the playable property is YES. [doc]

Can someone elaborate what is protected content property means and when it will be true? Is it always required (or good practice) to check for this value before attempting to play the video?

1

There are 1 best solutions below

0
On BEST ANSWER

I am not sure what it means for third party sources, but this property is used to detect whether an asset is DRM protected or not. In my case, I use it to check if a chosen song from user's music library is DRM protected or not as the songs from Apple Music (subscription) are DRM protected. hasProtectedContent is true for such songs and false for the ones which are DRM-free. Such DRM-protected songs cannot be played by AVPlayer and only by MPMusicPlayer.

If you are interested in detecting whether an asset is DRM protected or in playing such assets the right way, you can read my detailed answer here: https://stackoverflow.com/a/47694472/4331787