Skip to content
DocumentationAPI Reference

Set Repeat Mode

me().player().setRepeatMode(PlayerSetRepeatModeParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
PUT/me/player/repeat

Set the repeat mode for the user's playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.

ParametersExpand Collapse
PlayerSetRepeatModeParams params
String state

track, context or off.
track will repeat the current track.
context will repeat the current context.
off will turn repeat off.

Optional<String> deviceId

The id of the device this command is targeting. If not supplied, the user's currently active device is the target.

Set Repeat Mode

package dev.cjav.spotted.example;

import dev.cjav.spotted.client.SpottedClient;
import dev.cjav.spotted.client.okhttp.SpottedOkHttpClient;
import dev.cjav.spotted.models.me.player.PlayerSetRepeatModeParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        SpottedClient client = SpottedOkHttpClient.fromEnv();

        PlayerSetRepeatModeParams params = PlayerSetRepeatModeParams.builder()
            .state("context")
            .build();
        client.me().player().setRepeatMode(params);
    }
}
Returns Examples