EngoTom
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2010
09:52 AM
Media not found event?
I have a scenario where if a media item is not found at its location use a backup media location.
I'd like to do this through a media load method with a timeout property and an event that is raised if it’s not found.
Is this available? If not is there a recommended approach?
THX
Tom
I'd like to do this through a media load method with a timeout property and an event that is raised if it’s not found.
Is this available? If not is there a recommended approach?
THX
Tom
2 REPLIES 2

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2010
05:23 PM
Re: Media not found event?
We don't have an auto-retry to a different media location.....
I suggest you code it in your app. You can check the media url first with roUrlTransfer and if it doesn't exist use the backup media location. You can use the Range: header in your request to check existence of URL without downloading a lot of data.
--Kevin
I suggest you code it in your app. You can check the media url first with roUrlTransfer and if it doesn't exist use the backup media location. You can use the Range: header in your request to check existence of URL without downloading a lot of data.
Function isUrlValid(url As String) As Boolean
urlValid = false
http = CreateObject("roUrlTransfer")
http.SetPort(CreateObject("roMessagePort"))
http.SetUrl(url)
http.AddHeader("Range","bytes=0-15")
if (http.AsyncGetToString())
event = wait(5000, http.GetPort())
if type(event) = "roUrlEvent"
if (event.GetResponseCode() >= 200 and event.GetResponseCode() < 300) then
response = event.GetString()
print "response: "; response
urlValid = true
end if
elseif event = invalid
http.AsyncCancel()
else
http.AsyncCancel()
endif
endif
return urlValid
End Function
--Kevin
EngoTom
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2010
11:42 AM
Re: Media not found event?
Thanks, Just what I needed.