Forum Xamarin.iOS

Using external VLC lib for video playing

Hi,

I'm trying to play a video with VLC player via Cocoa and C#.

The 32-bit VLC works okay using the Mono framework. The VLC 32-bit is old and obsolete, but a nice 64-bit version is available. So, now I'm trying the new Xamarin.Mac .NET 4.5 framework and the 64-bit VLC, but I cannot make it work. The 64-bit lib actually loads and I can get the "version string" but "libvlc_new" in LibVlcDynamic.cs line 214 always return zero when running 64-bit.
The source is here: http://www.nikse.dk/VideoPlayerTestSrc.zip

Any help or ideas would be much appreciated!

Also, if you know a video player (with c# bindings or a lib) that can play mkv files and newer video codecs do let me know :)

Best Answer

Answers

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    You example is incomplete. It has references to the dylib you did not include:

            string dllFile ="/Users/nikolajolsson/Projects/VideoPlayerTest/VideoPlayerTest/bin/Debug/VLC.app/Contents/MacOS/lib/libvlc.dylib";
    
          string  dllFile = "/Users/nikolajolsson/Downloads/vlc-3.0.0-git/VLC.app/Contents/MacOS/lib/libvlc.5.dylib";
    
            if (numberOfBits == 32)
                dllFile = "/Users/nikolajolsson/Downloads/VLC32.app/Contents/MacOS/lib/libvlc.dylib";
            //string dllFile = "/Applications/VLC.app/Contents/MacOS/lib/libvlc.5.dylib";
            if (!File.Exists(dllFile))
                dllFile = "/Users/nikolajolsson/Downloads/VLC/lib/libvlc.5.dylib";
    
  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Also, have you tried just suing a straight P/Invoke into _libvlc_new instead of this using the Marshal.GetDelegateForFunctionPointer redirection? Maybe that will act differently?

Sign In or Register to comment.