Troubles playing videos on China export tablets

robotop

Member
Licensed User
Longtime User
EREL ! Why you forgotten me ?

I'm writing a big application on a tablet, for my customer. I purchased the B4A licence (personal) and "forced" my customer to buy the enterprise version so he can have updates for long time.

Now, I have a problem; I asked for a solution on the forum, but received suggestions that were present yet in the forum, so nothing new, all experiments I did by myself prior to ask.

Now, I'm here to ask YOU for help, 'cause if you can't solve this question, I must change my project and find a trick to obtain something similar to the specific request, but in another way.

The environment:
I'm writing the same application, with small enhancements on big ones, on 4 different models of tablets: 2 of them are 7" (800x480) 1 is 9.7" (1024x768) and 1 is 10.1" (1024x600). I'm using the B4A in version 1.7 and all the tablets have the Android 2.2 Froyo OS.
All the tablets are based on WM8650 processor and I modified the original roms with the Uberoid alternative, changing some permissions and removing native applications and adding some others useful for my job. Such tablets will be inserted in very complex electronic devices and are just the human interface, something like a kiosk.
All worked fine until now, but now I have one specific request to show, in a side of tablet screen, one help video, started automatically for some events, to help the user to know what to do. I leaved this part as last, 'cause in VB and other languages on different platforms is really easy to do.
Now, I'm at the end of the job and this simple task DOESN'T WORK !
Please, note that I restored the original firmware in the tablets, but all they act exactly the same as in the Uberoid version. The activity view acts just like a transparent, clear window in which you see part of the video that's ALWAYS played in full screen mode. The rest of the video is alpha-blended and covers the remaining views of activity, including buttons, labels, images etc.
Here is the link of my previous post on this argument:
http://www.b4x.com/forum/basic4android-updates-questions/13746-videoview-always-full-screen.html

I tried all the combinations of active views, bring to front, media control on or off, get focus...
Installed RockVideoPlayer, removed it and installed another MoviePlayer, installed the very little default VideoPlayer, but EVERY time the behaviour is the same: full screen alpha-blended and a "clear, transparent" part with the dimensions I selected. The videos are mp4, with format 638x360, but I reduced them in size with FFconvert and the resultant 320x180 acts exacly the same way, excluding that the quality is poor due to automatic zooming to fill (AGAIN !) the screen.

So, PLEASE, Erel... Can you help me with a working example, a full project folder zip, that I can test on my tablets in order to understand if I'm wrong in my opinion that there is something missing in the wrap of the VideoPlay call made from B4A ?

If you can supply this working example and if you will ensure me that it works on a "standard" Android tablet sized 800x480, 1024x768 or 1024x600, I must probably accept the fact that my China tablets are simply unable to do the job.

Thanks for attention, really hope you can help me. I finished my ideas an tried all that in my experience with such machines.
 

robotop

Member
Licensed User
Longtime User
ARGHH. That's really bad news... :(
Thank you Erel. If you arrange a new wrapper to any better player, please let me informed about this, thanks :)
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I know this does not solve your problem, but would it be possible that instead of a video, perhaps you can play an audio-only file and a series of still images on timers? Is there support for animated GIFs and can they be sized)?

I know this is not a real replacement, but on the other hand, you are only wanting to provide direction to end-users on how to do something in the app, which you may be able to convey with audio and still images.

Just a thought as a way to work around the limitation without being completely dead in the water. ;)
 
Upvote 0

robotop

Member
Licensed User
Longtime User
@ Erel: yes I've seen the way to modify the intent like this:
B4X:
Sub StartVidx ' just for test, remove when finished
Dim vint As Intent
   vint.Initialize(vint.ACTION_VIEW,"file:///sdcard/aires/vid/video1.mp4")
   Vint.SetType("video/*")
   Vint.Flags = 0x10000000
   vint.SetComponent("android.rk.RockVideoPlayer/.VideoPlayActivity")
   StartActivity(vint)
