Mpg / mpeg jquery audio file duration

I have the following code base

 Audiosource.onloadeddata = function () {
            $("#txtAudioDuration").val(Math.round(Audiosource.duration));
          };

When I use .mp3, .mp4, .ogg, .wav, the duration of the sound fills correctly, but when I use the mpg or mpeg audio file, the duration does not load.

I tried with converted mpg and mpeg audio file, I don't have original mpg or mpeg audio files. Is there a link to download these files.

Any suggestion would be highly appreciated.

thanks

+6
source share
2 answers

At first they thought that you need to set the server header headers audio/mpeginstead video/mpeg. I tried setting my own correctly nginx, but the audio tag still does not work.

, mpeg.

Firefox Ogg Vorbis WAV

Opera Ogg Vorbis WAV

Safari MP3, AAC MP4

Chrome Ogg Vorbis, MP3, WAV, AAC MP4

Internet Explorer 9+ MP3, AAC MP4

iOS MP3, AAC MP4

Android AAC MP3

, , . wiki , mpeg .

+4

Source: https://habr.com/ru/post/1014929/


All Articles