The desired limit, in bits per second, of network bandwidth consumption for this item.
Declaration
var preferredPeakBitRate: Double { get set }
Discussion
Set preferredPeakBitRate to non-zero to indicate that the player should attempt to limit item playback to that bit rate, expressed in bits per second.
If network bandwidth consumption cannot be lowered to meet the preferredPeakBitRate, it will be reduced as much as possible while continuing to play the item.`
just need to set preferredPeakBitRate directly to the current AVPlayerItem instance, then the player will take care of handling the peak bitrate automatically. Don't need to create new and replace anything.
References:
https://developer.apple.com/documentation/avfoundation/avplayeritem/1388541-preferredpeakbitrate https://forums.developer.apple.com/thread/75994