• I have an MP3 file in my media library, which is attached to a post.

    My atom feed attaches it in the enclosure – but doesn’t supply a MIME type. Instead, I get:

    <link href="https://shkspr.mobi/blog/wp-content/uploads/2025/03/Move-roomba-to-a-new-location.mp3" rel="enclosure" length="46188" type="" />

    As you can see, the library correctly detects the file type and shows a MIME type.

    I’m embedding my MP3 directly using the shortcode:

    [audio mp3="https://shkspr.mobi/blog/wp-content/uploads/2025/03/Move-roomba-to-a-new-location.mp3"][/audio]

    I’ve also just tried pasting in the raw URl. Both methods render the audio on the web page, but neither fix the problem with RSS enclosures.

    This is only a problem with atom_enclosure(); – my RSS feed uses rss_enclosure(); and it supplies a MIME type correctly.

    The only difference I can see between atom_enclosure() and rss_enclosure() is that atom uses get_allowed_mime_types() to check if an MIME type is valid. When I look at the array it produces, I can see it contains 'mp3|m4a|m4b' => 'audio/mpeg' – so I don’t think that’s the problem.

    I can see that video/mp4 MIME types are returned in the Atom feed. I’m at a loss for why this MP3 doesn’t work.

    • This topic was modified 12 months ago by Terence Eden. Reason: add debug details
    • This topic was modified 12 months ago by Terence Eden.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Missing MIME type using atom_enclosure()’ is closed to new replies.