I'm trying to check that my URL transfers are working as well, and this post was very helpful in understanding the proper approach to do so. However, my scenario is slightly different in that I want to both call a URL at the beginning of playback, but also at certain increments of progress as well. Simply put, I need to call some impression URLs before the video starts, and then I also need to call some additional progress related urls at for example 25%, 50%, 75%, completion.
To handle the progress side of things I've setup some code to fire off as the playback position reaches a certain milestone.
Here is a stripped down version of this part of my loop:
If marker = "midpoint" And Int((m.position / m.duration) * 100) > 49 And m.vastMp = False
PrettyPrint("Called Midpoint Url: " + url) '// PrettyPrint() = Custom function to print out formatted debug info.
vastProgressUrl.SetUrl(url)
vastProgressUrl.AsyncGetToString()
m.vastMp = True '// This just makes sure that each milestone is printed once
End If
I create the vastProgressUrl right before the overall event loop for the port:
vastProgressUrl = CreateObject("roUrlTransfer")
vastProgressUrl.SetPort(messagePort)
And I have the following in my event loop:
msg = wait(100, messagePort)
'// URL Transfer Events
If Type(msg) = "roUrlEvent" Then
'// And if response code == OK
If msg.GetResponseCode() = 200 Then
'// Assign Response
Print "Success: " msg.GetResponseCode()
Else
Print "Failed response. Reponse Code: " + msg.GetResponseCode()
End If
End If
For some reason I'm not seeing anything back from this pass or fail. So I'm wondering if it is an issue with the loop and me making the URL requests inside of it. Any ideas?