• 0

[C#] WPF, MediaElement and hidding elements


Question

Hey guys, I'm wondering if anyone has some advice on this. I'm using a MediaElement from WPF (Windows Presentation Foundation, .Net 3 for the confused) to make a little video player, and I'm hiding interface buttons after a few seconds, but problem is as they disappear I lose a frame of the video, which is rather annoying. I've tried this on a 9250 and a 6600GT, and both do it. I'm just doing a simple Control.Visibility = Collapsed. The video in question is a 18mb WMV.

Is there a way to make processing the video a high priority? Sorry, I'm abit new to WPF. :p

Thanks :)

4 answers to this question

Recommended Posts

  • 0

If I find time, I might play around with this, but would it be possible for you to post some sample code that will reproduce your issue? It doesn't need to be too much, just a sample so that it won't take as long for me to get into it and start playing with it.

  • 0

are you doing it with a timeline?? im reckoning so.

after 3 seconds, make the controls "hidden" and "disabled"

Also, if u turn "snapping" off on the animation creator section. It is on the top right of the timeline screen. If u turn it off and set the number of frames to higher than normal. Maybe 50/60 it should be ok

  • 0
  darthblader said:
are you doing it with a timeline?? im reckoning so.

after 3 seconds, make the controls "hidden" and "disabled"

Also, if u turn "snapping" off on the animation creator section. It is on the top right of the timeline screen. If u turn it off and set the number of frames to higher than normal. Maybe 50/60 it should be ok

I have no idea what you just said.. but I haven't seen any mentioning of a timeline control or anything, so I don't think I do. :p

I think its something to do with the example I was modifying (its called Poor Mans Media Center, you have to google for mcdemo.rar since the link on the Microsoft site doesn't work anymore), as I've been recreating it in a new project and don't have any issues thus far, but I'm missing the "Playlist" feature that the example has.. so perhaps thats what causes the lag.

If you want to take a look anyway,

http://www.deakin.edu.au/~pjmcc/mcdemo.zip (830kb)

You need to extract it to C:\Demos and then edit C:\Demos\shira\shira.xml and replace the first 'video' attribute with a video on your harddrive. I was testing with a 350mb divx. Start her up and then click the grey button I dumped on there a few times and she gets quite laggy.

p.s. watch out for the pictures of crazy singing israeli ladies :blink:

Would be nice to know what the cause might be so I can avoid it in the future. :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.