WPF MediaElement pauses when trying to play a recording in Windows Media Center

I have a WPF application that starts real-time recording using the Windows Media Center using the Windows Media Center SDK, waits 2 minutes, and then plays the current recording file (.wtv) in WPF MediaElement. The problem is that the video image freezes, and this is not consistent with when it happens. I looked at it and found that the timeline is still moving, so MediaElement still thinks the video is playing.

This only happens when you try to play the video file that is currently being recorded, previously recorded shows play very well. Both Media Center and Media Player can play these files without any hiccups; This problem has only WPF MediaElement. Any help would be appreciated.

+6
c # wpf windows-media-center television
source share
2 answers

My hunch is that the way you work with media elements is that it captures the size of the file that it is about to transfer at the time you play it for the first time and get stuck after that. This is just an assumption, but I have no other information to leave.

I know that MediaElement is really good at switching streams and resuming in those streams. Perhaps there is work around, you can find where everyone will update the stream so often and resume the current position from it.

+1
source share

It sounds like an MS error.

You can configure an HTTP proxy for a wtv file, and then tell MediaElement to play the stream and not give it the actual size. Its a lot of work, but it can just work.

+1
source share

All Articles