videoplayer to resize if video is in portrait mode

2 posts, 0 answers
  1. Sjors
    Sjors avatar
    9 posts
    Member since:
    May 2012

    Posted 14 Feb 2013 Link to this post


    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 

    here I have uploaded a sample portrait video:
  2. Hristo
    Hristo avatar
    352 posts

    Posted 19 Feb 2013 Link to this post

    Hi Sjors,

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

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top