preloading of next song

79 views
Skip to first unread message

Shaun Russell

unread,
Feb 1, 2014, 10:26:24 PM2/1/14
to 8tracks-p...@googlegroups.com
I am building an iOS application utilizing the 8tracks API.

There is an issue where the application is in the background, and when then song ends the device is being suspended before the next track is loaded.

The solution is to preload some of the next song, so their Media API is in use continuously.

However the setup of the 8tracks API is making it difficult for me to request a song before the completion of the previous.

Does anyone have any advice on this? If I could just request the next song ~10 seconds before the previous ends, everything would be happy.

Remi Gabillet

unread,
Feb 2, 2014, 11:30:44 PM2/2/14
to 8tracks public API
Hi Shaun. I know it's annoying but our license doesn't allow loading
tracks ahead of time which is the reason the API is built this way. I
wish we could simply give the whole playlist ahead of time, it would
make playing on mobile much easier.

Just like you suggested, I think that the right solution for you is to
call /sets/next about 10 seconds before the end of the song. If the
user skips within the last 10 seconds, you can ignore it.

I assume that the iOS player lets you track progress within the
playing track so you can set callbacks at certain points.

I hope this helps,

Remi
> --
> You received this message because you are subscribed to the Google Groups
> "8tracks public API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 8tracks-public-...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Rémi Gabillet
8tracks CTO & co-founder

Tomas Kislan

unread,
Feb 19, 2014, 6:06:48 PM2/19/14
to 8tracks-p...@googlegroups.com
Calling next before track ends works for me
I'm doing it about 30 sec before track ends and it works just fine

AV

unread,
Sep 18, 2015, 1:08:22 PM9/18/15
to 8tracks public API
Shaun: I worked around this same issue. It was a pain - but here is what I did. Instead of retrieving the playlist, add your playlist  to a collection. When you retrieve the collection, you get all the songs as one giant stream. Now , you can figure out when a song ends and the next one begins. And basically 'pre-load' whatever you want (next song, next to next song). Like I said, it wasn't easy, but I couldn't figure out any way around the API limitation.
AV
Reply all
Reply to author
Forward
0 new messages