/// Create a media for a certain file path.
Create a media for a certain file path.
Create a media for a certain file path .
pub fn new_path<T: AsRef<Path>>(instance: &Instance, path: T) -> Option<Media> {
        let cstr = match path_to_cstr(path.as_ref()) {
            Ok(s) => s,
            Err(_) => { return None; },
        };
        unsafe{
            let p = sys::libvlc_media_new_path(instance.ptr, cstr.as_ptr());
            if p.is_null() {
                return None;
            }
            Some(Media{ptr: p})
        }
    }
pub fn new_path < T : AsRef < Path > > ( instance : & Instance , path : T ) -> Option < Media > { let cstr = match path_to_cstr ( path . as_ref ( ) ) { Ok ( s ) => s , Err ( _ ) => { return None ; } , } ; unsafe { let p = sys :: libvlc_media_new_path ( instance . ptr , cstr . as_ptr ( ) ) ; if p . is_null ( ) { return None ; } Some ( Media { ptr : p } ) } }
Create a media for a certain file path.
Create a media for a certain file path .
instance
&Instance
path
T