This is a migrated thread and some comments may be shown as answers.

Fullscreen Stretch

3 Answers 63 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
yok
Top achievements
Rank 1
yok asked on 20 Feb 2011, 05:22 PM
Hi,

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

Sort by
0
Alex Fidanov
Telerik team
answered on 23 Feb 2011, 05:41 PM
Hello yok,

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
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
yok
Top achievements
Rank 1
answered on 23 Feb 2011, 06:37 PM

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>
0
Hristo
Telerik team
answered on 24 Feb 2011, 02:45 PM
Hello yok,

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.

Regards,
Hristo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
MediaPlayer
Asked by
yok
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
yok
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or