I set the VideoStretch property of RadMediaItem to Uniform and it works fine. But when fullscreen mode is activated, video fills the screen like its Strecth property set to Fill (distorting the aspect ratio of the video).
Is there a way to set VideoStrecth propetry to Uniform in fullscreen mode?
Regards.
3 Answers, 1 is accepted
For fullscreen, we are using a rectangle with a visual brush to display the movie. However, I see that the visual brush's Stretch property is not set or bound. What you can do is to modify the default template of the RadMediaPlayer and bind or set this property:
<
Rectangle
x:Name
=
"PopupMediaRectangle"
>
<
Rectangle.Fill
>
<
VideoBrush
x:Name
=
"PopupMediaBrush"
Stretch
=
"{Binding ...}"
/>
</
Rectangle.Fill
>
</
Rectangle
>
Best wishes,
Alex Fidanov
the Telerik team
Hi,
I tried the solution you suggested. But it didn't work. Then I tried to change the Stretch property of the Rectangle, HorizontalContentAlignment of telerik:RadMediaPlayerWrapper and some other stuff but it didn't help.
The style given below has only one update and it is the Stretch property of VideoBrush.
Could you please make a test and find a solution to this problem. I think it must be fixed in the next release also.
Regards.
<
Style
x:Key
=
"RadMediaPlayerStyle2"
TargetType
=
"telerik:RadMediaPlayer"
>
<
Setter
Property
=
"FontSize"
Value
=
"10"
/>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource MediaPlayer_ForegroundTime}"
/>
<
Setter
Property
=
"Volume"
Value
=
"0.5"
/>
<
Setter
Property
=
"Background"
Value
=
"Black"
/>
<
Setter
Property
=
"Padding"
Value
=
"1"
/>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Top"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerik:RadMediaPlayer"
>
<
Grid
x:Name
=
"LayoutRoot"
Margin
=
"{TemplateBinding Padding}"
>
<
telerik:RadMediaPlayerWrapper
x:Name
=
"MediaPlayerWrapper"
Background
=
"{TemplateBinding Background}"
Foreground
=
"{TemplateBinding Foreground}"
Height
=
"{Binding VideoHeight}"
Grid.Row
=
"1"
Width
=
"{Binding VideoWidth}"
>
<
MediaElement
x:Name
=
"MediaElement"
AutoPlay
=
"True"
BufferingTime
=
"{Binding BufferingTime}"
DataContext
=
"{TemplateBinding SelectedMediaItem}"
Height
=
"{Binding VideoHeight}"
Stretch
=
"{Binding VideoStretch}"
Volume
=
"{TemplateBinding Volume}"
Width
=
"{Binding VideoWidth}"
/>
</
telerik:RadMediaPlayerWrapper
>
<
ContentPresenter
ContentTemplate
=
"{TemplateBinding HeaderTemplate}"
Content
=
"{TemplateBinding Header}"
HorizontalAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment
=
"{TemplateBinding VerticalContentAlignment}"
/>
<
telerik:Popup
x:Name
=
"FullScreenPopup"
IsOpen
=
"False"
Grid.Row
=
"1"
>
<
telerik:RadMediaPlayerWrapper
x:Name
=
"PopupMediaPlayerWrapper"
Background
=
"{TemplateBinding Background}"
Foreground
=
"{TemplateBinding Foreground}"
Height
=
"{Binding VideoHeight}"
Width
=
"{Binding VideoWidth}"
>
<
Rectangle
x:Name
=
"PopupMediaRectangle"
>
<
Rectangle.Fill
>
<
VideoBrush
x:Name
=
"PopupMediaBrush"
Stretch
=
"Uniform"
/>
</
Rectangle.Fill
>
</
Rectangle
>
</
telerik:RadMediaPlayerWrapper
>
</
telerik:Popup
>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
In deed I managed to reproduce the issue and it was caused by a bug in our control. I've logged it in our public issue tracking system. You can follow its status and vote for it through following link: http://www.telerik.com/support/pits.aspx#/public/silverlight/4933
Hole the fix will be included in our next internal build or the official 2011.Q1 release.
Also I added 1000 Telerik points to your account.
Hristo
the Telerik team