Could you put the answer if you found the it?
Could you put the answer if you found the it?
26% when using .net 3.5
down to 7% after upgrade to .net 4.5
Here they are.
Groeten/Regards,
Frank van Bokhoven
Yggdra Solutions | ||
Arnhemseweg 39 | kvk: 09193694 | |
6991DK Rheden | 026-3706499 | |
[email removed] | 06-48109250 |
workground:
//public delegate IntPtr NewInstance(int argsCount, [MarshalAs(UnmanagedType.LPArray)]string[] args);
public delegate IntPtr NewInstance(int argsCount, IntPtr argv);
IntPtr[] argvsPtr = new IntPtr[args.Length];
for (int i = 0; i < args.Length; i++)
{
argvsPtr[i] = Marshal.StringToHGlobalAnsi(args[i]);
}
GCHandle gch = GCHandle.Alloc(argvsPtr, GCHandleType.Pinned);
IntPtr argvPtr = gch.AddrOfPinnedObject();
HandleManager.LibVlcHandle = InteropManager.NewInstance.Invoke(args.Length, argvPtr);
gch.Free();
for (int i = 0; i < args.Length; i++)
{
Marshal.FreeHGlobal(argvsPtr[i]);
}
Avoid using the media=directly. i have been using this assembly in my own code successfully for 6 months and following works for me:
1. if you have dragged the control onto your form. go into the designer and comment out the line
' Me.Vlcplayer.Media = Nothing
2. . if you ever modify the form objects the designer will put it back so you may have to repeat this.
3. . In your play function use something like the following where the parameter is the full path to the video or audio file.
```
Public Sub DoPlay(ByVal vvsToPlay As String)
MediaFile = New Vlc.DotNet.Core.Medias.PathMedia(vvsToPlay)
lblNowPlaying.Text = vvsToPlay
Vlcplayer.Play(MediaFile)
End sub
```