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

videoplayer to resize if video is in portrait mode

1 Answer 94 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Sjors
Top achievements
Rank 1
Sjors asked on 14 Feb 2013, 12:48 PM
Hi,

I am trying to get the radmediaplayer to resize itself if a source video is in portrait mode.

I have a fixed width of 350px available in my UI for the player to be displayed.
The height of the player is allowed to change to fit the video.

I would expect the following code to do the trick but it doesn't.

private RadMediaItem CreateVideoMediaItem(Guid contentId, string previewFilePath)
{
  _radMediaPlayer.Width = 350;
 
  return new RadMediaItem
  {
    Source = new Uri(GetUri(contentId, previewFilePath)),
    IsSelected = true,
    VideoStretch = Stretch.Uniform
  };
}

I tried all other modes of the VideoStrech enumeration but no luck.
I also thought that maybe I could set the height and width of the player manually after looking at the original video source's dimensions but these do not seem to be available.

The properties player.MediaElement.NaturalVideoHeight/Width as described in this post are still 0 after 
_radMediaPlayer.Items.Add(radMediaItem);
_radMediaPlayer.Play();


here I have uploaded a sample portrait video: http://we.tl/vYS9cGTAKd

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 19 Feb 2013, 10:32 AM
Hi Sjors,

I have post an answer in you support ticket. I suggest you to continue the discussion there.

All the best,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
MediaPlayer
Asked by
Sjors
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or