I'm using AVPlayer
to play video from Internet, is there a way to pause/resume preloading video when pause/resume playing?
One way to do that would be to save your AVURLAsset
to a variable (tempAsset = player.playerItem.asset
), and then replace the playerItem
in your player with nil. When you are ready to play it again, you can create a new playerItem
from the asset that you saved previously.
I have same problem and i used buffer limit to stop preloading in my code. This works for me.
You can also try setting buffer limit to stop preloading video when you click on Pause or Resume.
I hope this will help you.
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