Increase stream count as result of event

maxcinsay
@maxcinsay
11 years ago
60 posts
Hello, I have been working on adapting a player to the website, so far it works fine but since Im not using the player that comes with JR5 the stream count is not updating.

I want increase the stream count when the user clicks on the play button or when the song is over, do you offer a way to tap easily into the database or some other way to do this?


updated by @maxcinsay: 01/09/14 08:55:02PM
brian
@brian
11 years ago
10,148 posts
As long as you go through the proper "stream" magic view, plays will automatically be counted.

How are creating the URL to stream the file?

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
maxcinsay
@maxcinsay
11 years ago
60 posts
Hello Brian,
I first get the url for the song and then place it as source of the custom player.

Here is how I get the url for the song:
{$jamroom_url}/{$murl}audio/stream/audio_file/{$item._item_id}/key=1/{$item.audio_file_name}

I can see the amount of times the song has streamed in the front end here: http://dev5.r2rlive.com/ but it wont update (the number after the song name)(btw this website is just for smartphones right now)
brian
@brian
11 years ago
10,148 posts
That is the correct URL, and it will count the plays, but if you are just refreshing it expecting the play count to go up, it won't - the core keeps track of IP addresses and will only count 1 play for a user even if they keep refreshing the audio (this is done to prevent "gaming" of the play charts).

For testing, you can empty (truncate) the jr_jrcore_count_ip table between plays and it will log a new play.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
maxcinsay
@maxcinsay
11 years ago
60 posts
Thank you Brian, one more time, saving me a headache ;)
brian
@brian
11 years ago
10,148 posts
maxcinsay:
Thank you Brian, one more time, saving me a headache ;)

No Problem!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags