B4J Library MediaView - video player

1632902712566.png


This library includes two custom views: MediaView and MediaViewController.
MediaView can play local and remote videos and music.
The native JavaFX MediaView doesn't include a controller interface. I've implemented one. You can use it or create your own. Tip: the controller code and layout are inside the b4xlib file.

Usage:
Add the two custom views and connect them:
B4X:
MediaViewController1.SetMediaView(MediaView1)

Set the video source.
B4X:
MediaView1.Source = "https://player.vimeo....

Use File.GetUri to play a local file.

Updates

v1.01 - Fixes a layout issue.
 

Attachments

  • MediaViewExample.zip
    13.5 KB · Views: 54
  • MediaView.b4xlib
    4.9 KB · Views: 41
Last edited:

moster67

Expert
Licensed User
Tested it with a few different streaming links and it worked fine 💪
Good job
 

CR95

Member
Licensed User
I tried it with avi files converted in mp4 by VLC
The MediaViewExample program starts but remains blocked on the first image of the video (note that the same file is red by VLC without problem)
Log error :
B4X:
Error: MediaException: UNKNOWN : [com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMediaPlayer@13d27beb] ERROR_MEDIA_INVALID: ERROR_MEDIA_INVALID

Please could you tell me what are the detailed formats supported by MediaView ?
And if you know an utility for converting avi.files to this standard ?
 
Top