rss
 
comment(s)

archives
J|F|M|A|M|J|J|A|S|O|N|D
(20##) 10 9 8 7 6 5 4 3 2 1 0 <
 
DesktopWeb FormText   WPF : MediaElementThu, 27 Oct 2005 05:02:46 GMT # 

this was tonights beating. the examples i've seen just have the Source set to some hardcoded video path in XAML. that made it look deceptively easy. in my code i tried to set its Source to a FileInfo.FullName but it ended up taking a MediaTimeline. went ahead and created that and set it to the MediaElement.Source. fired up my app and nothing happened? bunch of searching and saw that i also needed a MediaClock. created that from the MediaTimeline and called Controller.Start(). fired it up and i could hear audio but video wasn't displaying. crap ... looks like the video driver issue again. but then i notice that the audio only plays for a couple seconds. hmm ... maybe an object lifetime issue. took a while, but i finally realized i should be setting the MediaClock that was created on the MediaElement. i had been holding on to an instance of the MediaClock, but that wasn't enough. set that property and video playback starts working! the only problem i get now is that it periodically gets in a bad state and throws a ComException 0x8876017C for 'Out Of Memory'. this sucks because it doesn't seem to recover and just stays in this bad state once its been reached. anyway, i should finish the Video functionality tomorrow night