Is there a way to see if a MediaElement is playing

I would like to perform a conditional that looks to see if a video is playing in my MediaElement. Possible?


Thanks

[133 byte] By [Dvlnblk] at [2008-1-4]
# 1

Hello, looks like there’s no build in property for this. But you can try to create your own property, say, IsPlaying, which type is bool. You need to update its value every time you call the Play, Stop, Pause, and Close method.

Yi-LunLuo-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2

Yes, sorry there is no built-in property in v1 WPF that would give you that information, but I have added a request for our further releases to include this. One thing you could try is to look for change in the Position value within a period of time (ie: a few milliseconds).

Thanks.

EddieLi-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3
Both excellent answers. I guess the Boolean thing will be the way to go for now. Thanks!
Dvlnblk at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified