Android Question videoView fullscreen by touch

jazzzzzzz

Active Member
Licensed User
Longtime User
Am playing 4 rtsp links in a single screen using videoview in audio lib,now I have to full screen the video when i touch the video, so i created 4 panels for 4 videoviews ,when i play i can see only one panel cant see 3 other videos...if there is a panel beneath videoview i can simply write code inside "panel_click"..so thats my first problem(I wanna to get some thing linke v4.click)...:rolleyes:
===================================================
one other thing is that

B4X:
Sub button5_click

    v1.SetLayout(51%x, 53%y,50%x,15%y)
    v2.SetLayout(0%x, 68%y,50%x,15%y)
    v3.SetLayout(51%x, 68%y,50%x,15%y)
 
    Activity.Invalidate
 
    CallSubDelayed2(Me, "muteVolume", v1)
    CallSubDelayed2(Me, "muteVolume", v2)
    CallSubDelayed2(Me, "muteVolume", v3)
 
    v4.pause
    v4.RemoveView
    Activity.AddView(v4, 0%x, 0%y, 100%x,100%y)
    v4.SetLayout(0%x,0%x,100%x,100%y)
    Activity.Invalidate
    v4.play
    CallSubDelayed2(Me, "fullVolume", v4)

End Sub

in above code am trying to make v4 to fullscreen when i press a button...here v1,v2,v3 videoviews setlayout function is making the video area into a smaller space and its working immediately....but if i simply gave "v4.SetLayout(0%x,0%x,100%x,100%y)" this does not works....But it works if i remove v4 view and connect once again...but v1,v2,v3 videoviews does not need to remove to make it smaller....... So the problem is "setlayout" can immediately make video to a smaller space ..but making it to a larger space is not working without reconnecting agin

above code is working good but removing view and adding it again make a lot of time to connect to video again because am streaming rtsp links from internet..:(

Sorry for long post..:)
 

jazzzzzzz

Active Member
Licensed User
Longtime User
Try to call layout with JavaObject:
B4X:
Dim jo As JavaObject = v4
jo.RunMethod("layout", 0, 0, 100%x, 100%y)
v4.Invalidate
above code gave a compile error..
B4X:
Parsing code.                          0.02
Compiling code.                        Error
Error compiling program.
Error description: Cannot cast type: {Type=Double,Rank=0, RemoteObject=False} to: {Type=Object,Rank=1, RemoteObject=True}
Occurred on line: 147
jo.RunMethod("layout", 0, 0, 100%x, 100%y)
Word: 0

B4X:
Sub button2_click

    v2.SetLayout(51%x, 53%y,50%x,15%y)
    v3.SetLayout(0%x, 68%y,50%x,15%y)
    v4.SetLayout(51%x, 68%y,50%x,15%y)
   

    Activity.Invalidate

    CallSubDelayed2(Me, "muteVolume", v2)
    CallSubDelayed2(Me, "muteVolume", v3)
    CallSubDelayed2(Me, "muteVolume", v4)
   
    Dim jo As JavaObject = v1
    jo.RunMethod("layout", 0, 0, 100%x, 100%y)
    v1.Invalidate
   
'    v1.pause
'    v1.RemoveView
'    Activity.AddView(v1, 0%x, 0%y, 100%x,100%y)
'    v1.SetLayout(0%x,0%x,100%x,100%y)
'    Activity.Invalidate
'    v1.play

    CallSubDelayed2(Me, "fullVolume", v1)
End Sub

Error is in "jo.RunMethod("layout", 0, 0, 100%x, 100%y)" its a compile error ,some problem with passing values in think,Dont know much about refelctors and javaobjects...;(
 
Upvote 0

jazzzzzzz

Active Member
Licensed User
Longtime User
Fullscreen issue was solved when i change program to run only in Landscape mode...Dont know whats the problem with portrait...Now i want to get the touch event when i press on any of the video view as mentioned in the above question..any way i want something like
B4X:
v1.click
should i open new thread?
 
Upvote 0
Top