aadsm / jsmediatags

Media Tags Reader (ID3, MP4, FLAC)
Other
738 stars 128 forks source link

No suitable tag reader found #161

Open NivEz opened 2 years ago

NivEz commented 2 years ago

I am trying to read the metadata of an mp3 file in the browser. It works fine for most of the files. In some files it throws the error No suitable tag reader found. Note that I use the native HTML file input. Why in most of the files it works and in some others it does not?

const getSongMetaData = file => {
    return new Promise((resolve, reject) => {
        jsmediatags.read(new Blob(URL.createObjectURL(file)), {
            onSuccess: result => {
                resolve(result.tags);
            },
            onError: error => {
                console.log('-> error', error);
                reject(error);
            },
        });
    });
};