At first you must registering you application with [deezer] PlDb
From master
cordova plugin add https://github.com/jeweller1980stepanets/Cordova-Plugin-Deezer-IOS-ANDROIDcordova plugin rm com.procoders.deezer
- Android
- iOS
After device is ready you must:
var deezerCordova = window.cordova.plugins.DeezerPlugin;After this you may use all method in code.
All methods returning promises, but you can also use standard callback functions.
deezerCordova.init(onSuccess, onError,appId);
deezerCordova.login(onSuccess, onError);
deezerCordova.playTrack(onSuccess, onError,trackId);
deezerCordova.playAlbum(onSuccess, onError,albumId);
deezerCordova.playPlaylist(onSuccess, onError,playlistId);
deezerCordova.playRadio(onSuccess, onError,radioId);
deezerCordova.play();
deezerCordova.pause();
deezerCordova.next();
deezerCordova.prev();
deezerCordova.seek(position);//value between 0 - 100%
deezerCordova.logout();
deezerCordova.setVolume(val1,val2);//val1,val2 - the volume for the left and right channel (between 0-100%)for iOS platform not implemented method setVolume() and event on_chenge_volume()
It will be fixed when this methods will be in Deezer SDK
on_position : function(args){},//args[0] - position, args[1] - duration
on_buffering : function (args){},//(args[0] * 100) + " %";
on_current_track : function(arg){},//arg[1] - Title of track
on_player_play : function(){},
on_track_ended : function(){},
on_pause : function(){},
on_change_volume : function(args){}//args[0] - the volume for the left channel (between 0 and 100%), args[1] - the volume for the right channel (between 0 and 100%)deezerCordova.Events.on_position = function(args){..`code`..}