Can't get Silverlight Media Framework SMFPlayer to show film full screen or correct aspect ratio

690 Views Asked by At

I am using the latest version of the Silverlight Media Framework on Windows Phone 8. I have got both standard MP4's and DRM encrypted MWV media to play successfully.

However, neither will play to the full extent of the screen. The standard MP4's play with the correct aspect ratio, but don't fill the available area. Some film do, so I imagine that some have a lower resolution than the phone, so play smaller. It would be good to get even lower resolution films to play to full screen.

The DRM films fill the screen vertically, but are 'squished' horizontally (in a 4:3 aspect ratio). These are supposed to be wide screen movies (!

I have tried a few things, such as setting the play item to the height and width of the player

item.VideoHeight = player.ActualHeight;
item.VideoWidth = player.ActualWidth;
item.VideoStretchMode = Stretch.Uniform;

This didn't work. Nor did setting the following in the player xaml!

HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"

I am using the simplest implementation in XAML at the moment.

<core:SMFPlayer 
Name="player"
IsEnabled="True"
Grid.Row="0" 
CaptionsVisibility="Disabled"
VolumeLevel="50"
Visibility="{Binding DisplayError, ConverterParameter=true, Converter={StaticResource BoolToVisibilityConverter}}" 
/>

Can someone help? I need to be able to force all media playback to play as full screen as possible while maintaining aspect ratio and not clipping.

Are there any properties of the SMF I can set to get films to play as large as possible and preserve aspect ratios?

1

There are 1 best solutions below

0
On

You want your containers, not just your video, to have Stretch="Uniform" set. That is, either Grid, SMFPlayer, etc... I'm not sure exactly which element will need to have that, it depends on your XAML.

This should do what you want: fill as much as possible the screen, while retaining aspect ratio, without cropping. There is another mode if you want to 'zoom', ie crop so screen is always filled: Stretch="UniformToFill".