Example #1
0
        public void Stop()
        {
            LibVlc.libvlc_media_player_stop(Handle);

            playing = false;
            paused  = false;
        }
Example #2
0
 public VlcInstance(string[] args)
 {
     Handle = LibVlc.libvlc_new(args.Length, args);
     if (Handle == IntPtr.Zero)
     {
         throw new VlcException();
     }
 }
Example #3
0
        public VlcException()
            : base()
        {
            IntPtr errorPointer = LibVlc.libvlc_errmsg();

            _err = errorPointer == IntPtr.Zero ? "VLC Exception"
                : Marshal.PtrToStringAuto(errorPointer);
        }
Example #4
0
 public VlcMediaPlayer(VlcMedia media)
 {
     Handle = LibVlc.libvlc_media_player_new_from_media(media.Handle);
     if (Handle == IntPtr.Zero)
     {
         throw new VlcException();
     }
 }
Example #5
0
 public VlcMedia(VlcInstance instance, string url)
 {
     Handle = LibVlc.libvlc_media_new_location(instance.Handle, url);
     if (Handle == IntPtr.Zero)
     {
         throw new VlcException();
     }
 }
Example #6
0
        public void Pause()
        {
            LibVlc.libvlc_media_player_pause(Handle);

            if (playing)
            {
                paused ^= true;
            }
        }
Example #7
0
        public void Play()
        {
            int ret = LibVlc.libvlc_media_player_play(Handle);

            if (ret == -1)
            {
                throw new VlcException();
            }

            playing = true;
            paused  = false;
        }
Example #8
0
 public void Dispose()
 {
     LibVlc.libvlc_media_player_release(Handle);
 }
Example #9
0
 public void Dispose()
 {
     LibVlc.libvlc_release(Handle);
 }