I user this library for playing video from URL. and I am able to play video.
Now I want to change the currently playing video quality like (low, medium, high).
It uses AVPlayer and how can i change quality with AVPlayer?
I listen about preferredPeakBitRate but I have no idea about it.
Please help me how can i do that?
You cannot set video quality directly on the
AVPlayer
, however, you can do this by accessingvideoComposition
property onAVPlayerItem
which is then supplied toAVPlayer
(via for examplereplaceCurrentItem:
method or on AVPlayer initialization). So:AVPlayerItem
'sAVVideoComposition
instance, and set it'sframeDuration
,renderSize
andrenderScale
properties. Take a look in docs for more info.videoComposition
property,AVPlayerItem
instance (again, look in docs for details).If you want to do this on the fly while playing movie, adjustments of time for player item should be done I guess.