Is it possible to achieve partial preloading of videos(mp4 and hls) via AVAssetDownloadTask

My app uses AVPlayer for video playback, and now I have a requirement to start pre-loading video content before entering the video playback page.

I want to pre-load as little content as possible, as long as the video can start playing quickly after entering the video playback page. It seems that AVAssetDownloadTask can achieve my requirement, but I encountered several problems

  1. How can I control the AVAssetDownloadTask to load only the first few seconds of the video before going to the video playback page?

  2. How to bind the first few seconds of the downloaded part of the video to the url , so that I can continue to use the downloaded part to quickly open the video after I restart the app.

  3. Does AVAssetDownloadTask support mp4 to achieve the same function?

How is it going? Do you make it now?

Is it possible to achieve partial preloading of videos(mp4 and hls) via AVAssetDownloadTask
 
 
Q