简体   繁体   中英

Serving audio files from Web Api Project in IIS7.5

I have an audio file I'm trying to serve from a directory within a ASP.NET MVC Web Api Project. For some reason the file refuses to play in Safari or mobile browsers. I can use every other browser to play this file.

What's driving me nuts is that if I just create a Virtual Directory and add the file there then navigate to it like /NewSite/song.m4a it will play fine in safari and mobile.

I thought maybe my web.config was screwing something up so I tried creating another Web Api project hosted in IIS and I still cannot play the audio file in Safari or mobile browsers in the new app.

I've done everything I can think of. I have the mime type added to my site. Other browsers like firefox and chrome play the file fine.

Has anyone seen this behavior? I'm going insane here.

I seriously wasted an entire day on this.

My IIS server is using a self signed cert. I was trying to load the audio file through https.

apparently every other browser is cool with this except Safari and mobile browsers.

I changed the src attribute to be http instead of https and safari started working as well as my iOS simulator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM