B4A Library vlcb4a - a B4A wrapper of VLC (Android)

vlcb4a - a B4A wrapper of VLC (Android)

NOTE: As of August 2019, this library is not compliant with Google Play store's latest requirements which require native 64bits libs. It is still useable for apps not being distributed on Google Play Store though. If I can find my original sources and if it is not too complicated, I will try to recompile the sources in order to provide 64bit native libs. That said, things have changed over time and personally I would probably use the ExoPlayer (search the forum) these days unless you have codec-issues. Alternatively, you can use my Vitamio5 library/wrapper which has ARM64 and which is just as powerful as VLC.

This is the 2nd experimental release (Work in progress) of my library attempting to wrap VLC for Android (or parts of it) and its underlying libraries (so-files) and the most important properties/methods of VLC in order to provide a VideoView-object for B4A.

What is VLC for Android?
VLC media player is a free and open source cross-platform multimedia player that plays most multimedia files as well as discs, devices, and network streaming protocols. This is the port of VLC media player to the Android™ platform. VLC for Android can play any video and audio files, as well as network streams and DVD ISOs, like the desktop version of VLC.
VLC for Android is a full audio player, with a complete database, an equalizer and filters, playing all weird audio formats.

The official VLC Android app can be found here:
https://play.google.com/store/apps/details?id=org.videolan.vlc

As mentioned above, the vlcb4a wrapper is not the full Android VLC app but more an attempt to wrap the underlying libraries (so-files) and the most important properties/methods of VLC (its engine) to provide a VideoView-object for B4A. Apparently they are/were planning to write a VideoView-class but there has not been any development on this class for ages and all there is, is a "skeleton-class" of no use since even the related MediaPlayer-class is incomplete.

This wrapper provides its own VideoView class which I have written and compiled into the original VLC-sources based on SDK 3. The SDK can be found here: https://code.videolan.org/videolan/vlc-android/tree/master

This release (version 0.77 of June 27, 2016) adds and includes more features and also fixed some issues (see below for details). I have noted that the vlcb4a plays nearly everything I throw at it.

This is still a "Work in progress" and ETAs for new versions cannot be given. However, I think it should be OK for production by now.

In this moment, I have only compiled the so-sources for ARM but I could compile them also for other platforms such as ARM64, X86 and MIPS. Might add them later though.

The minimum SDK version is 7 (although I have not tried it if it works on such old devices).

See the second post for a current summary of methods, properties and events supported.

You can download the wrapper from here:
https://www.dropbox.com/s/i4d9bul243fc1o4/vlcb4aLIBS_v077.zip?dl=0

I also attach a sample-project (vlcdemo.zip) for B4A.

Note: use a real device
Note2: always use the VideoView object in its own activity. Within this activity, you can then add panels, subtitles and so on as usual. See sample project.

Changes in vlcb4a version 0.77 (June 27, 2016):
  • -added native subtitle support
  • -added possibility to change between 6 different video-sizes
  • -added support for selecting different audio-tracks
  • -added a MediaController (uses the standard Android one for now)
  • -added possibility to add VLC-options. You can add logging,
    OpenSL ES, audio time stretching and more. You can find many more options by googling.

  • added volume controls
  • bug fixes
Please report any bugs and/or post general feedback (negative/positive). This will help to keep me motivated and work on the library further.


Good luck!
 

Attachments

  • vlcdemo.zip
    8.8 KB · Views: 929
Last edited:

Rick Harris

Well-Known Member
Licensed User
Hello Mike,

It seems that our rather hectic private correspondence via this forum has at least come to something good.
Your new library version 0.77 works very well. It appears I was right all along that there was something wrong with your original sample project, especially when trying to load (the same or a new) stream as a follow on to the first stream. Apparently the only way to solve the problems was to move all the VLC player stuff into a separate activity.
Trying to handle everything in one activity is doomed to fail. Good to see that you have also updated the VLC codecs because far more TV streams are now playable. Well done and keep up the good work.
 
Last edited:

moster67

Expert
Licensed User
FYI I didn't update any codecs. They are the same as in the first release.
 

Rick Harris

Well-Known Member
Licensed User
FYI I didn't update any codecs. They are the same as in the first release.
OK, but you did make some other changes because many streams did not play before (in version 0.30).

Just a formal question: My App that was based on the Vitamio player was blocked last week.
What are the chances that my App gets blocked as well when I adapt it to use your VLC player library?

I don't want to spoil your euforia now version 0.77 is working well, but I have some doubts about the legality of using parts of the VLC player outside of their native Windows and Android app environment, as you apparently have done.
There is a difference with Vitamio because they made their player freely available to developers (up to version 4).

I don't want another of my Apps to be blocked because that might cause Google to revoke my Playstore account.
 

moster67

Expert
Licensed User
@Rick Harris

Like I wrote in the first thread when I first published the wrapper, I will probably publish the sources when I feel it's complete, not before. Beware that the videoview object is mostly my own work and the VideoLan team has asked me if I can publish it when it's ready which I have gladly said I will. In this way, other Java and Android developers will benefit and not only b4a-developers. What regards the wrapper, which is also my work, I have not decided.

So I suggest you to contact VLC if you want further information and an answer to your question. It's up to you if you want to use the wrapper or not. Maybe you need to publish your sources too? I strongly suggest you to do that so you can give back something in return for everything you have had for free and which have been happily provided by other developers including myself. Don't you think?

PS,
You're not spoiling any euforia. I get that for other more important things in the world. Definitely not for a wrapper

Ps2,
What regards Vitamio, already from version 4 a license was required if you were making money out of it. The last free version was version 3.

