|
|
|
@ -44,66 +44,6 @@ class SpotifySdkService(private val context: Context? = null) { |
|
|
|
private val channelName = "spotify_sdk" |
|
|
|
private val loggingTag = "spotify_sdk" |
|
|
|
|
|
|
|
// event channels |
|
|
|
private var playerContextChannel : EventChannel? = null |
|
|
|
private var playerStateChannel : EventChannel? = null |
|
|
|
private var capabilitiesChannel : EventChannel? = null |
|
|
|
private var userStatusChannel : EventChannel? = null |
|
|
|
private var connectionStatusChannel : EventChannel? = null |
|
|
|
|
|
|
|
private val playerContextSubscription = "player_context_subscription" |
|
|
|
private val playerStateSubscription = "player_state_subscription" |
|
|
|
private val capabilitiesSubscription = "capabilities_subscription" |
|
|
|
private val userStatusSubscription = "user_status_subscription" |
|
|
|
private val connectionStatusSubscription = "connection_status_subscription" |
|
|
|
|
|
|
|
//connecting |
|
|
|
private val methodConnectToSpotify = "connectToSpotify" |
|
|
|
private val methodGetAccessToken = "getAccessToken" |
|
|
|
private val methodDisconnectFromSpotify = "disconnectFromSpotify" |
|
|
|
|
|
|
|
// connectApi |
|
|
|
private val methodSwitchToLocalDevice = "switchToLocalDevice" |
|
|
|
|
|
|
|
//playerApi |
|
|
|
private val methodGetCrossfadeState = "getCrossfadeState" |
|
|
|
private val methodGetPlayerState = "getPlayerState" |
|
|
|
private val methodPlay = "play" |
|
|
|
private val methodPause = "pause" |
|
|
|
private val methodQueueTrack = "queueTrack" |
|
|
|
private val methodResume = "resume" |
|
|
|
private val methodSeekToRelativePosition = "seekToRelativePosition" |
|
|
|
private val methodSetPodcastPlaybackSpeed = "setPodcastPlaybackSpeed" |
|
|
|
private val methodSkipNext = "skipNext" |
|
|
|
private val methodSkipPrevious = "skipPrevious" |
|
|
|
private val methodSkipToIndex = "skipToIndex" |
|
|
|
private val methodSeekTo = "seekTo" |
|
|
|
private val methodToggleRepeat = "toggleRepeat" |
|
|
|
private val methodToggleShuffle = "toggleShuffle" |
|
|
|
private val methodSetShuffle = "setShuffle" |
|
|
|
private val methodSetRepeatMode = "setRepeatMode" |
|
|
|
|
|
|
|
//userApi |
|
|
|
private val methodAddToLibrary = "addToLibrary" |
|
|
|
private val methodRemoveFromLibrary = "removeFromLibrary" |
|
|
|
private val methodGetCapabilities = "getCapabilities" |
|
|
|
private val methodGetLibraryState = "getLibraryState" |
|
|
|
|
|
|
|
//imagesApi |
|
|
|
private val methodGetImage = "getImage" |
|
|
|
|
|
|
|
private val paramClientId = "clientId" |
|
|
|
private val paramRedirectUrl = "redirectUrl" |
|
|
|
private val paramScope = "scope" |
|
|
|
private val paramSpotifyUri = "spotifyUri" |
|
|
|
private val paramImageUri = "imageUri" |
|
|
|
private val paramImageDimension = "imageDimension" |
|
|
|
private val paramPositionedMilliseconds = "positionedMilliseconds" |
|
|
|
private val paramRelativeMilliseconds = "relativeMilliseconds" |
|
|
|
private val paramPodcastPlaybackSpeed = "podcastPlaybackSpeed" |
|
|
|
private val paramTrackIndex = "trackIndex" |
|
|
|
private val paramRepeatMode = "repeatMode" |
|
|
|
private val paramShuffle = "shuffle" |
|
|
|
|
|
|
|
private val errorConnecting = "errorConnecting" |
|
|
|
private val errorDisconnecting = "errorDisconnecting" |
|
|
|
|