RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
224 stars 27 forks source link

Question for caching feature. #1841

Closed dw8869 closed 1 week ago

dw8869 commented 2 months ago

I understand that the timing of the cache call should be called before the video is opened. https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1791#issuecomment-2009454145

our use case does not know if it is a VOD or livestream before we open the video.

If I tried cache before opening the video, and it's livestream, I get an error. https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1635#issuecomment-1721112853

Can you suggest a solution?

Chris-RH commented 2 months ago

The issue is that we don't know if its a VOD or livestream until the URL is opened either. Are these URLs that you are choosing or is a customer choosing them?

dw8869 commented 2 months ago

Maybe customer will choose.

Chris-RH commented 1 month ago

As I've said, we don't know if its a VOD or livestream until after the URL is opened. If you are opening the URL then you have three choices.

  1. Cache video. If its good the play from cache. If there is an error, then play from the source.
  2. Open the video without playing. See if it a livestream or a VOD. If it is a livestream then play from source. If it is a VOD then close video and go back to cache it.
  3. Parse the manifest yourselves to see if it is a livestream or VOD
dw8869 commented 1 month ago

I'll try case 2. Thank you for your help.

dw8869 commented 1 month ago

@Chris-RH For Case 2, open the video without playing it and call it AddMediaToCache. If you check with an app that can check your network usage, your network usage is increasing even after the video cache is complete. It only happens on the first play and not when you restart the app.

Chris-RH commented 3 weeks ago

Does it stop after you have finished playing the video?

dw8869 commented 3 weeks ago

Network usage will continue to occur unless the video is completely closed and opened.