views:

50

answers:

1

hey, i've got a wpf application that have a doubleanimation used for scrolling text and images (scrollbar) from the left side of the screen, to the right, and a movie playing, in the same window.

everytime a video ends, and a new video loads, the doubleanimation get stuck/hangs for a second, then it continues normally. i assume it's the control blocking the ui thread while loading the video. i've tried to create a seperate UI thread for the scrolling bar but i didn't solve the problem. i've tried using MediaElement, MediaPlayer and MediaUriElement control with no success.

any help would be appreciated.

A: 

That's a known issue with MediaElement. You pretty much have to preload your videos...which means block the UI thread no, or later ;).

You can also try my MediaUriElement in my WPF MediaKit project. I did as much as possible off thread so this wouldn't happen.

http://wpfmediakit.codeplex.com

Jeremiah Morrill
hey, thanks for the comment! as the title says, i tried MediaUriElement but got the same result, am i doing something wrong? i'm just setting the "source" property. should i use it differently?
Dimor
Sorry didn't see that in the title! Anyways the only thing I do on the UI thread is start another thread and invalidate the D3DImage on a new frame. Everything is done asynchronously between the UI thread and DirectShow. Is your computer pretty beefy in terms of CPU? You can try changing the thread priority in Threading\WorkDispatcherObject.cs to something low, but not sure that will fix it.
Jeremiah Morrill
well, after another test it looks like it does work good with MediaUriElement. thanks alot! :)
Dimor