Jump to content

Save to mysql that user played audio file.


njdubois

Recommended Posts

Using an html5 audio tag, I want to trap when a user clicked play, and when (or if) a user clicked stop.

 

This is what I have

 

 

 

In my php :

<audio controls="controls" name="audio_player" id="audio_player" onclick="javascript: test_for_play(this);">
<source src="audio_upload/' . $filename . '" type="audio/mpeg" />
'.$audio_ABC_html.'
</audio>

 

And in the head I have :

 

<script type="text/javascript">

function test_for_play(var name) {
   window.alert('Message goes here');
}

</script>

 

But I don't ever get the pop up? I'm doing one thing at a time, and I can't move forward until I get this function firing when the user clicks a button on the audio tag.

 

Thanks for the help!

 

Nick

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.