Published
Wednesday, December 13, 2006 3:39 AM
by
mtaulty
I had a quick stab at putting a few MediaElements on a WPF/E control and I was pretty pleased with the sort of performance that it seems to give you.
The result is here;
In doing this I ended up creating 12 MediaElements in XAML rather than in code (I guess a code approach would be more elegant and less copy-and-paste) and, for reasons stated previously, to animate them means using 12 storyboards which was a bit painful. One storyboard that could be re-targeted would be a great improvement there.
Each MediaElement plays the same video (the xbox.wmv borrowed from the SDK) so I'm not sure to what extent that aids performance although when you run this from my website, the website is slow enough that each video ends up being at a different point in its lifetime.
(There's a very basic "mouse-over" animation on the MediaElement that doesn't really work 100% but it's interesting to see a number of MediaElements working at the same time alongside a little animation).
Update - I modified this a little in order that it used 12 different videos rather than a single one. The updated version is on the link below (it animates slightly differently as well). Be aware that this means downloading 12 videos from my site which will take a long time so best plan is to run it up, wait for the videos to load and when they're all done press F5 to start again with cached videos.
http://mtaulty.com/wpfe/ex6.html