Down loading mp4

Mikie

Member
Licensed User
Longtime User
I am using the following code to download mp4's
--------------------------------------------
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim URL As String
'URL = "http://pirsqrt.com/EduscapeWP/Movies/LinearEq3a.mp4"
URL = "http://pirsqrt.com/EduscapeWP/Movies/TrigDerv1a.mp4"
Dim HttpClient1 As HttpClient


End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
HttpClient1.Initialize("Http")
End If
Dim request As HttpRequest
request.InitializeGet(URL)
HttpClient1.Execute(request, 1)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
'this works down loaded LinearEq
Sub Http_ResponseSuccess(Response As HttpResponse, TaskId As Int)
Response.GetAsynchronously("ResponseSub", File.OpenOutput _
(File.DirRootExternal, "TrigMovie.mp4", False), True, TaskID)
End Sub

Sub ResponseSub_StreamFinish (Success As Boolean, TaskId As Int)
'work with downloaded file
End Sub

---------------------------------------------------
And it works great. I would like the user see there is a download happing.
Can this be accomplished.
 

Mikie

Member
Licensed User
Longtime User
No, the file is an mp4. A progress bar would be nice. Is there a code sample somewhere?
 
Upvote 0

Mikie

Member
Licensed User
Longtime User
Erel,

Thanks, I have a nice little counter for the mp4 download. I have about 200 movies that I used in my classes over the last 10 years. Now they will appear in my apps. b4a is great. Could not make this happen with AI.

Mikie
 
Upvote 0
Top