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]
fn new(instance: &Instance) -> Option<MediaPlayer>
Create an empty Media Player object
fn set_media(&self, md: &Media)
Set the media that will be used by the media_player. If any, previous md will be released.
fn get_media(&self) -> Option<Media>
Get the media used by the media_player.
fn event_manager<'a>(&'a self) -> EventManager<'a>
Get the Event Manager from which the media player send event.
fn is_playing(&self) -> bool
is_playing
fn play(&self) -> Result<(), ()>
Play
fn set_pause(&self, do_pause: bool)
Pause or resume (no effect if there is no media)
fn pause(&self)
Toggle pause (no effect if there is no media)
fn stop(&self)
Stop (no effect if there is no media)
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,
&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,
fn set_nsobject(&self, drawable: *mut c_void)
Set the NSView handler where the media player should render its video output.
fn get_nsobject(&self) -> Option<*mut c_void>
Get the NSView handler previously set with set_nsobject().
fn set_xwindow(&self, drawable: u32)
Set an X Window System drawable where the media player should render its video output.
fn get_xwindow(&self) -> Option<u32>
Get the X Window System window identifier previously set with set_xwindow().
fn set_hwnd(&self, drawable: *mut c_void)
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.
fn get_hwnd(&self) -> Option<*mut c_void>
Get the Windows API window handle (HWND) previously set with set_hwnd().
fn get_time(&self) -> Option<i64>
Get the current movie time (in ms).
fn set_time(&self, time: i64)
Set the movie time (in ms). This has no effect if no media is being played. Not all formats and protocols support this.
fn get_position(&self) -> Option<f32>
Get movie position as percentage between 0.0 and 1.0.
fn set_position(&self, pos: f32)
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.
fn set_chapter(&self, chapter: i32)
Set movie chapter (if applicable).
fn get_chapter(&self) -> Option<i32>
Get movie chapter.
fn chapter_count(&self) -> Option<i32>
Get movie chapter count.
fn will_play(&self) -> bool
Is the player able to play.
fn chapter_count_for_title(&self, title: i32) -> Option<i32>
Get title chapter count.
fn set_title(&self, title: i32)
Set movie title.
fn get_title(&self) -> Option<i32>
Get movie title.
fn title_count(&self) -> Option<i32>
Get movie title count.
fn previous_chapter(&self)
Set previous chapter (if applicable)
fn next_chapter(&self)
Set next chapter (if applicable)
fn get_rate(&self) -> f32
Get the requested movie play rate.
fn set_rate(&self, rate: f32) -> Result<(), ()>
Set movie play rate.
fn state(&self) -> State
Get current movie state.
fn has_vout(&self) -> u32
How many video outputs does this media player have?
fn is_seekable(&self) -> bool
Is this media player seekable?
fn can_pause(&self) -> bool
Can this media player be paused?
fn program_scrambled(&self) -> bool
Check if the current program is scrambled.
fn next_frame(&self)
Display the next frame (if supported)
Navigate through DVD Menu.
fn set_video_title_display(&self, position: Position, timeout: u32)
Set if, and how, the video title will be shown when media is played.