Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mpg / mpeg audio file duration jquery

I have following code base

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

When I use .mp3,.mp4,.ogg,.wav audio duration is populated correctly, but when I use mpg or mpeg audio file, the duration is not being loaded.

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

Any suggestion would be highly appreciated.

Thanks

like image 361
Md. Parvez Alam Avatar asked Feb 13 '17 05:02

Md. Parvez Alam


People also ask

Is MPEG-2 fuel efficient?

MPG files are also listed as MPEG-1 and MPEG-2 files. Both types of MPG files serve as container files for audio and video data to ensure the two portions remain in sync. Windows, Mac, and many mobile devices can run MPEG-1 and MPEG-2 files.

Is MPG an audio or video?

MPEG Compression The name MPEG stands for Moving Pictures Experts Group. MPEG is a tool for video compression, which involves the compression of images and sounds, as well as synchronization of the two.

Is MPG a audio file?

An MPG file is a common video file that uses a digital video format standardized by the Moving Picture Experts Group (MPEG). It stores video, audio, and metadata interleaved together. MPG files are often used for creating movies that are distributed on the Internet.

What is MPG file extension?

mpeg (or . mpg) file extension is an MPEG video file format, which is a popular format for movies that are distributed on the internet. They use a specific type of compression that makes streaming and downloading much quicker than other popular video formats. RELATED: What Is A File Extension?


1 Answers

First thought was you need to set server content-type headers audio/mpeg instead of video/mpeg. I tried to configure my nginx properly, but audio tag still doesn't work.

You can't do that, browsers don't support mpeg type.

Firefox supports Ogg Vorbis and WAV

Opera supports Ogg Vorbis and WAV

Safari supports MP3, AAC, and MP4

Chrome supports Ogg Vorbis, MP3, WAV, AAC, and MP4

Internet Explorer 9+ supports MP3, AAC, and MP4

iOS supports MP3, AAC, and MP4

Android supports AAC and MP3

Actually, it can be an old doc, so look here. But even wiki says, that mpeg is not supported by any browser.

like image 180
shukshin.ivan Avatar answered Oct 17 '22 19:10

shukshin.ivan