I wish to change the default background color from black to a color that i desire. Possibly to a color which contrasts the video (which is black most of the time).
I have added this piece of code in my viewWillAppear()
function:
let playerLayer = AVPlayerLayer(player: player)
playerLayer.backgroundColor = UIColor.blueColor().CGColor
The black color of the background is the backgroundColor of the AVPlayerView ‐ Controller’s view, which you are free to change.
For example:
let av = AVPlayerViewController()
av.view.backgroundColor = UIColor.whiteColor()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With