Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF MediaElement pauses when trying to play Windows Media Center recording [closed]

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.

like image 352
eborlas Avatar asked Apr 22 '10 18:04

eborlas


2 Answers

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.

like image 195
Nate Zaugg Avatar answered Nov 03 '22 21:11

Nate Zaugg


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.

like image 32
Sam Saffron Avatar answered Nov 03 '22 23:11

Sam Saffron