The first way is to specify standard options for the media player - this will set the logo for any subsequently played media item, for example:
String[] standardMediaOptions = {"video-filter=logo", "logo-file=vlcj-logo.png", "logo-opacity=25"}; mediaPlayer.setStandardMediaOptions(standardMediaOptions);The second way is to specify options when playing the media item, for example:
String[] mediaOptions = {"video-filter=logo", "logo-file=vlcj-logo.png", "logo-opacity=25"}; mediaPlayer.playMedia(mediaPath, mediaOptions);The final way is to use the methods of this class to set various logo properties, for example:
mediaPlayer.setLogoFile("vlcj-logo.png"); mediaPlayer.setLogoOpacity(25); mediaPlayer.setLogoLocation(10, 10); mediaPlayer.enableLogo(true);For this latter method, it is not possible to enable the logo until after the video has started playing. There is also a noticeable stutter in video play-back when enabling the logo filter in this way.
With regard to overlaying marquees, again there are three approaches (similar to those for logos).
In this instance only the final way showing the usage of the API is used, for example:
mediaPlayer.setMarqueeText("VLCJ is quite good"); mediaPlayer.setMarqueeSize(60); mediaPlayer.setMarqueeOpacity(70); mediaPlayer.setMarqueeColour(Color.green); mediaPlayer.setMarqueeTimeout(3000); mediaPlayer.setMarqueeLocation(300, 400); mediaPlayer.enableMarquee(true);With regard to video adjustment controls, after the video has started playing:
mediaPlayer.setAdjustVideo(true); mediaPlayer.setGamma(0.9f); mediaPlayer.setHue(10);Some media when played may cause one or more media sub-items to created. These sub-items subsequently need to be played. The media player can be set to automatically play these sub-items via {@link #setPlaySubItems(boolean)}, otherwise {@link #playNextSubItem(String)} can beinvoked in response to a {@link MediaPlayerEventListener#finished(MediaPlayer)} event.
It is always a better strategy to reuse media player instances, rather than repeatedly creating and destroying instances.
Note that media player implementations will guarantee that native media player events are delivered in a single-threaded sequential manner. @see EmbeddedMediaPlayerComponent
|
|