• 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.
  • Posts

    • I just teams to stop stealing the damn focus every time it starts or restarts after an update. Annoying as all hell.
    • Obviously new hardware costs more money. Never said you get new 2025 hardware for $266. You get new 2025 hardware for as little as $399 and only gets better with back to school sales. At the $499-699, there's some decent spec laptops with 16 GB RAM, and 1 TB SSD with better build quality than this lowest end ideapad.
    • FxSound 1.1.34 Beta by Razvan Serea FxSound (formerly DFX Audio Enhancer / FxSound Enhancer) is now free, making high-quality audio enhancement accessible to everyone. Designed for all PC sound systems, from average setups to audiophile-grade equipment, it offers automatic or fully customizable processing. As automatic or customizable as you want, it utilizes the highest-grade processing to deliver more volume, better equalization, and a wider, deeper sound. For the serious audiophiles, FxSound gives you the tools to adjust the FxSound Effects and EQ to your exact preferences. Turn FxSound on and immediately hear the difference in sound quality. FxSound is ideal for budget audiophiles, music lovers, gamers, transcriptionists, Netflix enthusiasts, and more. It’s particularly beneficial for those relying on quiet laptop speakers or low-quality audio hardware. As a free tool, FxSound excels in boosting volume, enhancing bass, and improving sound quality. No other free EQ for Windows matches its ease of use. FxSound Is Now Completely Free and Unrestricted FxSound Pro is now free for everyone, not just those who can afford it. Get free and unrestricted access to better sound today. FxSound is now entirely supported by users. Click here to donate to help fund continued development and improvements to FxSound. FxSound 1.1.34 Beta changelog: System tray context menu width is fixed and device names are adjusted to width Prompt to save the preset in a new name if changes are made and new preset is selected If preferred device is not connected then it is disabled and greyed out from selection until connected again Application crash dump is saved on unhandled exceptions Download: FxSound 1.1.34 Beta | ARM64 | ~70.0 MB (Open Source) View: FxSound Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Can you get a brand new (not refurb) device like this, but with 2025 hardware, for $266? Under $300? No? If you can, it must have the worst specs otherwise (4gb ram, 1366x768 12in lcd screen, 256gb spinning hard drive, etc.). Please show me this sub-$300 2025 laptop that is better than what the article shows.
  • Recent Achievements

    • One Year In
      TsunadeMama earned a badge
      One Year In
    • Week One Done
      shaheen earned a badge
      Week One Done
    • Dedicated
      Cole Multipass earned a badge
      Dedicated
    • Week One Done
      Alexander 001 earned a badge
      Week One Done
    • Week One Done
      icecreamconesleeves earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      569
    2. 2
      +FloatingFatMan
      187
    3. 3
      ATLien_0
      187
    4. 4
      Skyfrog
      113
    5. 5
      Som
      109
  • Tell a friend

    Love Neowin? Tell a friend!