Search code examples
c#-4.0vlclibvlc

AxVLCPlugin2 cant play video file


I am using 2 vlc libraries AxAXVLC and AXVLC. So I can add vlc control in my c# winform application. In this application I can play rtsp video stream by just add play list and call tha API play. But I cannot play a video file. The code to play video stream is given below. It is working. Please help me to play video file.

axVLCPlugin21.playlist.items.clear();
string Options3 = ":rtsp-caching=250"; //Cache in mS
int stream1 = axVLCPlugin21.playlist.add("rtsp://10.1.114.51:8554/test", axVLCPlugin21, Options3);
axVLCPlugin21.playlist.playItem(stream1);

Solution

  • To play video files using AVLCPlugin2 below code can be used. The only thing you need to do is convert URI to AbsoluteUri.

    var uri = new Uri(@"c:\sample.mp4");
    var convertedURI = uri.AbsoluteUri;
    axVLCPlugin21.playlist.add(convertedURI);
    axVLCPlugin21.playlist.play();