Search code examples
javascriptandroiddeezer

Deezer Javascript SDK playAlbum autoplay flag ignored on Android


In my Deezer InApp, I am loading an album to the player with the DZ.player.playAlbum Javascript SDK call with the autoplay flag set to false like this: DZ.player.playAlbum(10008268, false, 0, 0). On the desktop site and on iOS, it works as expected and doesn't start playing the track, but on Android, playback is started. Is this a bug in the Android version of the SDK?


Solution

  • You can try the following with the player_play event:

    DZ.player.playAlbums(/*someID*/);
    DZ.Event.subscribe('player_play', () => {
        DZ.player.pause();
    }, true); //execute this once
    

    Listen when the player started to play, then stop it immediately.