The WordPress All In One Music Player is a collection of music players for your WordPress site where you can choose your favorite music player to play the music files. In case you haven’t added the music player yet, here’s how to add your favorite music player to your site.
By default, the All In One Music Player plays all the music files found in your media library. That’s cool. However, in some cases, you might only want to play a single specific music file. You can accomplish that with a little custom code which I’ve included below:
add_filter(
'all_in_one_music_player_audio_files_data',
function( $audio ) {
$audio = array(
array(
'artist' => 'The Shadows',
'song' => 'Prakriti',
'name' => 'Prakriti',
'url' => 'https://sanjeebaryal.com.np/wp-content/uploads/2021/10/bensound-happyrock.mp3',
'cover_art_url' => 'https://sanjeebaryal.com.np/wp-content/uploads/2021/06/All-in-one-music-player.png',
'cover' => 'https://sanjeebaryal.com.np/wp-content/uploads/2021/06/All-in-one-music-player.png',
'length' => '4:30',
),
);
return $audio;
}
);
You’ll need to modify the values out there as per your requirement and you’re all set.
In case it helps, here’s how to easily add custom codes to your WordPress site.
I hope this helps!
thank you for this guide, I really appreciate your work bro. however, how can one select only one player via Media Library, how can I make it my default player for every songs uploaded to the page or post.
can I replace it with my themes player, check the default player on this url: https://gospelkingz.com/song/911-by-darasimi-ft-lawrence-oyor.html. please advise.