Flicker / Black Videoframes using 2 MediaUriElements in one application

Apr 17, 2013 at 9:27 AM
Hi,

using 2 MediaUriElements in one application flickers / shows black screen in both MediaElements.

The bug is reproducable, simply adding a second MediaUriElement in the SampleApplication MediaUriPlayerWindow.xaml.


Change:
<Border x:Name="mediaPlayerContainer"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                Width="Auto"
                Height="Auto">
            <DirectShowControls:MediaUriElement x:Name="mediaPlayer"
                                                Volume="1"
                                                Source="{Binding ElementName=fileDialog, Path=FilePath}"
                                                Stretch="Uniform"
                                                VideoRenderer="VideoMixingRenderer9"
                                                LoadedBehavior="Play"
                                                SpeedRatio="1.0"
                                                Loop="True"/>
        </Border>

to:

<StackPanel>
        <Border x:Name="mediaPlayerContainer"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                Width="Auto"
                Height="Auto">
            <DirectShowControls:MediaUriElement x:Name="mediaPlayer"
                                                Volume="1"
                                                Source="{Binding ElementName=fileDialog, Path=FilePath}"
                                                Stretch="Uniform"
                                                VideoRenderer="VideoMixingRenderer9"
                                                LoadedBehavior="Play"
                                                SpeedRatio="1.0"
                                                Loop="True"/>
        </Border>
        <Border x:Name="mediaPlayerContainer2"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                Width="Auto"
                Height="Auto">
            <DirectShowControls:MediaUriElement x:Name="mediaPlayer2"
                                                Volume="1"
                                                Source="{Binding ElementName=fileDialog, Path=FilePath}"
                                                Stretch="Uniform"
                                                VideoRenderer="VideoMixingRenderer9"
                                                LoadedBehavior="Play"
                                                SpeedRatio="1.0"
                                                Loop="True"/>
        </Border>
        </StackPanel>
and set the height to 800 or resize the window.

Any idea how to fix this ?

Greetings Dominik