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

Cannot play wav files

7 Answers 110 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 12 Nov 2013, 06:25 PM
I am trying to reproduce wav files but I do not know what is the problem. I works with youtube but not with my files


<telerik:RadMediaPlayer  ID="RadMediaPlayer1" runat="server"  Text="RadMediaPlayer"
            Height="281px" Width="500px">
            <Sources>
                 
  <%-- <telerik:MediaPlayerSource Path="http://www.youtube.com/watch?v=QuuUn2tm5wY" />--%>
                 <telerik:MediaPlayerSource  Path="C:/code/dotnet4/PAPortal/files/voxeo/Confirmed By Recipient_12820-469398-cfc3410d2d1bcf81e8decaf11e87dafd-0-ReminderID-4578795.wav" />
            </Sources>
</telerik:RadMediaPlayer>

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Nov 2013, 06:47 AM
Hi Jose,

The MediaPlayerSource value should be either an absolute URL (like src="http://www.example.com/Music1.wav) or a relative URL ( URL that points to a file within a web site). In the sample mark-up you provided the YouTube video works fine since it is an absolute URL. I suggest you copy all the required media files to a specific folder inside your project and provide the relative URL as shown in the following code.

ASPX:
<telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" Height="281px" Width="500px">
    <Sources>
        <telerik:MediaPlayerSource Path="~/MediaFiles/Sample.wav" MimeType="audio/wav" />
    </Sources>
</telerik:RadMediaPlayer>

Also add the respective MIME settings to the Web Config file of your web site which can be done as follows:
<system.webServer>
  <staticContent>
    <mimeMap fileExtension=".wav" mimeType="audio/wav" />
  </staticContent>
</system.webServer>

Hope this helps,
Shinu.
0
Jose
Top achievements
Rank 1
answered on 13 Nov 2013, 04:50 PM
Hi Shinu, thanks for your answer


I am getting an error when I Add the MIME settings to the Web Config file 

Unable to start debugging on the web server. See help for common configuration errors. Running the web page outside of debugger may provide further information.

make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start without debugging. You may also want to refer to the ASP.NET and AT: Server debugging topic in the online documentation

0
Eyup
Telerik team
answered on 18 Nov 2013, 02:58 PM
Hello Jose,

Try changing the MimeType to mp3 format and let me know about the result:
<telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" Width="640" Height="360px">
    <Sources>
        <telerik:MediaPlayerSource Path="Audio/audio1.wav" MimeType="audio/mpeg" />
    </Sources>
</telerik:RadMediaPlayer>

Please bear in mind that IE does not support wav sources:
http://www.telerik.com/help/aspnet-ajax/mediaplayer-getting-started.html

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
Jose
Top achievements
Rank 1
answered on 18 Nov 2013, 07:57 PM

Thank you very much

That works for wav, but no for mp3 files. Do you know if I can make it work for mp3 files?

Thanks
0
Eyup
Telerik team
answered on 21 Nov 2013, 01:32 PM
Hi Jose,

It should also work perfectly well for .mp3 files. I am attaching a sample web site to demonstrate that. Please run the application and let me know about the result.

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
Jose
Top achievements
Rank 1
answered on 21 Nov 2013, 03:50 PM
Thank you very much for your help.
The real problem that I had is I am using siteMapNode for my pages and looks we cannot work with those urls. I had to use HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath + file and pass it to the URL instead of Path="~/MediaFiles/Sample.wav"


Thank you guys 
0
Eyup
Telerik team
answered on 26 Nov 2013, 09:12 AM
Hi Jose,

I am glad you have managed to resolve the issue. Generally, it should be enough to set the latter Path.

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.
Tags
MediaPlayer
Asked by
Jose
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jose
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or