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

RadMediaPlayer issue with Source set as RelativeUrl

9 Answers 454 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Shinu
Top achievements
Rank 2
Shinu asked on 16 Nov 2013, 08:10 AM
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.

9 Answers, 1 is accepted

Sort by
0
Senad
Top achievements
Rank 1
answered on 19 Nov 2013, 10:16 PM

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.

0
Eyup
Telerik team
answered on 21 Nov 2013, 07:40 AM
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.
0
Shwetha
Top achievements
Rank 1
answered on 03 Mar 2014, 02:40 PM
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.
0
Shwetha
Top achievements
Rank 1
answered on 05 Mar 2014, 08:54 PM
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.
0
Eyup
Telerik team
answered on 06 Mar 2014, 09:01 AM
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!

0
Shwetha
Top achievements
Rank 1
answered on 06 Mar 2014, 06:13 PM
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.
0
Nikola
Top achievements
Rank 1
answered on 14 Aug 2015, 08:29 AM

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
0
Eyup
Telerik team
answered on 19 Aug 2015, 06:04 AM
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
0
vijayakumar
Top achievements
Rank 1
answered on 22 Feb 2017, 06:47 PM

Hi,

 

Does MediaPlayerVideoFile support the path of type UNC - video files are stored in anther network drive?

Thanks,

Tags
MediaPlayer
Asked by
Shinu
Top achievements
Rank 2
Answers by
Senad
Top achievements
Rank 1
Eyup
Telerik team
Shwetha
Top achievements
Rank 1
Nikola
Top achievements
Rank 1
vijayakumar
Top achievements
Rank 1
Share this question
or