Android Question Download multiple video files with its title

GudEvil

Member
Licensed User
Longtime User
I had to download multiple video files n its heading frrom mysql database.

n it will show as listing with heading+ video file. If user clicks on video box then it downloads n plays video ...


P.S. I can now able to do it for single record but it should work for more than that...

any help appriciated...
 

DonManfred

Expert
Licensed User
Longtime User
Search forum for httputils tutorials/examples.
Search for RDC (Remote Database Connector) or use one of the exiting librarys to connect to your database.
You can also do it with httputils and php (on server side). For this you can find Tutorials too.

Just use the forum search. You will find all you need
 
Upvote 0

GudEvil

Member
Licensed User
Longtime User
thanks for reply.

But I already able to download n play a single video file using http2utils n download service.

But I had to do this for multiple video files at one go...
Scenario would be once user open page, all video listing with its title(sequence is must as retrieve from server)... then as user click-n-play video..

My issue is once I get persistent video path from sql server, I add to scrollview_panel but next sql record should be added to subsequent scrollview...
but actually it takes time to download video from server n all videos all added to last scrollview panel n top scrollview panels are empty...

??????


P.S. I had to do this for images to but I used picaso library n it worked perfectly..is their something similar
B4X:
                    Dim imageview1 As ImageView
                    Dim picaso As Picasso
                    picaso.Initialize
                    imageview1.Initialize("")
                    panel1.AddView(imageview1,x,y,x1,y1)
                    picaso.LoadUrl(downurl&values1(1).Text).IntoImageView(imageview1)
 
Upvote 0

GudEvil

Member
Licensed User
Longtime User
I retrive sql record thru json n parse (single record contains _title, _video_path)
this is in jobdone

Then I initilise panel in scroll view n add two fields _title, _panel_for_video_view
if user clicks on panel then video gets downloaded to another job initiatiated with htto2utils+download()
In jobdone_video_download video gets downloaded n stored in local storage n then play.

But till json parser finished initilazion of all sql records... n all video_view showed in last scrollview panel only...

please let me know I have any logical bug??
 
Upvote 0

GudEvil

Member
Licensed User
Longtime User
B4X:
            Case "test_10"
                Dim result As List
                result = parser.NextArray 'returns a list with maps
                If result.Size=0 Then
                    Msgbox("No Result Found","Error")
                End If
                Dim panel1,panel2 As Panel
                If scrollview2.IsInitialized Then
                    scrollview2.RemoveView
                End If
                scrollview2.Initialize(0)
                NavDrawer.ContentPanel.AddView(scrollview2,0,selected_page1.Height,pContent.Width,pContent.Height-footer1.Height-selected_page1.Height)
                panel1=scrollview2.Panel

                    Dim ii As Int =0
                    Dim i As Int =0
                For i = 0 To result.Size - 1
                    Dim m As Map
                    m = result.Get(i)

                    Dim values1(2) As Label
                    values1(0).Initialize("")
                    values1(1).Initialize("")
                    values1(0).Text=m.Get("heading")
                    values1(1).Text=m.Get("name")
                    values1(0).Tag=ii
'                    values1(1).Tag=values1(2).Text
                    values1(0).TextSize=13
                   
                    panel1.AddView(values1(0),    10dip,    40dip+(ii*230dip),    pContent.Width-20dip,    15dip)
                   
                    panel2.Initialize("video_play_1")      'create event when user click on video panel it downloads video from its tag..
                    panel2.Tag=downurl_video&values1(1).Text   ' video persistent url attachted to panel
                    panel1.AddView(panel2,    10dip,    55dip+(ii*230dip),    pContent.Width-20dip,    200dip)
                    panel2.SetBackgroundImage(LoadBitmap(File.DirAssets,"playvideo.jpg"))
'                    g_panel=panel2

                    ii=ii+1
                Next



B4X:
            Case "test_0_10_v_v"  '' in same jobdone but job is initilised for video doenload 
                Dim In As InputStream=Job.GetInputStream
                Dim OutStream As OutputStream
                OutStream = File.OpenOutput(File.DirRootExternal, "filename.mp4", False)
                File.Copy2(In,OutStream) ' save the file where in is the filled inputstream
                OutStream.Close
                Dim vv As VideoView
                vv.Initialize("")
                Dim panel4 As Panel
                panel4.Initialize("")

                panel2.AddView(vv,0,0,100%x,100%y)
                vv.LoadVideo(File.DirRootExternal,"filename.mp4")
                vv.Play


here only last panel in scrollview of video is playing...actually it loads all video to last panel....how can I manage to remember that specific video where to play??
 
Upvote 0
Top