views:

178

answers:

2

I have an WPF application that starts a live tv recording using Windows Media Center, using the Windows Media Center SDK, waits 2 minutes and then plays the currently recording file (.wtv) in a WPF MediaElement. The problem is that the video visual will freeze and it is not consistent on when it happens. I have looked into it and discovered that the timeline is still moving so the MediaElement still thinks that the video is playing.

This happens only when trying to play a video file that is currently being recorded, previously recorded shows play just fine. Both Media Center and Media Player can play those files without any hiccups; it is only the WPF MediaElement that has this problem. Any help would be appreciated.

+1  A: 

My guess is that the way the media element works is that it grabs the size of the file it's about to stream at the time you first play it and gets stuck after that. It's just a guess but I have no other information to go off of.

I do know that the MediaElement is really good at switching streams and resuming in those streams. Perhaps there is a work around you can find where every so often it will refresh the stream and resume from it's current position.

Nate Zaugg
A: 

This sounds like an MS bug.

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

Sam Saffron