Video View in B4A Version 1.7

margret

Well-Known Member
Licensed User
Longtime User
Hello All,

I have an issue with the video view in B4A in version 1.7. If I load a MP4 file that is a 4.3 ratio, the video view will load it and fill the screen with the video being stretched out. If you reload it again, with the panel button, it is normal. Now if you load a 16 x 9 video after this one, it is compressed into the 4.3 aspect. Now if you load it again, it looks normal.

I have used vv.Invalidate and vv.Invalidate3() and neither one helps. I have also tried to just reload the video twice in the code and it does not help either. Is this a known issues in B4A, the video view or Android and does anyone have any ideas how to correct this. I have a deadline tonight to complete this package and just found this issue. Any help would be great.

Thanks,

Margret
 

margret

Well-Known Member
Licensed User
Longtime User
VV Issue

Panel Button?

Hello,

Yes, I have a panel with a button that calls code that reloads the video view. I have tried to load it twice in code but it does not work. If I pull up the panel with the menu and then click the button that calls the load video view, it works. The only difference is that it takes a second or two to click the menu and then the reload. I am writing code now with a timer to create a pause to see it that works.

Thanks,

Margret
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Hi.

Sounds like the video view uses the resolution of the last played video instead of the resolution of the currently loaded video.

If there is no last played video it defaults to 16:9 - a guess based on your post.

Could you create 2 very short videos - only a second long for example.
One video would be 4:3 aspect ratio and the other 16:9.
Each video could simply show an animation 'video loading...'.

Now you want to display a 4:3 video so first load the 4:3 short video and then load the video you actually want to play.

Do similar for 16:9 aspect videos that you want to play.

Hopefully the short videos will set the video view to that aspect ratio ready for the playback of the desired video.

Possible problem though - do you know the aspect ratios of videos you want to play..?

Martin.
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Video View Issue

Hello Guys,

I ran the same APP on Android 3.2.1 and it does not have that issue. However, it shifts the 4.3 video to far left of the screen and leaves a large black part of the screen on the right. I see no way to center the 4.3 video. It would be really good if there was a way to detect the video resolution of the video playing and be able to place the image where you want it. If any one has any ideas on this, I would love to hear them.

To fix the issue on Android 2.2, I loaded the video and set a timer to 1000 and then reload the same video. This way it corrects the aspect! I have tried at 500, (a half second) but that will not work, it seems it takes the full one second, at least on the device I tested. This may help someone else.

It would really be nice to be able to set the video view properties to even a location off screen, also the size. That way, you could enlarge the video view to larger than the screen res to remove the black bars in the super wide screen videos. Maybe in an update!!

Thanks,

Margret
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
Margret

I have a production question...


Do you copy the MP4 to DirDefaultExternal

File.Copy(File.DirAssets, "video.mp4",File.DirDefaultExternal, "video.mp4")

before you play it?

vv.LoadVideo(File.DirDefaultExternal , "video.mp4")

Or can you play it from DirAssets
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Video View Issues

Margret

I have a production question...


Do you copy the MP4 to DirDefaultExternal

File.Copy(File.DirAssets, "video.mp4",File.DirDefaultExternal, "video.mp4")

before you play it?

vv.LoadVideo(File.DirDefaultExternal , "video.mp4")

Or can you play it from DirAssets

Hello,

I do not copy it. The device has a folder for videos. I just load from that folder the selected video. It can be from Internal memory or the SDCard but not from the assets folder. If you did install your APK with an MP4 in the assets folder you would have to copy it somewhere else before playing it.

Thanks,

Margret
 
Upvote 0
Top