Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice if there was even a chance to count the play of the song to make a statistic.
Comments
Comment #2
zirafa CreditAttribution: zirafa as a volunteer commentedThis has come up before: #2188637: Feature Request like Play Count, forward backward
"Play count would need some sort of criteria, I'm not sure if there is an official threshold used on iTunes, Soundcloud, Bandcamp, etc, but it would certainly be interesting to log this kind of info. A very loose criteria would be anytime the play button was clicked; a very hard criteria would be a play that only counts if the song is played through from beginning to end without skipping. "
Soundcloud registers a play as soon as the play button is clicked. Something like that could be logged as a statistic by attaching a JS XHR callback to the player button that would increment a counter in the DB. It may be helpful to examine how core statistics module handles counting node views.