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
According to the #5978, This is fully implemented the parallelize segment downloads. So recently I have done some tests about this feature with the dev-v2 branch's demo. It's amazing work. When parallelize segment downloads, the network can remain more fully utilized. But I may add some bad affect for smooth playback. Whether add some strategy to trade-off between download speed and smooth playback.
The specific user scenario is described as follows:
When the background is downloading video programs, if the user want to start playing other program, whether could add some restrictions to ensure the smooth playback of the program.
For example:
Whether can set the priority of the background download task. Only when the player is in the READY state , the background thread will start downloading.
Or set a bandwidth limit on the download task when the player is playing other program.
The text was updated successfully, but these errors were encountered:
Have you tried using PriorityTaskManager for this. It's not very obvious, but if you build your DownloadManager like this:
downloadManager =
new DownloadManager(
this,
new DefaultDownloadIndex(databaseProvider),
new DefaultDownloaderFactory(
new CacheDataSource.Factory()
.setCache(getDownloadCache())
.setUpstreamDataSourceFactory(buildHttpDataSourceFactory())
.setUpstreamPriorityTaskManager(getPriorityTaskManager()),
Executors.newFixedThreadPool(/* nThreads= */ 6)));
and set the samePriorityTaskManager instance on your player:
then downloads will automatically stop/start internally when the player starts/stops buffering. Notes:
This will not be visible as the notification appearing and disappearing since this would be very noisy, but internally the downloads will be stopping and starting appropriately to avoid clashing with the player needing to buffer.
It's not perfect because I think it'll do this even if the player is buffering from local files, for which it's arguably unnecessary. But in practice it works pretty well.
If you want more fine-grained control, I think you can probably implement this by implementing either the Executor or the upstream DataSource.Factory that the DownloadManager uses to be more aware of playback. If you're reusing the same Executor that your app is using for other background downloads, then making the Executor playback aware may yield some additional benefits. I would envisage this type of integration would need to be done on an app specific basis.
Please let me know if PriorityTaskManager helps. If it does, we should probably document this at https://exoplayer.dev/downloading-media.html (and make it easier to build a DownloadManager that uses one).
Please let me know if PriorityTaskManager helps. If it does, we should probably document this at https://exoplayer.dev/downloading-media.html (and make it easier to build a DownloadManager that uses one).
[REQUIRED] Question
According to the #5978, This is fully implemented the parallelize segment downloads. So recently I have done some tests about this feature with the dev-v2 branch's demo. It's amazing work. When parallelize segment downloads, the network can remain more fully utilized. But I may add some bad affect for smooth playback. Whether add some strategy to trade-off between download speed and smooth playback.
The specific user scenario is described as follows:
When the background is downloading video programs, if the user want to start playing other program, whether could add some restrictions to ensure the smooth playback of the program.
For example:
Whether can set the priority of the background download task. Only when the player is in the
READY
state , the background thread will start downloading.Or set a bandwidth limit on the download task when the player is playing other program.
The text was updated successfully, but these errors were encountered: