public void Stop() { LibVlc.libvlc_media_player_stop(Handle); playing = false; paused = false; }
public VlcMedia(VlcInstance instance, string url) { Handle = LibVlc.libvlc_media_new_location(instance.Handle, url); 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 VlcInstance(string[] args) { Handle = LibVlc.libvlc_new(args.Length, args); if (Handle == IntPtr.Zero) { throw new VlcException(); } }
public void Dispose() { Stop(); LibVlc.libvlc_media_player_release(Handle); if (--Core.Players == 0) { Core.Instance.Dispose(); } }
public void Open(VlcMedia media, IntPtr hwnd) { Handle = LibVlc.libvlc_media_player_new_from_media(media.Handle); if (Handle == IntPtr.Zero) { throw new VlcException(); } Drawable = hwnd; }
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 Open(string path, IntPtr hwnd) { using (VlcMedia media = new VlcMedia(Core.Instance, path)) { Handle = LibVlc.libvlc_media_player_new_from_media(media.Handle); if (Handle == IntPtr.Zero) { throw new VlcException(); } } Drawable = hwnd; }
public VlcMediaPlayer(VlcMedia media) { string[] args = new string[] { "-I", "dummy", "--ignore-config", @"--plugin-path=\plugins" //,"--vout-filter=deinterlace", "--deinterlace-mode=blend" }; Core.Players++; Core.Instance = new VlcInstance(args); Handle = LibVlc.libvlc_media_player_new_from_media(media.Handle); if (Handle == IntPtr.Zero) { throw new VlcException(); } }
public void Dispose() { LibVlc.libvlc_media_release(Handle); }