player.Play() does not work anymore!

Topics: Windows 8 Xaml
Feb 20, 2013 at 1:20 PM
If I add a button to the PosterPage sample. and in the click event handler I call player.Play() The video does not play.

here the minor change to PosterPage sample that I am making to test this.

    <Grid Style="{StaticResource LayoutRootStyle}">
        <StackPanel>
            <Button x:Name="ManualPlayButton" Content="Play" Click="ManualPlayButton_Click_1"/>
            <mmppf:MediaPlayer x:Name="player" AutoLoad="False" Source="http://smf.blob.core.windows.net/samples/videos/bigbuck.mp4" PosterSource="http://smf.blob.core.windows.net/samples/thumbs/BBB/BigBuckBunny_0002.jpg"/>
        </StackPanel>
    </Grid>
and in the code behind.

        private void ManualPlayButton_Click_1(object sender, RoutedEventArgs e)
        {
            player.Play();
        }
When I click this manual play button, the video will not play. If I monitor PlayerStateChanged the event is raised and the reported new value is PlayerState.Starting yet it does not.

If I use the normal mmppf:PlayPause button it works fine.

What else do I need to do to make the player play from this manual play button in the example I have just described.

In my real world app the play command is called after age verification. so I cannot use the mmppf:PlayPause button.
Coordinator
Feb 27, 2013 at 7:23 PM
You'll need to set AutoLoad back to true when you are ready to start. AutoLoad controls loading the video and AutoPlay (or .Play) controls playing the video.