iOS Question VideoView in CustomListView

MarcoRome

Expert
Licensed User
Longtime User
In camera example ( by Erel ) i have this code:

B4X:
vv.Initialize("vv")
    Page1.RootPanel.AddView(vv.View, ImageView1.Left, ImageView1.Top, _
        ImageView1.Width, ImageView1.Height)
    vv.View.Visible = False
    timer1.Initialize("timer1", 500)

......

Sub Cam_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
   If Success Then
     If Image.IsInitialized Then
       vv.View.Visible = False
       ImageView1.Bitmap = Image
     Else
       vv.View.Visible = True
       vv.LoadVideo(VideoPath, "")
     End If
   End If
End Sub

Private Sub Page1_Resize(Width As Int, Height As Int)
    'resize the VideoView to the same size as the ImageView.
    vv.View.SetLayoutAnimated(0, 1, ImageView1.Left, ImageView1.Top, _
        ImageView1.Width, ImageView1.Height)
End Sub

in this way when i select a movie i have preview in my imageview1 object. And all work.
But if i have the same code in CustomListView, i have only black color ( i dont see nothing )
This is code:

B4X:
Sub CreateListItem(cs As CSBuilder, filmato As String, Width As Int, Height As Int) As Panel
    Dim p As Panel
    p.Initialize("")
    p.SetLayoutAnimated(0, 1, 0, 0, Width, Height) 'set the size before the layout is loaded
    p.LoadLayout("lay_clv_movie")
    lbl_descrizione.AttributedText = cs
    
    p.AddView(vv.View, ImageView1.Left, ImageView1.Top, _
        ImageView1.Width, ImageView1.Height)
   
    Return p
End Sub


Where i wrong ?
Thank you
Marco
 

nobbi59

Active Member
Licensed User
Longtime User
Is Erels example working for you? As far as i know, VideoView API is deprecated and It didnt work when i tested it a few days ago. Erel posted an alternative for the VideoView.
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Is Erels example working for you? As far as i know, VideoView API is deprecated and It didnt work when i tested it a few days ago. Erel posted an alternative for the VideoView.
Yes work without problem. Where's this alternative ?
 
Upvote 0
Top