Full screen doesn't strech player on whole screen

Jan 19, 2010 at 8:55 AM

Why player is not stretched on whole screen in full screen mode. It just enables full screnn mode of applicaiton?

Mar 5, 2010 at 9:54 AM

Hi lexer,

this might be because you have an anamorphic transcoded movie. The silverlight mediaelement can't handle this. This is not a SMF issue. To get this working you can recode the movie using fixed pixel sizes.

Mar 11, 2010 at 3:39 PM

I have the exact same issue with my application, have tried several media files, some which works in full screen in other players (simple Expression Encoder outputed players). I can't seem to get the MediaElement to fill the screen, instead it's the application "around" which maximizes, but not even fills the screen!

How come?

Mar 21, 2010 at 9:01 PM

The "full screen" button in the player only changes the Application's full screen mode. What you have to do (and what your users most likely expect to happen) is to then make the MediaElement (or surrounding player) take up all the space in your application.

When Full Screen mode is changed, you can subscribe to the event handler inside of Application.Current.Host.Content, like so:

Application.Current.Host.Content.FullScreenChanged += new EventHandler(OnFullScreenChanged);

Then, in your handler, change the player's width/height to match the current size of the screen:

        void OnFullScreenChanged(object sender, EventArgs e)
            if (Application.Current.Host.Content.IsFullScreen)
                player.Width = Application.Current.Host.Content.ActualWidth;
                player.Height = Application.Current.Host.Content.ActualHeight;
                player.Width = normalWidth;
                player.Height = normalHeight;

This can also really depend on how you have your player laid out in your XAML, so make sure it can fill the screen and float above everything else rather than "squishing" other elements (for example in a StackPanel).