Deezer InApp - Player Object

The player object lets you interact with the Deezer player.
You can play tracks, albums and playlists,
You can invoke actions such as 'next', 'prev', 'play' and 'pause'
You can also set the volume and set options such as 'suffle' or 'repeat'.

Below is a demo of a custom-made player that interacts with the Deezer player

Album ID:
Different ways to load and/or play an album/playlist/track list:

DZ.player.playAlbum(302127, function(data){ console.log(data.tracks) });

DZ.player.playAlbum(301775, function(data){ console.log(data.tracks) });

DZ.player.playAlbum(301775, false);

DZ.player.playAlbum(301775, 2);

DZ.player.playAlbum(301775, 2, 50);

DZ.player.playAlbum(301775, 2, false, 50);


Except for the first one, you can call all these methods with the following arguments:
id, offset, autoplay, callback

Notice that only 'id' and 'offset' have to keep the following order: id, offset
For example, you can call:
autoplay, id, callback, offset
but not:
autoplay, offset, callback, id
(otherwise the offset will be interpreted as an id, and the id as an offset)


When calling theses methods with bad parameter or id (track_id, album_id, etc.) that doesn't exist, your callback will return the following argument:
data = {
    error: "error message"
}

You can access a new method: DZ.player.isPlaying()








ADD TO QUEUE:


DZ.player.addToQueue([3135556], function(data) {
    console.log(data);
});
                

You can change the track order:
Inverse the track order

event_listener:
clear