How to make a VideoCaptureElement start "Stopped"?

Sep 9, 2011 at 11:29 AM

Hi there!

In the VideoCaptureElement there is a property IsPlaying, but that's readonly. I'd like the VideoCaptureElement to be stopped until I call .Play().

I've tried using IsRenderingEnable but when I set that to false and afterwards I call .Play() I get an exception (System.Exception in WPFMediaKit.dll).

Any help?

 

Thanks in advance,

Gianluca.

Sep 9, 2011 at 11:35 AM
Hi again!
I've just double-checked. Even if I run 
<my:VideoCaptureElement 
                    DesiredPixelWidth="640" 
                    DesiredPixelHeight="445" 
                    FPS="30" 
                    Width="640" 
                    Height="445" 
                    VideoCaptureDevice="{Binding Path=SelectedItem, ElementName=videoCapDevices}" 
                    x:Name="videoElement" Stretch="Fill" />

I get a System.Exception in WPFMediaKit.dll. videoCapDevices is a dropdown with all the available peripherals, and no code-behind is interfering. 
What happens is that when I select a webcam from the dropdown, the video stream comes up but I get that annoying exception (non blocking though).
I was thinking it was caused by the IsRenderingEnable property, but apparently it is not. 

cheers,
Gianluca.
Sep 13, 2011 at 1:57 PM

Sorry folks. Just realized that there is a property LoadBehavior, which can be set to Manual in order to prevent the auto-play at startup...

 

Cheers,

Gianluca.