How can I able to set low or high quality video withstreaming video with AVPlayer?
My code is as follow:
self.videoPlayerItem = [AVPlayerItem playerItemWithURL:videoUrl];
videoPlayer = [AVPlayer playerWithPlayerItem:self.videoPlayerItem];
videoPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;
CGRect frame = self.frame;
videoPlayerLayer = [AVPlayerLayer layer];
[videoPlayerLayer setPlayer:videoPlayer];
[videoPlayerLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill];
Thanks for your time
You can lower the video quality/bitrate by setting AVPlayerItem's preferredPeakBitRate.
Re-set it to zero to get the usual "highest quality/bitrate supported by your connection" behaviour.
N.B. A bitrate less than or equal to preferredPeakBitRate must be available for this to work, e.g. in an HLS stream.
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