Struct vlc::MediaPlayer
[−]
[src]
pub struct MediaPlayer {
pub ptr: *mut libvlc_media_player_t,
}A LibVLC media player plays one media (usually in a custom drawable).
Fields
ptr: *mut libvlc_media_player_t
Methods
impl MediaPlayer[src]
pub fn new(instance: &Instance) -> Option<MediaPlayer>[src]
Create an empty Media Player object
pub fn set_media(&self, md: &Media)[src]
Set the media that will be used by the media_player. If any, previous md will be released.
pub fn get_media(&self) -> Option<Media>[src]
Get the media used by the media_player.
pub fn event_manager<'a>(&'a self) -> EventManager<'a>[src]
Get the Event Manager from which the media player send event.
pub fn is_playing(&self) -> bool[src]
is_playing
pub fn play(&self) -> Result<(), ()>[src]
Play
pub fn set_pause(&self, do_pause: bool)[src]
Pause or resume (no effect if there is no media)
pub fn pause(&self)[src]
Toggle pause (no effect if there is no media)
pub fn stop(&self)[src]
Stop (no effect if there is no media)
pub fn set_callbacks<F>(
&self,
play: F,
pause: Option<Box<Fn(i64) + Send + 'static>>,
resume: Option<Box<Fn(i64) + Send + 'static>>,
flush: Option<Box<Fn(i64) + Send + 'static>>,
drain: Option<Box<Fn() + Send + 'static>>
) where
F: Fn(*const c_void, u32, i64) + Send + 'static, [src]
&self,
play: F,
pause: Option<Box<Fn(i64) + Send + 'static>>,
resume: Option<Box<Fn(i64) + Send + 'static>>,
flush: Option<Box<Fn(i64) + Send + 'static>>,
drain: Option<Box<Fn() + Send + 'static>>
) where
F: Fn(*const c_void, u32, i64) + Send + 'static,
pub fn set_nsobject(&self, drawable: *mut c_void)[src]
Set the NSView handler where the media player should render its video output.
pub fn get_nsobject(&self) -> Option<*mut c_void>[src]
Get the NSView handler previously set with set_nsobject().
pub fn set_xwindow(&self, drawable: u32)[src]
Set an X Window System drawable where the media player should render its video output.
pub fn get_xwindow(&self) -> Option<u32>[src]
Get the X Window System window identifier previously set with set_xwindow().
pub fn set_hwnd(&self, drawable: *mut c_void)[src]
Set a Win32/Win64 API window handle (HWND) where the media player should render its video output. If LibVLC was built without Win32/Win64 API output support, then this has no effects.
pub fn get_hwnd(&self) -> Option<*mut c_void>[src]
Get the Windows API window handle (HWND) previously set with set_hwnd().
pub fn get_time(&self) -> Option<i64>[src]
Get the current movie time (in ms).
pub fn set_time(&self, time: i64)[src]
Set the movie time (in ms). This has no effect if no media is being played. Not all formats and protocols support this.
pub fn get_position(&self) -> Option<f32>[src]
Get movie position as percentage between 0.0 and 1.0.
pub fn set_position(&self, pos: f32)[src]
Set movie position as percentage between 0.0 and 1.0. This has no effect if playback is not enabled. This might not work depending on the underlying input format and protocol.
pub fn set_chapter(&self, chapter: i32)[src]
Set movie chapter (if applicable).
pub fn get_chapter(&self) -> Option<i32>[src]
Get movie chapter.
pub fn chapter_count(&self) -> Option<i32>[src]
Get movie chapter count.
pub fn will_play(&self) -> bool[src]
Is the player able to play.
pub fn chapter_count_for_title(&self, title: i32) -> Option<i32>[src]
Get title chapter count.
pub fn set_title(&self, title: i32)[src]
Set movie title.
pub fn get_title(&self) -> Option<i32>[src]
Get movie title.
pub fn title_count(&self) -> Option<i32>[src]
Get movie title count.
pub fn previous_chapter(&self)[src]
Set previous chapter (if applicable)
pub fn next_chapter(&self)[src]
Set next chapter (if applicable)
pub fn get_rate(&self) -> f32[src]
Get the requested movie play rate.
pub fn set_rate(&self, rate: f32) -> Result<(), ()>[src]
Set movie play rate.
pub fn state(&self) -> State[src]
Get current movie state.
pub fn has_vout(&self) -> u32[src]
How many video outputs does this media player have?
pub fn is_seekable(&self) -> bool[src]
Is this media player seekable?
pub fn can_pause(&self) -> bool[src]
Can this media player be paused?
pub fn program_scrambled(&self) -> bool[src]
Check if the current program is scrambled.
pub fn next_frame(&self)[src]
Display the next frame (if supported)
[src]
Navigate through DVD Menu.
pub fn set_video_title_display(&self, position: Position, timeout: u32)[src]
Set if, and how, the video title will be shown when media is played.