Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - More than 3 MediaElements Don't Work

 
 
Old 03-30-2006   #1 (permalink)
Adam Miles


 
 

More than 3 MediaElements Don't Work

Hi,

I've been toying around with the idea of creating a small 3x3 video wall for
a while and tried tonight to get it going. I have a grid that contains 9
small grids in a 3x3 square, and in each grid is a single MediaElement. On
the click event of the Grid, the contained MediaElement should start playing
the video. When you click on another grid, all other videos pause, and the
new one starts playing.

That was the theory, in practice, it works up until the 4th video is
clicked, then nothing happens. The fourth video doesn't ever even render a
black frame at the start, although the previous video does pause. It is
always on the 4th video, no matter what order, what speed I try clicking on
the grids.

Obviously WPF/Avalon is still a way from being finished, but MediaElement
does seem rather flaky at the moment. I updated the two files in system32
that I saw was a fix for black screen no audio, and this appears to have
worked. But for some reason 3 does seem to be a hard limit that I can't get
past, whatever the videos.

For reference, instead of simply pausing the videos, I tried Closing them,
to see if this would help, it didn't. My secondary question is, once a video
has been Closed, how do you start it again? Play() won't work as "the only
valid operations on a closed file are Open and Close" (paraphrased from debug
output)... but Open doesn't even exist?!

In summary, a) Is there something up with more than 3 open MediaElements at
once playing Video?
b) What is the best way of putting a video on hold while another one plays,
Pause? Close then reopen (somehow?)?

Many thanks,

Adam Miles

My System SpecsSystem Spec
Old 03-30-2006   #2 (permalink)
Tom Mulcahy [MSFT]


 
 

RE: More than 3 MediaElements Don't Work

> I've been toying around with the idea of creating a small 3x3 video wall for
> a while and tried tonight to get it going. I have a grid that contains 9
> small grids in a 3x3 square, and in each grid is a single MediaElement. On
> the click event of the Grid, the contained MediaElement should start playing
> the video. When you click on another grid, all other videos pause, and the
> new one starts playing.

This is quite an inefficient way of doing things. You might want to consider
grabbing the output of a video and putting it into an image using a
RenderTargetBitmap rather than keeping the videos in a paused state. Videos
use significant resources even while paused.

> That was the theory, in practice, it works up until the 4th video is
> clicked, then nothing happens. The fourth video doesn't ever even render a
> black frame at the start, although the previous video does pause. It is
> always on the 4th video, no matter what order, what speed I try clicking on
> the grids.

This is a known issue on older versions of Avalon and will be fixed in the
Beta 2 release.

> Obviously WPF/Avalon is still a way from being finished, but MediaElement
> does seem rather flaky at the moment. I updated the two files in system32
> that I saw was a fix for black screen no audio, and this appears to have
> worked. But for some reason 3 does seem to be a hard limit that I can't get
> past, whatever the videos.

You are likely running out of video memory. You could probably get past this
limit by upgrading your video card and/or playing videos with lower
resolutions.

> For reference, instead of simply pausing the videos, I tried Closing them,
> to see if this would help, it didn't. My secondary question is, once a video
> has been Closed, how do you start it again? Play() won't work as "the only
> valid operations on a closed file are Open and Close" (paraphrased from debug
> output)... but Open doesn't even exist?!

I suppose this is a bit confusing. There is an Open method on MediaPlayer.
The analogue for MediaElement is the Source property.

Yes, Close is supposed to clean up all resources. This is another bug that
will be fixed in the Beta 2 release.

> In summary, a) Is there something up with more than 3 open MediaElements at
> once playing Video?

3 isn't a magic number, but yes there are problems with multiple videos in
previous releases of Avalon. They will be fixed in the Beta 2 release.

> b) What is the best way of putting a video on hold while another one plays,
> Pause? Close then reopen (somehow?)?

Closing is definitely preferable to keeping the video paused in terms of
efficiency. If you wish to keep the output of the video then you will have to
capture it using a RenderTargetBitmap.

Tom
My System SpecsSystem Spec
Old 03-30-2006   #3 (permalink)
Ed Maia [MSFT]


 
 

RE: More than 3 MediaElements Don't Work

What version of WinFX are you running on?

There have been a number of improvements to MediaElement in later builds.
Depending on the type of hardware you have, we added software fallback of
video starting with Feb CTP. You may just be running out of video memory.

Closing and subsequently playing a MediaElement is expected to work, perhaps
it is a known bug in the build you are using (we have had some in the past).
I would try playing with the LoadedBehavior, UnloadedBehavior, and Source
properties to see if you can get it to reopen the file.

Ideally, we recommend using as few MediaElements as possible to enable your
scenario, as they are a pretty heavy resource. In your scenario, it sounds
like you should be able to open all files on a single MediaElement, or
perhaps switch between two of them (one plays the current video while the
other preloads the next).

If all else fails, I would listen to the MediaFailed event and see if there
is a useful message there.

Thanks,
Ed


"Adam Miles" wrote:

> Hi,
>
> I've been toying around with the idea of creating a small 3x3 video wall for
> a while and tried tonight to get it going. I have a grid that contains 9
> small grids in a 3x3 square, and in each grid is a single MediaElement. On
> the click event of the Grid, the contained MediaElement should start playing
> the video. When you click on another grid, all other videos pause, and the
> new one starts playing.
>
> That was the theory, in practice, it works up until the 4th video is
> clicked, then nothing happens. The fourth video doesn't ever even render a
> black frame at the start, although the previous video does pause. It is
> always on the 4th video, no matter what order, what speed I try clicking on
> the grids.
>
> Obviously WPF/Avalon is still a way from being finished, but MediaElement
> does seem rather flaky at the moment. I updated the two files in system32
> that I saw was a fix for black screen no audio, and this appears to have
> worked. But for some reason 3 does seem to be a hard limit that I can't get
> past, whatever the videos.
>
> For reference, instead of simply pausing the videos, I tried Closing them,
> to see if this would help, it didn't. My secondary question is, once a video
> has been Closed, how do you start it again? Play() won't work as "the only
> valid operations on a closed file are Open and Close" (paraphrased from debug
> output)... but Open doesn't even exist?!
>
> In summary, a) Is there something up with more than 3 open MediaElements at
> once playing Video?
> b) What is the best way of putting a video on hold while another one plays,
> Pause? Close then reopen (somehow?)?
>
> Many thanks,
>
> Adam Miles

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
speakers randomly wont work sometimes on laptop but external will sometime work Sound & Audio
Still searching for way to get Vista search to work: Why doesn't FilterFilesWithUnknownExtensions registry key work in Vista? Vista General
all cd's don't work, but dvd's still work Vista hardware & devices
HP LaserJet 1010 don't work in Vista since Beta2 - Advanced 1384 Printing Support drivers for XP don't work Vista print fax & scan
Will all the programs that work on xp work on vista? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46