B4J Question can I use two mediaview or videos at the same time (side by side)?

omarruben

Active Member
Licensed User
Longtime User
I want to play two videos side by side , local videos
B4X:
    screen.MediaView1.Source=File.geturi(folderMedia,listMedia.Get(0).As(String))
    screen.MediaView2.Source=File.geturi(folderMedia,listMedia.Get(1).As(String))
   
    screen.mediaview1.play
    screen.mediaview2.play

but the second mediaview never plays anything , is it possible ?
 
Last edited:

teddybear

Well-Known Member
Licensed User
Yes, you can play both of videos at the same time, but you make sure this MP4 can be played in MediaView first。
 
Upvote 0
Solution

omarruben

Active Member
Licensed User
Longtime User
Yes, you can play both of videos at the same time, but you make sure this MP4 can be played in MediaView first。
Yes, I tested the videos and work fine, but trying to play both the second one does not show anything
 
Last edited:
Upvote 0

teddybear

Well-Known Member
Licensed User
This is the code which is not different with yours.
B4X:
    MediaViewController1.SetMediaView(MediaView1)
    MediaViewController2.SetMediaView(MediaView2)
    MediaView1.Source = File.geturi(File.DirAssets,"1.mp4")
    MediaView2.Source = File.geturi(File.DirAssets,"2.mp4")
    MediaView1.Play
    MediaView2.Play
This is screen snap, it is playing 2 videos
微信图片_20231015101447.png
 
Upvote 0

omarruben

Active Member
Licensed User
Longtime User
Yes, you can play both of videos at the same time, but you make sure this MP4 can be played in MediaView first。
Yes, I tested the videos and work fine, but trying to llay both the second one does not show anything
This is the code which is not different with yours.
B4X:
    MediaViewController1.SetMediaView(MediaView1)
    MediaViewController2.SetMediaView(MediaView2)
    MediaView1.Source = File.geturi(File.DirAssets,"1.mp4")
    MediaView2.Source = File.geturi(File.DirAssets,"2.mp4")
    MediaView1.Play
    MediaView2.Play
This is screen snap, it is playing 2 videos
View attachment 146874
thank you

and sorry everybody, my mp4 is not 100% compatible, I re-encode it and worked fine
 
Upvote 0
Top