Don't show file path when playing video using VLCJ

3.8k views Asked by At

I'm using VLC and VLCJ to play video and audio files in my Java application, which works fine.

But there appears a text when playing the video; this text is the path of the played video.

I don't want it to appear when playing a video, so how do I disable this using Java?

2

There are 2 answers

0
ecle On BEST ANSWER

Pass the option :no-video-title-show to disable media title on video. See http://wiki.videolan.org/VLC_command-line_help

Example using VLCJ 1.2.0:

                    String[] options = {
                            ":sharpen-sigma=2.0", 
                            ":blur-factor=127", 
                            ":ipv4-timeout=3000", 
                            ":no-video-title-show", 
                            ":loop", 
                            ":file-caching="+getFileCaching(),
                            ":sout-all",
                            ":sout-keep"
                    };

                    gc.getMediaPlayer().setRepeat(true);
                    gc.getMediaPlayer().setPlaySubItems(true);
                    gc.getMediaPlayer().playMedia(media, options);

Update:

Recent libVLC 2.0.x changes to vout feature may cause no-video-title-show not to work on per-playitem configuration :no-video-title-show anymore and may need to be set as per-global configuration --no-video-title-show. Pass per-global configuration options in the VLCJ factory constructor MediaPlayerFactory(options) instead of mediaplayer's xxxMedia method.

0
caprica On

libVLC 2.1 has new native API to do this - from libvlc_media_player.h:

LIBVLC_API 
void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned int timeout );

This is available in vlcj 2.4.1 - from MediaPlayer.java:

void setVideoTitleDisplay(libvlc_position_e position, int timeout);

This API should always be used in preference to using the unsupported "options" array.

Example:

mediaPlayer.setVideoTitleDisplay(libvlc_position_e.disable, 0);