I get the "cross-thread operation not valid" here:
if ( vlc.State == VlcPlayerControlState.PLAYING )
{
if ( vlc.InvokeRequired )
{
vlc.Invoke( new MediaPlayerNoParameterDelegate( vlc.Stop ) );
}
else
{
vlc.Stop(); // debugger points here
}
}
Debugging shows me that vlc doesn t require invoking. but the thread from which this is accessed is different from the thread it was created on.
I m using the libvlc.net wrapper to play sound, but the problem should not be there. How can I get rid of this exception?
I m using threading not backgroundworker.
Thank you!