简体   繁体   中英

Set background image of AVPlayerViewController

i'm using AVPlayerViewController for playing audios. Reason for using it is that it provides and handles basic controls ie play/pause/slider/volume.

Now, i need to set background image of this view. Image will be fetched from some network location. i debugged AVPlayerViewController's view hierarchy. There's an image view. I'm not sure how to access that or even if it's possible

I don't want to use AVPlayer or AVAudio player as in that case i'll have to handle all the controls.How can i do that?

Yes you can customize AVPlayerViewController by customizing it's contentOverlayView.

Add UIImageView as contentOverlayView.Add button etc also if you want custom design for them too.

controller.contentOverlayView.addsubview(myImageView)

To cahnge color etc:

controller.contentOverlayView.backgroundColor = UIColor(red: 178/255, green: 178/255, blue: 122/255, alpha: 1)

for more check following link

Change AVPlayerViewController background to album artwork objective-c iOS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM