The audio shortcode does a lot more than just create an tag in the page.
The WordPress audio and video shortcodes are powered by the MediaElementJS library, which is a combination of Javascript and CSS code that loads into the footer of the page whenever you have a post with one of those in it. The JS code processes those elements and turns them into proper players on all browsers, even ones that don’t natively support the element or which don’t support that specific filetype.
Your audio code alone, along with your JS, isn’t a complete implementation. It lacks all the MEJS code, the player CSS skin, and the player itself if needed for your browser.
Stick to the shortcode. It’s simpler all around.
Related Posts:
- Difference between mimetypes: audio/mpeg and audio/x-mpeg
- How can I play sound in Java?
- Playing mp3 song on python
- compressed and uncompressed .wav files
- How to add a new audio (not mixing) into a video using ffmpeg?
- How do I make JavaScript beep?
- Making audio playlist with external audio files?
- How to get the number of times an audio file has been played
- Download button for wp audio player
- Is it possible to control the width of the WordPress audio player?
- How to add audio files to wordpress blog and making it auto play?
- Background audio player
- How to make WordPress audio playlist understand the direct links of audio files shared on google drive?
- Removing Theme Audio Player – Using Browser Default
- Audio preloading
- Adding a download link to native WordPress playlist
- Using track metadata from audio shortcode
- Is ‘preload=”none”‘ a valid parameter in the [audio] shortcode in WordPress 3.6?
- wp_audio_shortcode shows player and url [closed]
- Starting from what version WordPress provides own embedded audio player without need a plugin?
- WordPress Audio tag problem in Chrome
- Change audio player style
- How to get the number of times an audio file has been played
- Trim Audio Files [closed]
- Convert mp3 into ogg?
- Is the .flac audio file format supported by WordPress?
- audio link produces black box
- Need to hide/remove volume bar in WordPress Default Player to give more room to progress bar
- Clicking “Download MP3” downloads 0kb file
- Show audio player only in specific post type
- Trying to get the number of times an audio file has been played
- How to disable theme’s player styles so I could use plugin player?
- WP audio playlist width
- WordPress default audio playlist – how to add custom caption?
- How to restore deleted audio files from media library
- WordPress Audio Player
- Number of times an audio file has been played using custom player
- Trying to turn all of my posts into a soundcloud playlist and can’t figure out where to start
- Open template file in Pop Up
- WordPress audio link not working
- How to disable “Audio Player” to show up on the main page
- how to switch out music file for another using php echo
- How can I convert MP3 file to a Base64 encoded string? [closed]
- PlaySound in C++ Console application?
- Learning to work with audio in C++
- Play audio with Python
- * failed to open vchiq instance
- Python: Making a beep noise
- How to play a sound in C#, .NET
- How to make music autoplay and loop in background
- How to remove hardcoded characters from playlists?
- How can I list URLs of all audio files within my media gallery?
- How to add ‘class’ attribute into shortcode [audio]?
- Using audio shortcode for .mp3 URLs with a query string
- Call a custom field in an audio shortcode?
- How to get the ID of an item in an audio playlist?
- Audio Playlist : How to bind events for “track change”, “track end”?
- ACF for audio url in wordpress audio shortcode
- Hard-coded Audio Player
- Disguise Multi-Page site as Single Page
- Changing playlist shortcode thumbnail sizes?
- Legacy Audio Shortcode
- Error when overriding only some audio shortcode HTML output
- Extending the Audio Shortcode
- Audio Playlists – Multiple file type support?
- Built in audio player?
- How to display more audio file ID3 tags in WordPress
- WordPress audio player causing js error, mediaelementplayer is not a function
- mp3 audio metadata upload integration: can I autopopulate title, caption, description from id3 tags?
- Audio Player for MP3 Files for WordPress
- Load MediaPlayerElement after Infinity Scroll loads more posts
- Reloading a Mediaelement audio player
- How can I implement shortcode on click event
- Making audio playlist by getting page’s parent’s ID
- On screen music/audio player that grabs track URL [closed]
- Replace audio links with jplayer using the_content filter
- How To Watermark Audio
- download button for audio file in post [closed]
- Adding simple (one button) Audio player using Custom Fields?
- How to create a playlist for audio associated with posts per category
- Problem adding MP3 attachments to a jPlayer playlist
- How To Download WordPress Audio Attachments
- Display Audio Attachment URL
- Error Using Audio plugin
- Show audio player only in specific post type category
- Override wordpress audio playlist
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- Dealing with the clickTrack event in wp-playlist.js in order to display audio download link on the playlist title row
- Add audio post from smartphone
- Hide download button from audio player
- Create an archive page(loop) for edd products (music files) with an audio player?
- problem getting audio url
- Media Playlist Plugin
- Customizing the built-in Media Playlist
- WordPress Background Audio – Continous AutoPlay
- Passing a location-dependent array via wp_localize_script within a shortcode
- How to add audio media in a post?
- How to remove audio player styles added by mediaelement.js JavaScript?
- Can’t upload files 1MB+ [closed]
- problem of path with xml file