/// <summary> /// Initialize library /// </summary> public static void Initialize() { InteropManager = new LibVlcInteropsManager(LibVlcDllsPath); if (IsInitialized) { throw new ApplicationException("Cannot initialize libvlc more than one time."); } var argsStringfCollection = GetBaseVlcInstanceArguments(); var args = new string[argsStringfCollection.Count]; argsStringfCollection.CopyTo(args, 0); HandleManager.LibVlcHandle = InteropManager.NewInstance.Invoke(args.Length, args); if (HandleManager.LibVlcHandle != IntPtr.Zero) { IsInitialized = true; ErrorHandling = new VlcErrorHandling(); EventsHelper.CanRaiseEvent = true; } }
/// <summary> /// Initialize library /// </summary> public static IntPtr Initialize() { InteropManager = new LibVlcInteropsManager(LibVlcDllsPath); if (IsInitialized) throw new ApplicationException("Cannot initialize libvlc more than one time."); var argsStringfCollection = GetBaseVlcInstanceArguments(); var args = new string[argsStringfCollection.Count]; argsStringfCollection.CopyTo(args, 0); HandleManager.LibVlcHandle = InteropManager.NewInstance.Invoke(args.Length, args); if (HandleManager.LibVlcHandle != IntPtr.Zero) { IsInitialized = true; ErrorHandling = new VlcErrorHandling(); EventsHelper.CanRaiseEvent = true; } return HandleManager.LibVlcHandle; }