Dimor
Dimor

Reputation: 53

MediaElement/MediaPlayer/MediaUriElement hangs UI thread while loading a video

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.

Upvotes: 1

Views: 3280

Answers (1)

Jeremiah Morrill
Jeremiah Morrill

Reputation: 4268

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

Upvotes: 1

Related Questions