Pergunta

This is my first post here, so forgive me if i don't follow all the unwritten laws here :)

I am using mediaelement.js for playing mp3 files. It works great in all the browsers i have tested, except from IE11. I get an errer in my browser saying "Invalid source". The soundfiles i use are loaded from a database, and a typical URL for a file would be /filestreamer?fileId=2342342

As You can see, there is no file extension in the URL. I wonder if this is what causes the problem in IE? Is there anyone who can confirm if that is or is not the case?

Here's the code i use: fileUrl will be like /filestreamer?fileId=2342342

$j("#soundPlayer").append('<audio id="player1" width="100%" poster="poster.jpg" controls="controls" autoplay="true" preload="none"><source type="audio/mp3" src="'+fileUrl+'" /><object width="320" height="240" type="application/x-shockwave-flash" data="/adapt-it/scripts/jquery/johndyer-mediaelement/build/flashmediaelement.swf"><param name="movie" value="/adapt-it/scripts/jquery/johndyer-mediaelement/build/flashmediaelement.swf" /><param name="flashvars" value="controls=true&file='+fileUrl+'" /><img src="myvideo.jpg" width="320" height="240" title="No video playback capabilities" /></object></audio>');

Kindly regards, Lars

Foi útil?

Solução

It was the mime-type, or content-type if you wish. I managed after some debugging to set it to "audio/mp3" and everything worked like a charm. Thanks for all help :)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top