Sep 29, 2021 Replies: 17 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: Code: MediaViewController1.SetMediaView(MediaView1) Set the video source. Code: MediaView1.Source = "https://player.vimeo.... Use File.GetUri to play a local file. Tip: the simplest way to create a MediaView is with SimpleMediaManager: https://www.b4x.com/android/forum/threads/134716/#content Updates v1.03 - The MediaViewController class instance wasn't assigned to mBase.Tag correctly. This is fixed (https://www.b4x.com/android/forum/t...he-mediaviewcontroller-b4j.159864/post-981468) v1.02 - Fixes an issue with setting the volume. v1.01 - Fixes a layout issue. Attachments MediaViewExample.zip MediaViewExample.zip 10.6 KB · Views: 1,142 MediaView.b4xlib MediaView.b4xlib 4.9 KB · Views: 739 Last edited: Mar 13, 2024 Click to expand...
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: Code: MediaViewController1.SetMediaView(MediaView1) Set the video source. Code: MediaView1.Source = "https://player.vimeo.... Use File.GetUri to play a local file. Tip: the simplest way to create a MediaView is with SimpleMediaManager: https://www.b4x.com/android/forum/threads/134716/#content Updates v1.03 - The MediaViewController class instance wasn't assigned to mBase.Tag correctly. This is fixed (https://www.b4x.com/android/forum/t...he-mediaviewcontroller-b4j.159864/post-981468) v1.02 - Fixes an issue with setting the volume. v1.01 - Fixes a layout issue.
moster67 Expert Licensed User Longtime User Sep 29, 2021 #2 Tested it with a few different streaming links and it worked fine ? Good job
IndieDev Active Member Licensed User Longtime User Sep 29, 2021 #3 Thank you. Been waiting for some time for this.
Erel B4X founder Staff member Licensed User Longtime User Oct 1, 2021 #4 v1.01 - Fixes a layout issue.
C CR95 Active Member Licensed User Oct 4, 2021 #5 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 ?
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 ?
Erel B4X founder Staff member Licensed User Longtime User Oct 5, 2021 #6 Supported media types: https://docs.oracle.com/javafx/2/api/javafx/scene/media/package-summary.html#SupportedMediaTypes
Supported media types: https://docs.oracle.com/javafx/2/api/javafx/scene/media/package-summary.html#SupportedMediaTypes
Star-Dust Expert Licensed User Longtime User Dec 16, 2021 #8 Thanks @Erel. I have a question: is it possible to change the audio device with MediaView? That is, if I have several sound cards, choose which one the sound should be output on?
Thanks @Erel. I have a question: is it possible to change the audio device with MediaView? That is, if I have several sound cards, choose which one the sound should be output on?
Erel B4X founder Staff member Licensed User Longtime User Dec 16, 2021 #10 BTW, the simplest way to use MediaView is with SMM: [B4X] SimpleMediaManager (SMM) - framework for images, videos and more
BTW, the simplest way to use MediaView is with SMM: [B4X] SimpleMediaManager (SMM) - framework for images, videos and more
peacemaker Expert Licensed User Longtime User Jan 18, 2022 #11 Erel said: Supported media types: https://docs.oracle.com/javafx/2/api/javafx/scene/media/package-summary.html#SupportedMediaTypes Click to expand... Note all that fresh H.265+ codec is not supported
Erel said: Supported media types: https://docs.oracle.com/javafx/2/api/javafx/scene/media/package-summary.html#SupportedMediaTypes Click to expand... Note all that fresh H.265+ codec is not supported
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2022 #12 v1.02 - Fixes an issue with setting the volume.
H hanyelmehy Well-Known Member Licensed User Longtime User Nov 29, 2023 #13 can i add subtitle ,also read subtitle from vtt,srt,tsv files
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2023 #14 Not automatically. You will need to do it manually = read the srt file and show the subtitles with a label.
Not automatically. You will need to do it manually = read the srt file and show the subtitles with a label.
H hanyelmehy Well-Known Member Licensed User Longtime User Nov 30, 2023 #15 Erel said: Not automatically. You will need to do it manually = read the srt file and show the subtitles with a label. Click to expand... any other Library do subtitle automatically ?
Erel said: Not automatically. You will need to do it manually = read the srt file and show the subtitles with a label. Click to expand... any other Library do subtitle automatically ?
Erel B4X founder Staff member Licensed User Longtime User Dec 3, 2023 #17 You can add it quite easily. Extract the source code from the b4xlib. See how setVolume is implemented and add a similar method that calls "setRate": https://docs.oracle.com/javase/8/javafx/api/javafx/scene/media/MediaPlayer.html#setRate-double-
You can add it quite easily. Extract the source code from the b4xlib. See how setVolume is implemented and add a similar method that calls "setRate": https://docs.oracle.com/javase/8/javafx/api/javafx/scene/media/MediaPlayer.html#setRate-double-
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2024 #18 v1.03 - The MediaViewController class instance wasn't assigned to mBase.Tag correctly. This is fixed (https://www.b4x.com/android/forum/t...he-mediaviewcontroller-b4j.159864/post-981468)
v1.03 - The MediaViewController class instance wasn't assigned to mBase.Tag correctly. This is fixed (https://www.b4x.com/android/forum/t...he-mediaviewcontroller-b4j.159864/post-981468)