public void Stop() { LibVlc.libvlc_media_player_stop(Handle); playing = false; paused = false; }
public VlcInstance(string[] args) { Handle = LibVlc.libvlc_new(args.Length, args); if (Handle == IntPtr.Zero) { throw new VlcException(); } }
public VlcException() : base() { IntPtr errorPointer = LibVlc.libvlc_errmsg(); _err = errorPointer == IntPtr.Zero ? "VLC Exception" : Marshal.PtrToStringAuto(errorPointer); }
public VlcMediaPlayer(VlcMedia media) { Handle = LibVlc.libvlc_media_player_new_from_media(media.Handle); if (Handle == IntPtr.Zero) { throw new VlcException(); } }
public VlcMedia(VlcInstance instance, string url) { Handle = LibVlc.libvlc_media_new_location(instance.Handle, url); if (Handle == IntPtr.Zero) { throw new VlcException(); } }
public void Pause() { LibVlc.libvlc_media_player_pause(Handle); if (playing) { paused ^= true; } }
public void Play() { int ret = LibVlc.libvlc_media_player_play(Handle); if (ret == -1) { throw new VlcException(); } playing = true; paused = false; }
public void Dispose() { LibVlc.libvlc_media_player_release(Handle); }
public void Dispose() { LibVlc.libvlc_release(Handle); }