End Sub
but no effect. Even using the player in "standard mode", i.e. starting it as a normal application, the behaviour is always the same: player in full screen, even if in 1:1 mode the video is in the middle of the screen, the player itself extends on whole area, anyway. :(

@ Kevin: hehe, yes, but that way must be really the LAST chance... It's a little bit complex to convert AVIs or MP4s to animated GIFs and sync them with audio !!! May be I could work for animation studios, after that ;)
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
What happens with this on your Chinese tablet?


B4X:
Sub Globals
    Dim vv As VideoView
   Dim Button1 As Button
End Sub


Sub Activity_Create(FirstTime As Boolean)
   
   'Activity.LoadLayout("playmp4")
   vv.Initialize("vv")
   activity.Color = Colors.Yellow
    Activity.AddView(vv, 2dip, 2dip, activity.width-4, activity.Width/2)
   button1.Initialize("button1")
   button1.Text = "[ PLAY ]"
      Activity.AddView(button1, 50dip, 50dip, 150dip, 150dip)
   
    
   
End Sub

Sub vv_Complete
    Msgbox("video completed","completed")
   vv.Stop
End Sub

Sub Button1_Down

     vv.LoadVideo("http","http://videoqube.com/iphone/95.mp4")
   
   button1.Visible=False
   
   Msgbox("Loading and buffering video","Loading")
    
   ToastMessageShow("loading streaming video....", True)
   
   vv.Play

End Sub
 
Upvote 0

robotop

Member
Licensed User
Longtime User
hello vb1992. Your example has only one difference from my program: it loads the video from the internet and not from the sdcard. But I will try anyway, tomorrow morning, just to see if the player works differently in this environment. I doubt it will do something different. In the meantime, I can download the file to check if has some particular format. Note that I converted all my video files with FFconvert, selecting mp4 / iphone mode and also tried other formats. The problem seems to be in the player, not in the B4A wrapper.
But, once again, I will try it and if it works, you have a beer paid by me ;)
 
Upvote 0

robotop

Member
Licensed User
Longtime User
Hello vb1992, it's a sunny morning and I tested your program.
Sorry, no beer. :)
As previously stated, the only thing that changes are that the video is loaded from the internet and the background is not clear alpha, but yellow alpha; again, the whole screen is occupied by the player...
 
Last edited:
Upvote 0

moster67

Expert
Licensed User
Longtime User
ciao,

if vb1992's code-example doesn't work, then I really don't know what options you have.

Perhaps using Flash and show it in a webview (bit still I don't know if the native vebview supports flash).

Another option could be to use a FFMPEG-library, like this one:

Android WarZone: FFmpeg4Android

It is a commercial project (but so is yours so it shouldn't be a problem). They have a 15 days demo. They are providing APIs but I have no idea if this would work for you. In addition, I think you would need to write a thin wrapper-library in order to use it.

I for sure would like to see a B4A-FFMpeg library (Erel?). It would be a big project but it would make B4A even more outstanding.
 
Last edited:
Upvote 0

robotop

Member
Licensed User
Longtime User
ciao (are you italian too ?)
thanks for the link, I will take a look to check if it can fit my needs.

Actually, for speeding the time-to-market for my applications, I used an easy solution: I placed my buttons in the high and low side of the screen and used the player with media-controller turned off. The background of the player is set with a colour that's similar to actual activity running, and the active area set by AddView located at the center of the screen ; so when the player opens, I have all my buttons and labels available to the user (the buttons are active even if under the alpha-blending of the player). Due to nature of 16:9 of the videos, I have enough space in the upper and lower bands to make visible (but alpha-blended) my buttons and labels. So I simply created a "special effect" to have the buttons "fumè" when playing the help videos -in full screen-. Now, may be I can ask to my customer for additional payment due to so big aesthetic enhancement .... :sign0089:
 
Upvote 0

robotop

Member
Licensed User
Longtime User
oops... after looong time I revisited this page and appreciated your suggestion. Many thanks, I will try your lib in my next app. Ciao
 
Upvote 0
Top