I have a WPF application with multiple VLC player, (using LibVLCSharp.WPF). For each player, I create a new instance of LibVLC
and I subscribe to the Log
event.
public Player()
{
InitializeComponent();
_libVLC = new LibVLC();
_mediaPlayer = new MediaPlayer(_libVLC);
// we need the VideoView to be fully loaded before setting a MediaPlayer on it.
VideoView.Loaded += (sender, e) => VideoView.MediaPlayer = _mediaPlayer;
_libVLC.Log += MediaPlayerOnLog;
}
The problem is that each log is handled by all the subscribers, so I don't know which player caused which log.
Example: If I try to play rtsp://test
on a player, I receive this log for all the player
[10:52:43.792 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 1 live555: Failed to connect with rtsp://test:554/
[10:52:43.793 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 2 live555: Failed to connect with rtsp://test:554/
[10:52:43.793 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 3 live555: Failed to connect with rtsp://test:554/
[10:52:43.793 ERR] LibVLCSharp.Shared.MediaPlayer - mediaPlayer 4 live555: Failed to connect with rtsp://test:554/
Is it possible to have the logs per player?