RadMediaPlayer issue with Source set as RelativeUrl

9 posts, 0 answers
  1. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Nov 2013 Link to this post

    Hi,

    I have come across a strange behavior with RadMediaPlayer (version : 2013.3.1015.40) while specifying the relative path of a media file. If the "Source" property is set to a relative path using the Web application root operator (~), the video won't load. Instead of using the (~) operator, if I specify the relative path using ../FolderName/ then the control works as expected. The relative URL containing the Web application root operator works properly when it is set to the Path property of the MediaPlayerSource under the Sources tag.

    ASPX: (Video does not load)
    <telerik:RadMediaPlayer ID="RadMediaPlayer2" runat="server" Width="500" Height="400px"
        Source="~/Videos/RadControls.mp4">
    </telerik:RadMediaPlayer>

    ASPX: (Video loads as expected)
    <telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" Width="500" Height="400px">
        <Sources>
            <telerik:MediaPlayerSource Path="~/Videos/RadControls.mp4" />
        </Sources>
    </telerik:RadMediaPlayer>

    Please have a look into this complete solution where the above mentioned issue can be replicated. Also I would like to point out that if I select the media file through the controls smart tag, the relative URL generated for the Source will be having the Web application root operator (~) (check the screenshot attached) but the video wont load which seems to confuse the users.

    Thanks,
    Shinu.
  2. Senad
    Senad avatar
    10 posts
    Member since:
    Jul 2012

    Posted 19 Nov 2013 Link to this post

    Hi Shinu,

    I had the same problem you described. Since I have to create the player from codebehind, my solution was like this:

    player = new RadMediaPlayer();
            player.ID = "RadMediaPlayer1";
            player.Title = video.Title;
     
                MediaPlayerSource mpSource = new MediaPlayerSource();
                mpSource.Path = "../Video/lozinka.mp4";
                player.Sources.Add(mpSource);
     
            player.StartVolume = 90;
            player.OnClientReady = "playerReady";
            player.Height = Unit.Pixel(336);
            player.Width = Unit.Pixel(600);
            //player.FullScreen = true;
            player.HDActive = true;
            player.VolumeButtonToolTip = "Zvuk";
            player.FullScreenButtonToolTip = "Veći ekran";
            player.Skin = "Metro";
     
            //player.ToolBar.HDButton.Style["display"] = "none";

    I beleive this should be fixed by the dev team.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 21 Nov 2013 Link to this post

    Hello Guys,

    Thank you for bringing this problem to our attention. We are aware of the tilda problem and our developers will fix it for the upcoming releases.

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  5. Shwetha
    Shwetha avatar
    12 posts
    Member since:
    Nov 2013

    Posted 03 Mar 2014 in reply to Shinu Link to this post

    We have video files saved on a separate file server. Is it possible to play videos by setting source of mediaplayer to file server. Please let me know. I have latest version(2013.3.1324.35) of Telerik's controls.

    Also, specifying absolute path to source doesn't seem to work locally? Please clarify.

    Thank you.
  6. Shwetha
    Shwetha avatar
    12 posts
    Member since:
    Nov 2013

    Posted 05 Mar 2014 Link to this post

    To play videos using media player, is it necessary to have videos saved as part of application?
    I have separate folder for videos under same project in Visual studio. When I set relative path to source, videos are playing. But if I store videos in different drive/another server and map path to source as virtual directory, it doesn't work. Please help. Thanks.
  7. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 06 Mar 2014 Link to this post

    Hello Shwetha,

    I'm afraid ASP.NET does not support converting physical path to an app relative one. You can check various sources over the net about this matter and verify it using a simple asp:Image or the regular HTML5 video tag:
    http://www.w3schools.com/html/html5_video.asp

    I hope the clarification was helpful.

    Regards,
    Eyup
    Telerik

    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

  8. Shwetha
    Shwetha avatar
    12 posts
    Member since:
    Nov 2013

    Posted 06 Mar 2014 in reply to Eyup Link to this post

    Earlier I had virtual directory for video files outside application and it was not working. Now I created virtual directory inside application and media player can reference files with relative path. Its also working now. Thanks.
  9. Nikola
    Nikola avatar
    1 posts
    Member since:
    Jan 2015

    Posted 14 Aug 2015 Link to this post

    Hello everybody,

     

    I am having a problem with using RadMediaPlayer, and I think that the problem is because of the file path.

    My file is saved on the server but for some reason player does not  want to play it. I can see all the buttons labels but the time is 0:00 and nothing happens.

    When I start my application locally I get the video without any problems. 

    Can you tell me what can be the problem?

    I am using Telerik library version 2015.2.729.40. file is .mp4 type so I think that there is some small thing that I have missed.

     

     This is my code for playing the video:

     

    ASPX
     
    <div class="demo-container">
        <telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" AutoPlay="true" Skin="Office2010Blue" Visible = "false" >
                <PlaylistSettings Mode="Buttons" ButtonsTrigger="MouseDown"  />
        </telerik:RadMediaPlayer>
        <asp:Label id="lblSources" runat="server" Text ="" />
    </div>
     
    VB
    With RadMediaPlayer1
          .Visible = True
          .ObjectHeight
          .ObjectWidth
          With .TitleBar
               .ShareButton.Visible = False
          End With
     
          Dim oMPS As New Telerik.Web.UI.MediaPlayerSource
          With oMPS
               .Path = "~" & FilePath
          End With
     
          Dim oMPVF As New Telerik.Web.UI.MediaPlayerVideoFile
          With oMPVF
               .AutoPlay = True
               .Sources.Add(oMPS)
          End With
     
          With .Playlist
               .Add(oMPVF)
          End With
     
          lblSources.Text = oMPS.Path.ToString
    End With
  10. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 19 Aug 2015 Link to this post

    Hi Nikola,

    Do you have this problem on every browser or only on IE?
    http://docs.telerik.com/devtools/aspnet-ajax/controls/mediaplayer/troubleshooting/playing-video-on-ie

    Generally, RadMediaPlayer should be able to play any video, which is playable with the standard HTML5 video tag and even Flash videos. You can hardcode your Source path to see the result:
    http://www.w3schools.com/html/html5_video.asp

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017