public abstract class DefaultMediaPlayer extends AbstractMediaPlayer implements MediaPlayer
| Constructor and Description |
|---|
DefaultMediaPlayer(LibVlc libvlc,
libvlc_instance_t instance)
Create a new media player.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMediaOptions(String... mediaOptions)
Add options to the current media.
|
void |
addMediaPlayerEventListener(MediaPlayerEventListener listener)
Add a component to be notified of media player events.
|
boolean |
canPause()
Can the current media be paused?
|
void |
cycleSpu()
Select the next sub-title track (or disable sub-titles).
|
void |
enableEvents(int eventMask)
Restrict the set of media player events that generate event notifications to listeners.
|
void |
enableLogo(boolean enable)
Enable/disable the logo.
|
void |
enableMarquee(boolean enable)
Enable/disable the marquee.
|
List<List<String>> |
getAllChapterDescriptions()
Get all of the chapter descriptions for all available titles.
|
String |
getAspectRatio()
Get the video aspect ratio.
|
int |
getAudioChannel()
Get the current audio channel.
|
long |
getAudioDelay()
Get the audio delay.
|
List<TrackDescription> |
getAudioDescriptions()
Get the audio track descriptions.
|
AudioOutputDeviceType |
getAudioOutputDeviceType()
Get the audio output device type.
|
int |
getAudioTrack()
Get the current audio track.
|
int |
getAudioTrackCount()
Get the number of available audio tracks.
|
float |
getBrightness()
Get the current video brightness.
|
int |
getChapter()
Get the current chapter.
|
int |
getChapterCount()
Get the chapter count.
|
List<String> |
getChapterDescriptions()
Get the chapter descriptions for the current title.
|
List<String> |
getChapterDescriptions(int title)
Get the chapter descriptions for a title.
|
float |
getContrast()
Get the current video contrast.
|
String |
getCropGeometry()
Get the current video crop geometry.
|
float |
getFps()
Get the current play-back frames-per-second.
|
float |
getGamma()
Get the current video gamma.
|
int |
getHue()
Get the current video hue.
|
long |
getLength()
Get the length of the current media item.
|
MediaDetails |
getMediaDetails()
Get the media details.
|
MediaMeta |
getMediaMeta()
Get local meta data for the current media.
|
MediaMeta |
getMediaMeta(libvlc_media_t media)
Get local meta data for a media instance.
|
libvlc_state_t |
getMediaPlayerState()
Get the media player current state.
|
libvlc_state_t |
getMediaState()
Get the current media state.
|
libvlc_media_stats_t |
getMediaStatistics()
Get the current media statistics.
|
libvlc_media_stats_t |
getMediaStatistics(libvlc_media_t media)
Get the current media statistics for a media item (e.g.
|
float |
getPosition()
Get the current play-back position.
|
float |
getRate()
Get the current video play rate.
|
boolean |
getRepeat()
Test whether or not the media player will automatically repeat playing the media when it has
finished playing.
|
float |
getSaturation()
Get the current video saturation.
|
float |
getScale()
Get the current video scale (zoom).
|
BufferedImage |
getSnapshot()
Get a snapshot of the currently playing video.
|
BufferedImage |
getSnapshot(int width,
int height)
Get a snapshot of the currently playing video.
|
int |
getSpu()
Get the current sub-title track.
|
int |
getSpuCount()
Get the number of sub-pictures/sub-titles.
|
long |
getSpuDelay()
Get the sub-title delay.
|
List<TrackDescription> |
getSpuDescriptions()
Get the sub-title track descriptions.
|
List<MediaMeta> |
getSubItemMediaMeta()
Get local meta data for all of the current media sub-items (if there are any).
|
List<List<TrackInfo>> |
getSubItemTrackInfo()
Get the track (i.e.
|
int |
getTeletextPage()
Get the current teletext page.
|
long |
getTime()
Get the current play-back time.
|
int |
getTitle()
Get the current title.
|
int |
getTitleCount()
Get the number of titles.
|
List<TrackDescription> |
getTitleDescriptions()
Get the title descriptions.
|
List<TrackInfo> |
getTrackInfo()
Get the track (i.e.
|
List<TrackInfo> |
getTrackInfo(libvlc_media_t media)
Get track (i.e.
|
List<TrackDescription> |
getVideoDescriptions()
Get the video (i.e.
|
Dimension |
getVideoDimension()
Get the video size.
|
int |
getVideoOutputs()
Get the number of video outputs for the media player.
|
int |
getVideoTrack()
Get the current video track.
|
int |
getVideoTrackCount()
Get the number of available video tracks.
|
int |
getVolume()
Get the current volume.
|
boolean |
isAdjustVideo()
Test whether or not the video adjustments are enabled.
|
boolean |
isMediaParsed()
Test whether or not the current media has been parsed.
|
boolean |
isMute()
Test whether or not the volume is currently muted.
|
boolean |
isPlayable()
Is the current media playable?
|
boolean |
isPlaying()
Is the media player playing?
|
boolean |
isSeekable()
Is the current media seekable?
|
libvlc_media_player_t |
mediaPlayerInstance()
Provide access to the native media player instance.
|
void |
menuActivate()
Activate a DVD menu.
|
void |
menuDown()
Navigate down a DVD menu.
|
void |
menuLeft()
Navigate left a DVD menu.
|
void |
menuRight()
Navigate right a DVD menu.
|
void |
menuUp()
Navigate up a DVD menu.
|
String |
mrl()
Get the media resource locator for the current media instance.
|
String |
mrl(libvlc_media_t mediaInstance)
Get the media resource locator for a media instance.
|
void |
mute()
Toggle volume mute.
|
void |
mute(boolean mute)
Mute or un-mute the volume.
|
void |
nextChapter()
Jump to the next chapter.
|
void |
nextFrame()
Advance one frame.
|
void |
parseMedia()
Parse local meta data from the current media.
|
void |
pause()
Pause play-back.
|
void |
play()
Begin play-back.
|
boolean |
playMedia(String mrl,
String... mediaOptions)
Play a new media item, with options.
|
boolean |
playNextSubItem(String... mediaOptions)
Play the next sub-item (if there is one).
|
boolean |
playSubItem(int index,
String... mediaOptions)
Play a particular sub-item (if there is one).
|
boolean |
prepareMedia(String mrl,
String... mediaOptions)
Prepare a new media item for play-back, but do not begin playing.
|
void |
previousChapter()
Jump to the previous chapter.
|
void |
release()
Release the media player, freeing all associated (including native) resources.
|
void |
removeMediaPlayerEventListener(MediaPlayerEventListener listener)
Remove a component that was previously interested in notifications of media player events.
|
void |
requestParseMedia()
Parse local meta data from the current media.
|
boolean |
saveSnapshot()
Save a snapshot of the currently playing video.
|
boolean |
saveSnapshot(File file)
Save a snapshot of the currently playing video.
|
boolean |
saveSnapshot(File file,
int width,
int height)
Save a snapshot of the currently playing video.
|
boolean |
saveSnapshot(int width,
int height)
Save a snapshot of the currently playing video.
|
void |
setAdjustVideo(boolean adjustVideo)
Enable/disable the video adjustments.
|
void |
setAspectRatio(String aspectRatio)
Set the video aspect ratio
|
void |
setAudioChannel(int channel)
Set the audio channel.
|
void |
setAudioDelay(long delay)
Set the audio delay.
|
boolean |
setAudioOutput(String output)
Set the desired audio output.
|
void |
setAudioOutputDevice(String output,
String outputDeviceId)
Set the desired audio output device.
|
void |
setAudioOutputDeviceType(AudioOutputDeviceType deviceType)
Set the audio output device type.
|
void |
setAudioTrack(int track)
Set a new audio track to play.
|
void |
setBrightness(float brightness)
Set the video brightness.
|
void |
setChapter(int chapterNumber)
Set the chapter.
|
void |
setContrast(float contrast)
Set the video contrast.
|
void |
setCropGeometry(String cropGeometry)
Set the crop geometry.
|
void |
setDeinterlace(DeinterlaceMode deinterlaceMode)
Set the de-interlace filter to use.
|
void |
setGamma(float gamma)
Set the video gamma.
|
void |
setHue(int hue)
Set the video hue.
|
void |
setLogoFile(String logoFile)
Set the logo file.
|
void |
setLogoImage(RenderedImage logoImage)
Set the logo image.
|
void |
setLogoLocation(int x,
int y)
Set the logo location.
|
void |
setLogoOpacity(float opacity)
Set the logo opacity.
|
void |
setLogoOpacity(int opacity)
Set the logo opacity.
|
void |
setLogoPosition(libvlc_logo_position_e position)
Set the logo position.
|
void |
setMarqueeColour(Color colour)
Set the marquee colour.
|
void |
setMarqueeColour(int colour)
Set the marquee colour.
|
void |
setMarqueeLocation(int x,
int y)
Set the marquee location.
|
void |
setMarqueeOpacity(float opacity)
Set the marquee opacity.
|
void |
setMarqueeOpacity(int opacity)
Set the marquee opacity.
|
void |
setMarqueePosition(libvlc_marquee_position_e position)
Set the marquee position.
|
void |
setMarqueeSize(int size)
Set the marquee size.
|
void |
setMarqueeText(String text)
Set the marquee text.
|
void |
setMarqueeTimeout(int timeout)
Set the marquee timeout.
|
void |
setPause(boolean pause)
Pause/resume.
|
void |
setPlaySubItems(boolean playSubItems)
Set whether or not the media player should automatically play media sub- items.
|
void |
setPosition(float position)
Jump to a specific position.
|
int |
setRate(float rate)
Set the video play rate.
|
void |
setRepeat(boolean repeat)
Set whether or not the media player should automatically repeat playing the media when it has
finished playing.
|
void |
setSaturation(float saturation)
Set the video saturation.
|
void |
setScale(float factor)
Set the video scaling factor.
|
void |
setSnapshotDirectory(String snapshotDirectoryName)
Set the directory into which snapshots of the video are saved.
|
void |
setSpu(int spu)
Set the current sub-title track.
|
void |
setSpuDelay(long delay)
Set the sub-title delay.
|
void |
setStandardMediaOptions(String... options)
Set standard media options for all media items subsequently played.
|
void |
setSubTitleFile(File subTitleFile)
Set the sub-title file to use.
|
void |
setSubTitleFile(String subTitleFileName)
Set the sub-title file to use.
|
void |
setTeletextPage(int pageNumber)
Set the new teletext page to retrieve.
|
void |
setTime(long time)
Jump to a specific moment.
|
void |
setTitle(int title)
Set a new title to play.
|
void |
setVideoTrack(int track)
Set a new video track to play.
|
void |
setVolume(int volume)
Set the volume.
|
void |
skip(long delta)
Skip forward or backward by a period of time.
|
void |
skipPosition(float delta)
Skip forward or backward by a change in position.
|
boolean |
start()
Begin play-back and wait for the media to start playing or for an error to occur.
|
boolean |
startMedia(String mrl,
String... mediaOptions)
Play a new media item, with options, and wait for it to start playing or error.
|
void |
stop()
Stop play-back.
|
int |
subItemCount()
Get the number of sub-items (if any).
|
int |
subItemIndex()
Get the index of the current sub-item.
|
List<String> |
subItems()
Get the list of sub-items (if any).
|
List<libvlc_media_t> |
subItemsMedia()
Get the list of sub-item media instances (if any).
|
void |
toggleTeletext()
Toggle teletext status.
|
Object |
userData()
Get the user data associated with the media player.
|
void |
userData(Object userData)
Set user data to associate with the media player.
|
public DefaultMediaPlayer(LibVlc libvlc, libvlc_instance_t instance)
libvlc - native library interfaceinstance - libvlc instancepublic void addMediaPlayerEventListener(MediaPlayerEventListener listener)
MediaPlayeraddMediaPlayerEventListener in interface MediaPlayerlistener - component to notifypublic void removeMediaPlayerEventListener(MediaPlayerEventListener listener)
MediaPlayerremoveMediaPlayerEventListener in interface MediaPlayerlistener - component to stop notifyingpublic void enableEvents(int eventMask)
MediaPlayerIf a set of events is not explicitly enabled, then it is expected that all events be enabled.
See MediaPlayerEventType.
This setting applies to all registered event listeners - it is not (currently) possible to set a different event mask for each listener.
enableEvents in interface MediaPlayereventMask - bit mask of events to enablepublic void setStandardMediaOptions(String... options)
MediaPlayerThis will not affect any currently playing media item.
setStandardMediaOptions in interface MediaPlayeroptions - options to apply to all subsequently played media itemspublic boolean playMedia(String mrl, String... mediaOptions)
MediaPlayerThe new media will begin play-back immediately.
When playing files, depending on the run-time Operating System it may be necessary to pass a URL here (beginning with "file://") rather than a local file path.
playMedia in interface MediaPlayermrl - media resource locatormediaOptions - zero or more media item optionstrue if the media item was created; false otherwisepublic boolean prepareMedia(String mrl, String... mediaOptions)
MediaPlayerWhen playing files, depending on the run-time Operating System it may be necessary to pass a URL here (beginning with "file://") rather than a local file path.
prepareMedia in interface MediaPlayermrl - media resource locatormediaOptions - zero or more media item optionstrue if the media item was created; false otherwisepublic boolean startMedia(String mrl, String... mediaOptions)
MediaPlayerThis call will block until the media starts or errors.
startMedia in interface MediaPlayermrl - media resource locatormediaOptions - zero or more media item optionstrue if the media started playing, false if the media failed to start because of an errorpublic void parseMedia()
MediaPlayerThis method is synchronous.
Parsing media may cause an HTTP request to be made to search for cover- art.
Invoking this method on a stream or DVB channel may cause a hang.
parseMedia in interface MediaPlayerpublic void requestParseMedia()
MediaPlayerThis method is asynchronous and a media player event will be raised when the parsed status changes.
Parsing media may cause an HTTP request to be made to search for cover- art.
If the media has already been parsed when this function calls then no event will be raised.
Invoking this method on a stream or DVB channel may cause a hang.
requestParseMedia in interface MediaPlayerpublic boolean isMediaParsed()
MediaPlayerisMediaParsed in interface MediaPlayertrue if the current media has been parsed, otherwise falsepublic MediaMeta getMediaMeta()
MediaPlayer
Some media types require that the media be parsed before accessing meta data - it is the
responsibility of the client application to parse the media if required, see
MediaPlayer.parseMedia().
getMediaMeta in interface MediaPlayerpublic MediaMeta getMediaMeta(libvlc_media_t media)
MediaPlayer
See MediaPlayer.getMediaMeta(), the same notes with regard to parsing hold here.
getMediaMeta in interface MediaPlayermedia - media instance, may be a sub-itempublic List<MediaMeta> getSubItemMediaMeta()
MediaPlayer
See MediaPlayer.getMediaMeta(), the same notes with regard to parsing hold here.
getSubItemMediaMeta in interface MediaPlayerpublic void addMediaOptions(String... mediaOptions)
MediaPlayeraddMediaOptions in interface MediaPlayermediaOptions - media optionspublic void setRepeat(boolean repeat)
MediaPlayer
There is no guarantee of seamless play-back when using this method - see instead
MediaListPlayer.
If the media has sub-items, then it is the sub-items that are repeated.
setRepeat in interface MediaPlayerrepeat - true to automatically replay the media, otherwise falsepublic boolean getRepeat()
MediaPlayergetRepeat in interface MediaPlayertrue if the media will be automatically replayed, otherwise falsepublic void setPlaySubItems(boolean playSubItems)
MediaPlayersetPlaySubItems in interface MediaPlayerplaySubItems - true to automatically play sub-items, otherwise falsepublic int subItemCount()
MediaPlayersubItemCount in interface MediaPlayerpublic int subItemIndex()
MediaPlayersubItemIndex in interface MediaPlayerpublic List<String> subItems()
MediaPlayerThe MRL of each sub-item is returned in the list.
subItems in interface MediaPlayernull if there is no current mediapublic List<libvlc_media_t> subItemsMedia()
MediaPlayerThe native media instance of each sub-item is returned in the list.
subItemsMedia in interface MediaPlayernull if there is no current mediapublic boolean playNextSubItem(String... mediaOptions)
MediaPlayer
If any standard media options have been set via MediaPlayer.setStandardMediaOptions(String...)
then those options will be applied to the sub-item.
If the media player has been set to automatically repeat, then the sub- items will be repeated once the last one has been played.
playNextSubItem in interface MediaPlayermediaOptions - zero or more media options for the sub-itemtrue if there is a sub-item, otherwise falsepublic boolean playSubItem(int index,
String... mediaOptions)
MediaPlayer
If any standard media options have been set via MediaPlayer.setStandardMediaOptions(String...)
then those options will be applied to the sub-item.
If the media player has been set to automatically repeat, then the sub- items will be repeated once the last one has been played, or if the requested sub-item index exceeds the currently available sub-items.
playSubItem in interface MediaPlayerindex - sub-item indexmediaOptions - zero or more media options for the sub-itemtrue if there is a sub-item, otherwise falsepublic boolean isPlayable()
MediaPlayerisPlayable in interface MediaPlayertrue if the current media is playable, otherwise falsepublic boolean isPlaying()
MediaPlayerisPlaying in interface MediaPlayertrue if the media player is playing, otherwise falsepublic boolean isSeekable()
MediaPlayerisSeekable in interface MediaPlayertrue if the current media is seekable, otherwise falsepublic boolean canPause()
MediaPlayercanPause in interface MediaPlayertrue if the current media can be paused, otherwise falsepublic long getLength()
MediaPlayergetLength in interface MediaPlayerpublic long getTime()
MediaPlayergetTime in interface MediaPlayerpublic float getPosition()
MediaPlayergetPosition in interface MediaPlayerpublic float getFps()
MediaPlayergetFps in interface MediaPlayerpublic float getRate()
MediaPlayergetRate in interface MediaPlayerpublic int getVideoOutputs()
MediaPlayergetVideoOutputs in interface MediaPlayerpublic Dimension getVideoDimension()
MediaPlayerThe video dimensions are not available until after the video has started playing and a video output has been created.
getVideoDimension in interface MediaPlayernullpublic MediaDetails getMediaDetails()
MediaPlayerThe details are available after the video has started playing, regardless of whether nor not a video output has been created.
getMediaDetails in interface MediaPlayernull if the media meta data is not availablepublic String getAspectRatio()
MediaPlayergetAspectRatio in interface MediaPlayerpublic float getScale()
MediaPlayergetScale in interface MediaPlayerpublic String getCropGeometry()
MediaPlayergetCropGeometry in interface MediaPlayerpublic libvlc_media_stats_t getMediaStatistics()
MediaPlayerStatistics are only updated if the video is playing.
getMediaStatistics in interface MediaPlayerpublic libvlc_media_stats_t getMediaStatistics(libvlc_media_t media)
MediaPlayerStatistics are only updated if the video is playing.
getMediaStatistics in interface MediaPlayermedia - media itempublic libvlc_state_t getMediaState()
MediaPlayergetMediaState in interface MediaPlayerpublic libvlc_state_t getMediaPlayerState()
MediaPlayergetMediaPlayerState in interface MediaPlayerpublic int getTitleCount()
MediaPlayergetTitleCount in interface MediaPlayerpublic int getTitle()
MediaPlayergetTitle in interface MediaPlayerpublic void setTitle(int title)
MediaPlayersetTitle in interface MediaPlayertitle - title numberpublic int getVideoTrackCount()
MediaPlayergetVideoTrackCount in interface MediaPlayerpublic int getVideoTrack()
MediaPlayer
This does not return the id of the track, see
MediaPlayer.getVideoDescriptions().
getVideoTrack in interface MediaPlayerpublic void setVideoTrack(int track)
MediaPlayer
This does not take the track number returned from MediaPlayer.getVideoTrack(), rather it takes
the track id obtained from see MediaPlayer.getVideoDescriptions().
setVideoTrack in interface MediaPlayertrack - track id, or -1 to disable the videopublic int getAudioTrackCount()
MediaPlayergetAudioTrackCount in interface MediaPlayerpublic int getAudioTrack()
MediaPlayergetAudioTrack in interface MediaPlayerpublic void setAudioTrack(int track)
MediaPlayersetAudioTrack in interface MediaPlayertrack - track numberpublic void play()
MediaPlayerIf called when the play-back is paused, the play-back will resume from the current position.
play in interface MediaPlayerpublic boolean start()
MediaPlayerIf called when the play-back is paused, the play-back will resume from the current position.
This call will block until the media starts or errors.
start in interface MediaPlayertrue if the media started playing, false if the media failed to start because of an errorpublic void stop()
MediaPlayerA subsequent play will play-back from the start.
stop in interface MediaPlayerpublic void setPause(boolean pause)
MediaPlayerRequires vlc 1.1.1 or later.
setPause in interface MediaPlayerpause - true to pause, false to play/resumepublic void pause()
MediaPlayerIf the play-back is currently paused it will begin playing.
pause in interface MediaPlayerpublic void nextFrame()
MediaPlayernextFrame in interface MediaPlayerpublic void skip(long delta)
MediaPlayerTo skip backwards specify a negative delta.
skip in interface MediaPlayerdelta - time period, in millisecondspublic void skipPosition(float delta)
MediaPlayerTo skip backwards specify a negative delta.
skipPosition in interface MediaPlayerpublic void setTime(long time)
MediaPlayersetTime in interface MediaPlayertime - time since the beginning, in millisecondspublic void setPosition(float position)
MediaPlayersetPosition in interface MediaPlayerposition - position value, a percentage (e.g. 0.15 is 15%)public int setRate(float rate)
MediaPlayerSome media protocols are not able to change the rate.
setRate in interface MediaPlayerrate - rate, where 1.0 is normal speed, 0.5 is half speed, 2.0 is double speed and so onpublic void setAspectRatio(String aspectRatio)
MediaPlayersetAspectRatio in interface MediaPlayeraspectRatio - aspect ratiopublic void setScale(float factor)
MediaPlayersetScale in interface MediaPlayerfactor - scaling factor, or zero to scale the video the size of the containerpublic void setCropGeometry(String cropGeometry)
MediaPlayerThe format for the crop geometry is one of:
mediaPlayer.setCropGeometry("4:3"); // W:H
mediaPlayer.setCropGeometry("719x575+0+0"); // WxH+L+T
mediaPlayer.setCropGeometry("6+10+6+10"); // L+T+R+B
setCropGeometry in interface MediaPlayercropGeometry - formatted string describing the desired crop geometrypublic boolean setAudioOutput(String output)
MediaPlayerThe change will not be applied until the media player has been stopped and then played again.
The output name comes from MediaPlayerFactory.getAudioOutputs().
setAudioOutput in interface MediaPlayeroutput - name of the desired audio outputtrue if the output was successfully set, otherwise falsepublic void setAudioOutputDevice(String output, String outputDeviceId)
MediaPlayerThe change will not be applied until the media player has been stopped and then played again.
The output name comes from MediaPlayerFactory.getAudioOutputs().
The device id comes from the AudioDevice.getDeviceId() returned by
MediaPlayerFactory.getAudioOutputs().
setAudioOutputDevice in interface MediaPlayeroutput - name of the desired audio outputoutputDeviceId - id of the desired audio output devicepublic void setAudioOutputDeviceType(AudioOutputDeviceType deviceType)
MediaPlayersetAudioOutputDeviceType in interface MediaPlayerdeviceType - device typepublic AudioOutputDeviceType getAudioOutputDeviceType()
MediaPlayergetAudioOutputDeviceType in interface MediaPlayerpublic void mute()
MediaPlayermute in interface MediaPlayerpublic void mute(boolean mute)
MediaPlayermute in interface MediaPlayermute - true to mute the volume, false to un-mute itpublic boolean isMute()
MediaPlayerisMute in interface MediaPlayertrue if the volume is muted, false if the volume is not mutedpublic int getVolume()
MediaPlayergetVolume in interface MediaPlayerpublic void setVolume(int volume)
MediaPlayersetVolume in interface MediaPlayervolume - volume, in the range 0 to 200 where 200 is full volumepublic int getAudioChannel()
MediaPlayerlibvlc_audio_output_channel_t.
Warning this API is subject to change.getAudioChannel in interface MediaPlayerpublic void setAudioChannel(int channel)
MediaPlayerlibvlc_audio_output_channel_t.
Warning this API is subject to change.setAudioChannel in interface MediaPlayerchannel - channelpublic long getAudioDelay()
MediaPlayergetAudioDelay in interface MediaPlayerpublic void setAudioDelay(long delay)
MediaPlayerThe audio delay is set for the current item only and will be reset to zero each time the media changes.
setAudioDelay in interface MediaPlayerdelay - desired audio delay, in microsecondspublic int getChapterCount()
MediaPlayergetChapterCount in interface MediaPlayerpublic int getChapter()
MediaPlayergetChapter in interface MediaPlayerpublic void setChapter(int chapterNumber)
MediaPlayersetChapter in interface MediaPlayerchapterNumber - chapter number, where zero is the first chapterpublic void nextChapter()
MediaPlayerIf the play-back is already at the last chapter, this will have no effect.
nextChapter in interface MediaPlayerpublic void previousChapter()
MediaPlayerIf the play-back is already at the first chapter, this will have no effect.
previousChapter in interface MediaPlayerpublic void menuActivate()
MediaPlayermenuActivate in interface MediaPlayerpublic void menuUp()
MediaPlayermenuUp in interface MediaPlayerpublic void menuDown()
MediaPlayermenuDown in interface MediaPlayerpublic void menuLeft()
MediaPlayermenuLeft in interface MediaPlayerpublic void menuRight()
MediaPlayermenuRight in interface MediaPlayerpublic int getSpuCount()
MediaPlayergetSpuCount in interface MediaPlayerpublic int getSpu()
MediaPlayergetSpu in interface MediaPlayerpublic void setSpu(int spu)
MediaPlayersetSpu in interface MediaPlayerspu - sub-title number, or -1 for nonepublic void cycleSpu()
MediaPlayercycleSpu in interface MediaPlayerpublic long getSpuDelay()
MediaPlayergetSpuDelay in interface MediaPlayerpublic void setSpuDelay(long delay)
MediaPlayerThe sub-title delay is set for the current item only and will be reset to zero each time the media changes.
setSpuDelay in interface MediaPlayerdelay - desired sub-title delay, in microsecondspublic void setSubTitleFile(String subTitleFileName)
MediaPlayersetSubTitleFile in interface MediaPlayersubTitleFileName - name of the file containing the sub-titlespublic void setSubTitleFile(File subTitleFile)
MediaPlayersetSubTitleFile in interface MediaPlayersubTitleFile - file containing the sub-titlespublic int getTeletextPage()
MediaPlayergetTeletextPage in interface MediaPlayerpublic void setTeletextPage(int pageNumber)
MediaPlayersetTeletextPage in interface MediaPlayerpageNumber - page numberpublic void toggleTeletext()
MediaPlayertoggleTeletext in interface MediaPlayerpublic List<TrackDescription> getTitleDescriptions()
MediaPlayerThe media must be playing before this information is available.
getTitleDescriptions in interface MediaPlayerpublic List<TrackDescription> getVideoDescriptions()
MediaPlayerThe media must be playing before this information is available.
getVideoDescriptions in interface MediaPlayerpublic List<TrackDescription> getAudioDescriptions()
MediaPlayerThe media must be playing before this information is available.
getAudioDescriptions in interface MediaPlayerpublic List<TrackDescription> getSpuDescriptions()
MediaPlayerThe media must be playing before this information is available.
getSpuDescriptions in interface MediaPlayerpublic List<String> getChapterDescriptions(int title)
MediaPlayerThe media must be playing before this information is available.
getChapterDescriptions in interface MediaPlayertitle - title numberpublic List<String> getChapterDescriptions()
MediaPlayerThe media must be playing before this information is available.
getChapterDescriptions in interface MediaPlayerpublic List<List<String>> getAllChapterDescriptions()
MediaPlayerThe media must be playing before this information is available.
getAllChapterDescriptions in interface MediaPlayerpublic List<TrackInfo> getTrackInfo()
MediaPlayer
The media (if local) should first be parsed, see MediaPlayer.parseMedia(), or be already
playing.
In the case of DVD media (for example ".iso" files) and streams the media must be played and video output must be available before valid track information becomes available, and even then it is not always available immediately so polling may be required.
getTrackInfo in interface MediaPlayernull if there is no current mediapublic List<TrackInfo> getTrackInfo(libvlc_media_t media)
MediaPlayergetTrackInfo in interface MediaPlayermedia - media itemnull if there is no current mediapublic List<List<TrackInfo>> getSubItemTrackInfo()
MediaPlayergetSubItemTrackInfo in interface MediaPlayernull if there is no current mediapublic void setSnapshotDirectory(String snapshotDirectoryName)
MediaPlayerIf the specified directory path does not yet exist, it will be created.
setSnapshotDirectory in interface MediaPlayersnapshotDirectoryName - name of the directory to save snapshots topublic boolean saveSnapshot()
MediaPlayerThe size of the image will be that produced by the libvlc native snapshot function, i.e. the size of the media itself.
The snapshot will be created in the directory set via MediaPlayer.setSnapshotDirectory(String),
unless that directory has not been set in which case the snapshot will be created in the
user's home directory, obtained via the "user.home" system property.
The snapshot will be assigned a filename based on the current time.
The size of the image will be that produced by the libvlc native snapshot function.
saveSnapshot in interface MediaPlayertrue if the snapshot was saved, otherwise falsepublic boolean saveSnapshot(int width,
int height)
MediaPlayer
The snapshot will be created in the directory set via MediaPlayer.setSnapshotDirectory(String),
unless that directory has not been set in which case the snapshot will be created in the
user's home directory, obtained via the "user.home" system property.
The snapshot will be assigned a filename based on the current time.
If one of width or height is zero the original image aspect ratio will be preserved.
If both width and height are zero, the original image size will be used, see
MediaPlayer.saveSnapshot().
saveSnapshot in interface MediaPlayerwidth - desired image widthheight - desired image heighttrue if the snapshot was saved, otherwise falsepublic boolean saveSnapshot(File file)
MediaPlayerThe size of the image will be that produced by the libvlc native snapshot function, i.e. the size of the media itself.
Any missing directory path will be created if it does not exist.
saveSnapshot in interface MediaPlayerfile - file to contain the snapshottrue if the snapshot was saved, otherwise falsepublic boolean saveSnapshot(File file, int width, int height)
MediaPlayerAny missing directory path will be created if it does not exist.
If one of width or height is zero the original image aspect ratio will be preserved.
If both width and height are zero, the original image size will be used, see
MediaPlayer.saveSnapshot(File).
saveSnapshot in interface MediaPlayerfile - file to contain the snapshotwidth - desired image widthheight - desired image heighttrue if the snapshot was saved, otherwise falsepublic BufferedImage getSnapshot()
MediaPlayerThe size of the image will be that produced by the libvlc native snapshot function, i.e. the size of the media itself.
This implementation uses the native libvlc method to save a snapshot of the currently playing video. This snapshot is saved to a temporary file and then the resultant image is loaded from the file.
getSnapshot in interface MediaPlayernull if a snapshot could not be takenpublic BufferedImage getSnapshot(int width, int height)
MediaPlayerThis implementation uses the native libvlc method to save a snapshot of the currently playing video. This snapshot is saved to a temporary file and then the resultant image is loaded from the file.
If one of width or height is zero the original image aspect ratio will be preserved.
If both width and height are zero, the original image size will be used, see
MediaPlayer.getSnapshot()
getSnapshot in interface MediaPlayerwidth - desired image widthheight - desired image heightnull if a snapshot could not be takenpublic void enableLogo(boolean enable)
MediaPlayerThe logo will not be enabled if there is currently no video being played.
enableLogo in interface MediaPlayerenable - true to show the logo, false to hide itpublic void setLogoOpacity(int opacity)
MediaPlayersetLogoOpacity in interface MediaPlayeropacity - opacity in the range 0 to 255 where 255 is fully opaquepublic void setLogoOpacity(float opacity)
MediaPlayersetLogoOpacity in interface MediaPlayeropacity - opacity percentage in the range 0.0 to 1.0 where 1.0 is fully opaquepublic void setLogoLocation(int x,
int y)
MediaPlayersetLogoLocation in interface MediaPlayerx - x co-ordinate for the top left of the logoy - y co-ordinate for the top left of the logopublic void setLogoPosition(libvlc_logo_position_e position)
MediaPlayersetLogoPosition in interface MediaPlayerposition - positionpublic void setLogoFile(String logoFile)
MediaPlayersetLogoFile in interface MediaPlayerlogoFile - logo file namepublic void setLogoImage(RenderedImage logoImage)
MediaPlayer
The image will first be written to a temporary file, before invoking
MediaPlayer.setLogoFile(String). This is not optimal, but creating a temporary file for the logo
in this way is unavoidable.
setLogoImage in interface MediaPlayerlogoImage - logo imagepublic void enableMarquee(boolean enable)
MediaPlayerThe marquee will not be enabled if there is currently no video being played.
enableMarquee in interface MediaPlayerenable - true to show the marquee, false to hide itpublic void setMarqueeText(String text)
MediaPlayersetMarqueeText in interface MediaPlayertext - textpublic void setMarqueeColour(Color colour)
MediaPlayersetMarqueeColour in interface MediaPlayercolour - colour, any alpha component will be masked offpublic void setMarqueeColour(int colour)
MediaPlayersetMarqueeColour in interface MediaPlayercolour - RGB colour valuepublic void setMarqueeOpacity(int opacity)
MediaPlayersetMarqueeOpacity in interface MediaPlayeropacity - opacity in the range 0 to 100 where 255 is fully opaquepublic void setMarqueeOpacity(float opacity)
MediaPlayersetMarqueeOpacity in interface MediaPlayeropacity - opacity percentage in the range 0.0 to 1.0 where 1.0 is fully opaquepublic void setMarqueeSize(int size)
MediaPlayersetMarqueeSize in interface MediaPlayersize - size, height of the marquee text in pixelspublic void setMarqueeTimeout(int timeout)
MediaPlayersetMarqueeTimeout in interface MediaPlayertimeout - timeout, in millisecondspublic void setMarqueeLocation(int x,
int y)
MediaPlayersetMarqueeLocation in interface MediaPlayerx - x co-ordinate for the top left of the marqueey - y co-ordinate for the top left of the marqueepublic void setMarqueePosition(libvlc_marquee_position_e position)
MediaPlayersetMarqueePosition in interface MediaPlayerposition - positionpublic void setDeinterlace(DeinterlaceMode deinterlaceMode)
MediaPlayersetDeinterlace in interface MediaPlayerdeinterlaceMode - mode, or null to disable the de-interlace filterpublic void setAdjustVideo(boolean adjustVideo)
MediaPlayerThe video adjustment controls must be enabled after the video has started playing.
Requires vlc 1.1.1 or later.
setAdjustVideo in interface MediaPlayeradjustVideo - true if the video adjustments are enabled, otherwise falsepublic boolean isAdjustVideo()
MediaPlayerRequires vlc 1.1.1 or later.
isAdjustVideo in interface MediaPlayerpublic float getContrast()
MediaPlayerRequires vlc 1.1.1 or later.
getContrast in interface MediaPlayerpublic void setContrast(float contrast)
MediaPlayerVideo adjustments must be enabled for this to have any effect. Requires vlc 1.1.1 or later.
setContrast in interface MediaPlayercontrast - contrast value, in the range from 0.0 to 2.0public float getBrightness()
MediaPlayerRequires vlc 1.1.1 or later.
getBrightness in interface MediaPlayerpublic void setBrightness(float brightness)
MediaPlayerVideo adjustments must be enabled for this to have any effect.
Requires vlc 1.1.1 or later.
setBrightness in interface MediaPlayerbrightness - brightness value, in the range from 0.0 to 2.0public int getHue()
MediaPlayerRequires vlc 1.1.1 or later.
getHue in interface MediaPlayerpublic void setHue(int hue)
MediaPlayerVideo adjustments must be enabled for this to have any effect.
Requires vlc 1.1.1 or later.
setHue in interface MediaPlayerhue - hue value, in the range from 0 to 360public float getSaturation()
MediaPlayerRequires vlc 1.1.1 or later.
getSaturation in interface MediaPlayerpublic void setSaturation(float saturation)
MediaPlayerVideo adjustments must be enabled for this to have any effect.
Requires vlc 1.1.1 or later.
setSaturation in interface MediaPlayersaturation - saturation value, in the range from 0.0 to 3.0public float getGamma()
MediaPlayerRequires vlc 1.1.1 or later.
getGamma in interface MediaPlayerpublic void setGamma(float gamma)
MediaPlayerVideo adjustments must be enabled for this to have any effect.
Requires vlc 1.1.1 or later.
setGamma in interface MediaPlayergamma - gamma, in the range from 0.01 to 10.0public String mrl()
MediaPlayerThe native media instance may be an automatically/scripted added sub-item.
mrl in interface MediaPlayerpublic String mrl(libvlc_media_t mediaInstance)
MediaPlayerThe native media instance may be an automatically/scripted added sub-item.
mrl in interface MediaPlayermediaInstance - native media instancepublic Object userData()
MediaPlayeruserData in interface MediaPlayerpublic void userData(Object userData)
MediaPlayeruserData in interface MediaPlayeruserData - user datapublic final void release()
MediaPlayerrelease in interface MediaPlayerpublic final libvlc_media_player_t mediaPlayerInstance()
MediaPlayerThis is exposed on the interface as an implementation side-effect, ordinary applications are not expected to use this.
mediaPlayerInstance in interface MediaPlayerCopyright © 2009-2012 Caprica Software Limited. All Rights Reserved.