html audio player

alt=
MONEE
@monee
6 days ago
85 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
6 days 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
6 days ago
85 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
6 days 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
6 days 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
6 days 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?
alt=
MONEE
@monee
5 days ago
85 posts
that's not the player code. that code comes up in the page source code right after the player code. it comes from jamroom. it looks like that's what counts the play but it's looking for #jquery_jplayer_{$uniqid} for the input for progression
I'm checking by playing the song and then checking the datastore. I can see the change when I play using jamroom players but no matter how many times I play on new player no counts. I'm guessing that is the same reason the beatslanger2 beat player doesn't count play either
updated by @monee: 01/15/25 02:58:44PM
alt=
MONEE
@monee
5 days ago
85 posts
so the code I posted at the top comes from the jrPlaycount module in the player_events.tpl and it looks like only set up to count jamroom players
alt=
MONEE
@monee
19 hours ago
85 posts
Michael do you have a email that I can send you a .zip? I'm not sure if I need to put it in module or not but main thing I need to figure out is how to get the audio to load into it properly