Exemplo n.º 1
0
 /// <summary>
 /// Constructor of VlcControl
 /// </summary>
 public VlcControl()
 {
     BackColor = Color.Black;
     if (DesignMode)
     {
         return;
     }
     Manager = new VlcManager();
     try
     {
         CreateHandle();
         Manager.ControlHandle = Handle;
         Manager.VlcLibPath    = Path.GetDirectoryName(Application.ExecutablePath);
     }
     catch (Exception)
     {
         return;
     }
 }
Exemplo n.º 2
0
        public void Play(MediaBase media)
        {
            if (DesignMode)
            {
                return;
            }

            //Initialize a default VlcManager
            if (myVlcManager == null)
            {
                myVlcManager = new VlcManager();
            }
            InitVlcMediaPlayer();
            if (media.Initialize(myVlcManager.VlcClient) == IntPtr.Zero)
            {
                return;
            }

            LibVlcMethods.libvlc_media_player_set_media(VlcMediaPlayer, media.VlcMedia);
            LibVlcMethods.libvlc_media_player_play(VlcMediaPlayer);
        }