Closed ericlove02 closed 3 years ago
Hey!
Spotify no longer seems to like an empty $options
being sent. Passing null
seems to be a workaround until I can get a fix out. For example:
$api->play($_SESSION['playback_device'], null);
Hope that solves it for you!
Thanks for the idea. I tried that and now I am getting a new error: Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: Server error. in D:\wamp64\www\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 57
It works correctly when I pass a uri, for example: $api->play($_SESSION['playback_device'], ['uris'=>['spotify:track:5QO79kh1waicV47BqGRL3g']]); but it does not like: $api->play($_SESSION['playback_device'], null);
Hmm, I can't think of anything more right now (unless you're fine with always passing a URI). I'll try and get a fix out ASAP.
Yeah, I couldn't get it working without passing a uri, so for my application I ended up doing this:
$trackUri = "spotify:track:" . $_GET['id']; $position = $_GET['pos']; $api->play($_SESSION['playback_device'], ['uris'=>[$trackUri], 'position_ms'=>$position]);
I just published 4.2.2
which should solve the issue.
Let me know if it doesn't!
I am getting this error when I try and use the Play endpoint: Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: Malformed json in D:\wamp64\www\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 57
My code: `<?php require '../vendor/autoload.php';
$api = new SpotifyWebAPI\SpotifyWebAPI(); session_start();
$api->setAccessToken($_SESSION['token']); $api->play($_SESSION['playback_device']);`
I am using the same code (with the endpoint change of course) for pause, next, and previous and am having no problems. Any ideas?