html audio player

alt=
MONEE
@monee
9 hours ago
82 posts
I add a new player to my site but the streams don't count when I play audio on new player. How can I make streams count?
michael
@michael
5 hours ago
7,772 posts
How did you add the player? It's going to be something to do with the code you used either direct linking to the wrong URL or a counter call that exists in the default players thats missing from your new player.
alt=
MONEE
@monee
5 hours ago
82 posts
I'm guessing it has to do with this code but I don't know how to apply it to the new player
    $(document).ready(function() {
        var pc_mh318ll = 0;
        $('#jquery_jplayer_mh318ll').bind($.jPlayer.event.timeupdate, function(e) {
            if (data.instance.getCurrentTime >= 10 && pc_mh318ll === 0) {
                pc_mh318ll = 1;
                $.get(core_system_url + '/' + jrPlayCounts_url + '/record_play/jrAudio/10/10');
            }
        } );
        var ps_mh318ll = 0;
        $('#jquery_jplayer_mh318ll').bind($.jPlayer.event.play, function(e) {
            if (ps_mh318ll === 0) {
                ps_mh318ll = 1;
                $.get(core_system_url + '/' + jrPlayCounts_url + '/start_play/jrAudio/10/264');
            }
        } );
    });

--edited by michael to add [c o d e ] blocks so its readable ---
updated by @monee: 01/14/25 08:23:49PM
michael
@michael
2 hours ago
7,772 posts
If that's the code that calls your player it looks like its got code in there to increment the play count.

It will be calling
yoursite.com/playername/record_play/jrAudio/10/10

What might be a problem is if that jrAudio/10/10 is hard-coded. That looks like its the id for the audio file that's trying to be counted.

I would expect that those would be variables. /{$item_id}/{$profile_id}. something like that so that the counter knows what to count.
michael
@michael
an hour ago
7,772 posts
Yeah, looking at the module jrPlayCounts, that url is recording the 'moudle' / 'item_id' / 'percentage finished'
So if that url is hard-coded then audio item 10 is going to have its play count at 10% everytime the song plays.
michael
@michael
an hour ago
7,772 posts
This one could be a bit difficult to figure out. I'll help but I need to know how to set it up to get to where your at so I can see what works to offer useful solutions.

Are you setting it up inside the skin or as a module? are you able to package it as a .zip or some way I can get the code to see whats going on.

What steps are you doing to test when something should cause a count?