You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provides an easy way to kick off a download like this
Celestial.shared.startDownload(for: url)
By hooking into uikit method -
extensionVideoVC:UICollectionViewDataSourcePrefetching{func collectionView(_ collectionView:UICollectionView, prefetchItemsAt indexPaths:[IndexPath]){
// urls for next video in collectionview
Celestial.shared.startDownload(for: url) // go and get the video
}}
We can eagerly kick off the download in background - no ui /and then user scrolls to video / or navigates to the page where it's needed - it will then automatically intercept the request in background and make plays in player.
If i understand correctly, you want preload some videos, but don't want them to start playing automatically, wait until the cell slides to the position.
I took a look at the startDownload function of Celestial repo. This function is just to make regular file download request, and then there may be some managers to manage the download status to these files.
This kind of operation may seem to make the video play smoothly when the cell scrolls, but it may cause some side effects. E.g:
It will download entire file, if there are many files and size is large, it will affect the current video to be played.
If current network is poor, it also affect the current video playing.
In most cases, downloading the whole file is a waste.
But if you just want to achieve this function, you can use a dedicated library to pre-downloading, like this one? Then set the downloaded file path to the player when needed, or set remote url if it is not downloaded.
The best solution is to provide a preload function in the library, preload part of the content at the beginning, and then use it in conjunction with the existing cache function. This will take a lot of time to implement, maybe I will do this later if i have enough time.
EAGER LOADING
This repo by @ChrishonWyllie
https://github.com/ChrishonWyllie/Celestial
Provides an easy way to kick off a download like this
Celestial.shared.startDownload(for: url)
By hooking into uikit method -
We can eagerly kick off the download in background - no ui /and then user scrolls to video / or navigates to the page where it's needed - it will then automatically intercept the request in background and make plays in player.
Can this repo do this?
The text was updated successfully, but these errors were encountered: