Jump to content
GreenSock

dmen

Video - use cached version

Moderator Tag

Recommended Posts

I have a situation where I need to play a video from a URL - sometimes that URL will work fine (most of the time...) but sometimes there could be a loss of connectivity. In the case where there's a connection problem, I want to play the last video that was loaded successfully. Is this something LoaderMax will handle already or do I need to implement it myself? 

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

The only convenience that is built into the API for this scenario is that you can specify an alternateURL for each VideoLoader

 

  • alternateURL : String - If you define an alternateURL, the loader will initially try to load from its original url and if it fails, it will automatically (and permanently) change the loader's url to the alternateURL and try again. Think of it as a fallback or backup url. It is perfectly acceptable to use the same alternateURL for multiple loaders (maybe a default image for various ImageLoaders for example).

http://greensock.com/asdocs/com/greensock/loading/VideoLoader.html

 

If you want to default to the last video that you loaded, then you would have to use some custom code when you detect the load failure.

Link to comment
Share on other sites

Thanks!

 

Can the alternateURL point to a local file?

Link to comment
Share on other sites

Most likely no, unless your swf and html file are both running locally and you know the path from your html page to the video. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×