• 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

    • Fully know where this has come from… If we cannot block mods (for yes, the stunningly obvious reasons), then perhaps one could not start arguments where they don’t need to exist and people are trying to help each other.
    • Is it in a case? Do you game while connected to a charger?
    • NotebookLM's Audio Overviews is coming to Google Search by Aditya Tiwari Audio Overviews will find a new home in another Google product. The search giant announced that Audio Overviews will be available on Google Search this time through its latest experiment in Search Labs. The feature will use Google's latest Gemini models to generate quick, conversational audio overviews for certain search queries. An option will appear on Google Search to generate a short audio summary on the topic of your query. However, according to the company, the option to generate summaries will only appear "when our systems determine it might be useful. " When interacting with the Audio Overviews card, you can tap on the thumbs-up/down button to register your feedback about the generated response. "Searching for a topic you’re not familiar with? An audio overview can help you get a lay of the land, offering a convenient, hands-free way to absorb information whether you're multitasking or simply prefer an audio experience," Google said in a blog post. Google added that it would also display related web links within the audio player interface on its search results page to explore a particular topic more. You can try out Audio Overviews in Google Search by opting in to the experiment. For the uninitiated, Audio Overviews was introduced in NotebookLM last year. It offers the ability to create AI-generated podcasts and audio summaries from information sources, including written content, audio files, and YouTube videos. It features multiple AI voices or hosts who explain things in a conversational, natural-sounding way, as if two people are discussing a topic. Audio Overviews in NotebookLM also added support for more than 50 new languages and made its way to the Gemini app earlier this year. At I/O 2025, the search giant added length customization options, allowing users to change the length of their AI podcasts.
    • Cries in Autodesk...... Or Adobe, or Affinity. Or.......
  • Recent Achievements

    • Explorer
      Case_f went up a rank
      Explorer
    • Conversation Starter
      Jamie Smith earned a badge
      Conversation Starter
    • First Post
      NeoToad777 earned a badge
      First Post
    • Week One Done
      JoeV earned a badge
      Week One Done
    • One Month Later
      VAT Services in UAE earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      579
    2. 2
      ATLien_0
      254
    3. 3
      +Edouard
      161
    4. 4
      +FloatingFatMan
      155
    5. 5
      Michael Scrip
      114
  • Tell a friend

    Love Neowin? Tell a friend!