Ps3,
I have had enough of you by now and I will put you in my ignore list. It will be hard to verify but from now on you are not welcome to use my work.
 
Last edited:

Rick Harris

Well-Known Member
Licensed User
@Rick Harris

Like I wrote in the first thread when I first published the wrapper, I will probably publish the sources when I feel it's complete, not before. Beware that the videoview object is mostly my own work and the VideoLan team has asked me if I can publish it when it's ready which I have gladly said I will. In this way, other Java and Android developers will benefit and not only b4a-developers. What regards the wrapper, which is also my work, I have not decided.

So I suggest you to contact VLC if you want further information and an answer to your question. It's up to you if you want to use the wrapper or not. Maybe you need to publish your sources too? I strongly suggest you to do that so you can give back something in return for everything you have had for free and which have been happily provided by other developers including myself. Don't you think?

PS,
You're not spoiling any euforia. I get that for other more important things in the world. Definitely not for a wrapper

Ps2,
What regards Vitamio, already from version 4 a license was required if you were making money out of it. The last free version was version 3.

Ps3,
I have had enough of you by now and I will put you in my ignore list. It will be hard to verify but from now on you are not welcome to use my work.
Not only in private correspondence, but even in this Forum you are rude and insolent. I asked a perfectly legitimate question whether I would run into difficulties when using your wrapper. If I may not use your work then you MUST also remove the seven Dutch TV stream links that I pointed out to you and which you are now using in your sample project.

This is no way to cooperate. Over the years I have made plenty of contributions in this forum (559 contributions so far) and have also given you a lot of feedback including three amended sample projects involving your VLC library, all in the good spirit to try to (get you to) improve it. You chose to totally ignore it. So don't suggest that I am "sponging" on you or other people.

PS: My Video & TV app in the Google Playstore (which has now been blocked by Google due to the use of Vitamio) has always been free of charge. So I would not be making a penny out of your work, if I would have decided to use it. As I told you, my app is primarily intended for visually impaired users who can listen to the TV sound.

End of discussion, end of communication, end of trying to do something for the good with your VLC material. My apologies to Erel and all forum members that our dirty laundry, thanks to your doing, has now come to the surface in this forum. I won't react like this again, but you have really overstepped the mark.
 
Last edited:

mvera

Active Member
Licensed User
hi thanks for your work.

download vlcdemo.zip but ask me a library that can not find
FLV video displays.?

regards
 

moster67

Expert
Licensed User
In the first post there is a dropbox link for the library.

VLC plays lots of formats so hopefully it will work.
 

scsjc

Well-Known Member
Licensed User
Hello moster, great work ... thanks for share !

one question, i try to play a... m3u audiostream with this library, and dont work.
you think is possible??? or another way to play m3u audiostream???

Thanks
 

moster67

Expert
Licensed User
I have never tried an m3u audiostream. If you want, you can send me a link of a stream by PM and I will try this evening when I'm back from work.
 

moster67

Expert
Licensed User
Can you please explain a bit better what you mean? When do you want to reload? In case the streaming is interrupted due to connection problems? If yes and if I recall correctly, then I believe the onError event should trigger..
 

Leni Berry

Active Member
Licensed User
Can you please explain a bit better what you mean? When do you want to reload? In case the streaming is interrupted due to connection problems? If yes and if I recall correctly, then I believe the onError event should trigger..

yes.. i mean In case the streaming is interrupted due to connection problems... so, is it ok if i call sub procedure "StartStreaming" again?
 

moster67

Expert
Licensed User
@Leni Berry
First, you need to try and simulate a disconnection and see the events triggered (does it start buffering?, do you see any error messages?). Unless the stream is halted completely, VLC will probably start buffering and resume streaming when it can automatically. If not, try and see if you can re-start (resume) streaming. Sometimes it also depends on the video-file and the server where the video is hosted and which might not allow resuming. You need to experiment a bit.
 

moster67

Expert
Licensed User
hi,
can I make a screenshot and zoom video?
Currently there is no Zoom video-mode and with this wrapper it is not possible to make screenshots.

However, with my Vitamio5 wrapper you can make screenshots. It also has a zoom video layout:
  • SetVideoLayout (VIDEO_LAYOUT As Int, AspectRatio As Float)
    Set the display options.
    Default is VIDEO_LAYOUT_SCALE or 1.
    Layout parameters: VIDEO_LAYOUT_ORIGIN or 0, VIDEO_LAYOUT_SCALE or 1, VIDEO_LAYOUT_STRETCH or 2,
    VIDEO_LAYOUT_ZOOM or 3, VIDEO_LAYOUT_FIT_PARENT or 4.
    AspectRatio - video aspect ratio, will auto detect if 0.

 
Last edited:

Almora

Active Member
Licensed User
Currently there is no Zoom video-mode and with this wrapper it is not possible to make screenshots.

However, with my Vitamio5 wrapper you can make screenshots. It also has a zoom video layout:
  • SetVideoLayout (VIDEO_LAYOUT As Int, AspectRatio As Float)
    Set the display options.
    Default is VIDEO_LAYOUT_SCALE or 1.
    Layout parameters: VIDEO_LAYOUT_ORIGIN or 0, VIDEO_LAYOUT_SCALE or 1, VIDEO_LAYOUT_STRETCH or 2,
    VIDEO_LAYOUT_ZOOM or 3, VIDEO_LAYOUT_FIT_PARENT or 4.
    AspectRatio - video aspect ratio, will auto detect if 0.

there is an alternative to PayPal?
I can't use paypal.
 

moster67

Expert
Licensed User
I guess you mean donating for Vitamio, right?
If you want you can donate using Bitcoin. Please contact me by PM if you are interested.
 
Top