views:

798

answers:

1

Here's my Xaml for a MediaElement:

        <MediaElement x:Name="mediaElement" Width="400" Height="300" Stretch="UniformToFill" IsMuted="True">
            <MediaElement.Triggers>
                <EventTrigger RoutedEvent="MediaElement.Loaded">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <MediaTimeline Source="temp.wmv" Storyboard.TargetName="mediaElement" RepeatBehavior="Forever" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </MediaElement.Triggers>
        </MediaElement>

the video temp.wmv is about 10 megs and 2 minutes long... it's not terribly high def either, I think it's below DVD quality. I expected the Storyboard to make the video start from the beginning immediately after it finishes, but for some reason it takes a long time, sometimes minutes, for the video to start back up. Is there anything that could be effecting the time it takes for the video to repeat?

+1  A: 

For any others looking at this - the MediaElement in WPF 3.5 sp1 is horribly buggy and will receive many fixes in 4.0 that aren't in beta 1. Try Jeremiah Morrill's open source WPF MediaKit here http://wpfmediakit.codeplex.com and use the MediaUriElement with Loop=true for a good looping media experience.

James Cadd