html5 audio player - jquery toggle click play/pause???

Posted by mathiregister on Stack Overflow See other posts from Stack Overflow or by mathiregister
Published on 2010-06-07T08:38:18Z Indexed on 2010/06/07 8:42 UTC
Read the original article Hit count: 434

Filed under:
|
|

hello guys,

i wonder what i'm doing wrong?

    $('.player_audio').click(function() {
    if ($('.player_audio').paused == false) {
        $('.player_audio').pause();
        alert('music paused');
    } else {
        $('.player_audio').play();
        alert('music playing');
    }
});

i can't seem to start the audio track if i hit the "player_audio" tag.

<div class='thumb audio'><audio class='player_audio' src='$path/$value'></audio></div>

any idea what i'm doing wrong or what i have to do to get it working?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about audio