Spotify Web API to control playback on connect devices - api

Is there any way to use an API to control playback on my registered spotify connect devices? I'm not trying to create or add a new connect devices but control playback to them.
Is there any official or reverse engineering discussion on how to do this?

As far as I can tell, there is no way to do this currently.
That said, it's also unclear if or when this feature will be added. Spotify hasn't updated its api code in months. It also appears that the login functionality is broken on my app too. Spotify doesn't seem to be easy to work with.

Related

Sonos - How to play a Spotify/AppleMusic track on a Sonos device from my iOS app?

I'm integrating the Sonos Control API into an iOS app. In our app:
the user is signed in either to Apple Music or Spotify via an Apple Music subscription or a Spotify premium account.
the user can play Apple Music and Spotify content within our app (we have the track / album IDs and use this to play music via the Spotiy / Apple Music APIs).
the user also has the Sonos app installed, and is logged in to their music service of choice (Spotify or Apple Music).
Now when the user is listening to a track in our app, we'd like the user to be able to listen to it via their Sonos device. Our app is for children and has parental control, so the user needs to stay within in our app.
Is there currently any way to achieve this?
Options we've looked into:
Streaming: As I understand it, there is no way to stream audio to a Sonos device. The AirPlay-Sonos compatibility is not an option as we're targeting all Sonos devices.
Sonos Control API: We then looked into starting the track using the Spotify or Apple Music track ID via the Sonos Control API, but this answer seems to imply that this is not possible. Is this true even if the user is logged in to the Spotify / Apple Music service both in our app and in the Sonos app? For example I could imagine using createSession with a Spotify / Apple Music accountID so that I would have access to these services, and then using loadCloudQueue to load the trackIDs. But I could be misunderstanding the API.
sonos-objc: This looked promising, but is very outdated and we haven't managed to set it up.
Any leads on this would be greatly appreciated.
Thanks!
You are correct, streaming tracks directly to Sonos is not currently supported in our platform. Using music object ids, with their constituent content and account ids, is a vehicle for actual content partners to build direct control integrations with Sonos. iHeart, Pandora, and Tidal have done this for instance.
The reason non-content owners can't utilize this functionality is due to the way authentication is handled. To ensure rights-holders property remains intact, we require partners to execute an account matching flow. This account matching requires direct access to a content partners' auth back end, pretty much limiting these types on integrations to the content partners themselves.
We understand that non-content partners want to put content directly on Sonos, and we're actively looking for the best ways to do that, while still allowing content parters to maintain control of how their content is consumed.

Broadcast live audio on my website

I am having a requirement to broadcast live audio on my website. Scenario is
1) one user will talk/sing in my application and
2) his followers will have to listen that live audio instantly in the same application.
Can you please suggest me any 3rd party libraries for this?
Note: I am developing my web application in ASP.Net MVC5.
Thanks in advance.
Towards that goal, if you plan on using WebRTC, you'll need to add media servers that route media around.
Look at Kurento, Jitsi or Janus for open source alternatives - especially if you plan on adding video support to it.
You can also try using Asterisk or FreeSWITCH - these are telephony based solutions but can be re-purposed to use WebRTC and offer a conference call like experience where you mute everyone and have a single speaker "broadcast" his audio to all the rest.

Device tells us we need Google Play Services to Use Maps on Android device

we've been working with a 3rd party Android device that uses API 17. We want to make a native Google API app so that we can map data for our customers. What happens is the app crashes and it says "Google Play Services required". Is there a workaround to this? can we somehow embed or package a file that is good enough to use Maps? We've spoken with the hardware company and they made a decision to not allow google play services. We are partnering with them to release the device with a couple of apps we offer with the device. Any help is appreciated
Google Play services enables Maps to run on your Android devices, as per Google statement:
With Google Play services, your app can take advantage of the latest,
Google-powered features such as Maps, Google+, and more, with
automatic platform updates distributed as an APK through the Google
Play store. This makes it faster for your users to receive updates and
easier for you to integrate the newest that Google has to offer.
That means you need Google Play services to make Google Maps work.
Download it here.

How do you detect changes in a user's Spotify playlist?

Scenario: Spotify user on the native desktop application is adding and removing songs from the currently playing playlist.
I'm curious if it's possible for me to detect when any addition/removal happens? Basically need a trigger to tell me the playlist has changed without having to continuously poll Spotify's API to see if anything changed. Looking for a solution that could be used either via the Spotify API or something hack-ish using spotilocal or listening on Spotify's 4070 port.
Looking for a solution that could be used either via the Spotify API
or something hack-ish using spotilocal or listening on Spotify's 4070
port.
I wouldn't recommend this approach since the mentioned APIs may change without notice. It's not publicly supported so there's no commitment from Spotify to avoid breaking changes. It also requires the user to have the Spotify desktop application installed.
As you've noticed, since there's currently no way to subscribe to changes in a playlist, e.g. by a Websocket or HTTP PubSub interface like PubSubHubbub, your application would be forced to poll for changes. If you go down this path, I strongly recommend that you make use of the ETags and snapshot_id provided in the Playlist response.
Declaring how ETags are implemented in the Web API deserves a longer response and should be on the developer site. There's however a useful Working With Playlists guide on there that explains snapshots and some other things related to playlists.
It's also worth mentioning that all applications are rate limited, so I urge anyone polling to be aware of this and poll less rather than more. Obviously only poll when the application is actively used by the user, and only poll the playlist if it's actively viewed. You know you're being rate limited if you retrieve a 429 Too Many Requests response.

Making a Youtbe video exclusive on my website

I have a Youtube video set to private so nobody can watch it via Youtube or the embedded player. However I do want people be to be able to watch it on my website. The goal is to make the video available exclusively on my website for a while before I open it to the world. I was thinking to login to my Youtube account seemlessly using Youtube's API and log out after the video's finished but that doesn't make security sense. What's your take on that?
I agree with your intuition. Making the private sharing secure seems tricky at best. Although the Data API has procedural authentication options, I don't think Player API has that facility. Furthermore even if it did, it's hard to see how it might work without exposing your password.
Your best bet is probably to directly host the video on your website. You would use your website's authentication for restricting access limited release video. Then when your ready for the public release you can either switch to YouTube hosting or relax the authentication of your self hosting. The Video for Everybody site has examples of several options for self hosting of videos.