UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

How to PauseDownloadOfMediaToCache

Open JerryMoon opened this issue 3 years ago • 10 comments

I can CancelDownloadOfMediaToCache, but the cached data will be cleared. How to PauseDownloadOfMediaToCache when play video?

JerryMoon avatar Sep 15 '22 08:09 JerryMoon

Is this for Android or iOS?

Chris-RH avatar Sep 15 '22 08:09 Chris-RH

Android. And after mp.Play(), mp.Cache still caching, so I want to Pause Cache to avoid Play(url) stucked.

Another bug: mp.Cache.IsMediaCached() return false, but cache progress is 1. On android.

JerryMoon avatar Sep 15 '22 09:09 JerryMoon

What version of AVPro Video are you using?

Ste-RH avatar Sep 15 '22 09:09 Ste-RH

AVPro Video - Ultra Edition 2.4.1 Unity 2021.3.4f1

JerryMoon avatar Sep 15 '22 10:09 JerryMoon

We are looking into the possibility of adding pause/resume functionality.

Re IsMediaCached(). This was reported a while ago and it appears we did not fully resolve it then : #1063. I will look to resolve it fully this time.

Ste-RH avatar Sep 15 '22 10:09 Ste-RH

Thanks for reply.

I want to know,whether the video will play from cache (if cached progress is 1 from GetCachedMediaStatus). If not, we consider remove cache code from project for now.

JerryMoon avatar Sep 15 '22 11:09 JerryMoon

The answer to 'will the video play from cache?' is not as straight forward to answer.

If GetCachedMediaStatus() returns...

CachedMediaStatus.Cached : then the video is downloaded and will playback completely from the cache.

CachedMediaStatus.Caching : then the video might playback from thee cache. This is determined by how much of the video has been cached (you can obtain this in 'progress'), and where the playback head (current position) is.

Unfortunately there is no simple way we can report back a true/false on the question other than if the entire video is cached. That said...there is an exception to this is. If you have previously downloaded a video that has multiple variants, via resolution/bitrate, and then want to playback without limitation (or different limitations).

Ste-RH avatar Sep 15 '22 11:09 Ste-RH

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 25 '22 20:09 stale[bot]

We will be adding pause/resume functionality (Android support only at this stage) to the next release (v2.6.3)

Ste-RH avatar Sep 26 '22 11:09 Ste-RH

The latest version has been released. This function has been added to Android only at this stage. Please let us know if this issue has not been fixed for you.

Chris-RH avatar Sep 27 '22 08:09 Chris-RH