You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When VideoCaptureElement is added in XAML I can correctly show my webcam video.
If, instead, I add it runtime (see following code), after assigning the VideoCaptureDevice property, MediaFailed is fired ("Capture device not found or could not be created")
publicpartialclassMainWindow:Window{
WPFMediaKit.DirectShow.Controls.VideoCaptureElement VCE;publicMainWindow(){
InitializeComponent();VCE=new WPFMediaKit.DirectShow.Controls.VideoCaptureElement();Content=VCE;}privatevoidWindow_Loaded(objectsender,RoutedEventArgse){
VCE.MediaOpened +=VCE_MediaOpened;
VCE.MediaFailed +=VCE_MediaFailed;
VCE.VideoCaptureDevice = WPFMediaKit.DirectShow.Controls.MultimediaUtil.VideoInputDevices[0];// This is my laptop webcam}voidVCE_MediaOpened(Objectsender,RoutedEventArgse){ ...}voidVCE_MediaFailed(objectsender, WPFMediaKit.DirectShow.MediaPlayers.MediaFailedEventArgs e){ ...}}
The text was updated successfully, but these errors were encountered:
I have the same error. The reason for the error is the property VideoCaptureElement.HasInitialized from the base class MediaElementBase. The property is always false when the VideoCaptureElement is added at Runtime. When these set manuelly to true the Webcam Video are showing as expected.
When VideoCaptureElement is added in XAML I can correctly show my webcam video.
If, instead, I add it runtime (see following code), after assigning the VideoCaptureDevice property, MediaFailed is fired ("Capture device not found or could not be created")
The text was updated successfully, but these errors were encountered: