Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="media-item audio">
- <audio controls>
- <source src='http://example.com/wp-content/uploads/track.mp3' class="mp3" type="audio/mpeg">
- </audio>
- </div>
- jQuery( function ($) {
- $('.media-item.audio').on('click', function(e){
- var audio = $(this).find('audio')[0];
- e.preventDefault();
- if (audio.paused) {
- audio.play();
- } else {
- audio.pause();
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement