Chromecast custom receiver adding to queue from receiver - chromecast

i am trying to create a slideshow type app that will play both videos and photos. i am populating the array of the items from a network request performed by the chromecast after it gets a unique id from the sender. i am them trying to add these items to the media queue from the receiver but this error is showing up when i try.
Unexpected command, player is in IDLE state so the media session ID is not valid yet
any advice on what i am doing wrong, or logs that i can provide to help identify the issue? thanks in advance.

Related

How messenger works in sync with multiple devices

I am trying to introduce a messenger (chat) feature in my application.
I ma unable to figure out how to make the feature sync on multiple devices.
Let's say I am using the chat on my phone, and then I login to my desktop and start chatting there. How would I get the messages on both devices and how will both be in sync with each other. Additionally, for the sender to get a read confirmation, the message should be read from either one of the device, but the notification of unread should be shown on sender's device on which the message in unread unless he opens and reads it.
For First Part of the question you want to do Like FB Messenger where you loggin you will find your whole messages found not related to a device. To Achieve that you can have at the device app Last Login time which will be posted to the server, and all messages from that time will be retrieved to the user. But imagine the user has read all his messages from the mobile but he didnt open the computer since one Month. IF you didnt mark the message as read, he will find enourmous amount of messages coming as unread but he actually read on his mobile which will cause you huge usability issue.
For your Case I feel you need to do exaclty what FB Messenger does. Retrieve your latest messages from your conv with their actual status. And while scrolling up load by demand.
So Your Message will have only 1 Status(Read or UnRead) And date where you can match with Device Last Sync time.

Add song to playing queue in Spotify Desktop

I'm trying to queue a song to Spotify Desktop (Windows 8.1) making use of Spotify Remote Control Bridge. I want that song to be appended after the current playing track.
Due to the restrictions Spotify applies to this API, there's no public documentation and I can't get in contact with their developers. This is one of the posts I've been following to understand how this API works: https://medium.com/#b3ngr33ni3r/hijacking-spotify-web-control-5014b0a1a360
I've successfully played a song with https://XXXX.spotilocal.com/remote/play.json?oauth=XXXX&csrf=XXXX&uri=XXXX, but it jumps to playing queue instantly and replaces it entirely.
When I call https://XXXX.spotilocal.com/remote/queue.json?oauth=XXXX&csrf=XXXX&uri=XXXX it always returns "Method not implemented". Do I need a special Oauth token? Or CSRF token?
Just giving an update, you can now add tracks to a queue via a BETA endpoint.
https://developer.spotify.com/documentation/web-api/reference/player/add-to-queue/
I've tested it, and it seems to work as expected.
queue.json endpoint
This endpoint appeared in their js-library, although it never worked and it's, like you said, not implemented. It doesn't matter which arguments you supply.
play.json endpoint
So, this endpoint is more interesting. First of all, in the past you could use the following parameter ?action=queue to add a song to the queue, but sadly this doesn't work with the latest versions for whatever reason. The only thing you currently can supply is the play-context ?context. A context basically tells spotify what to play next (like setting a new queue). So if you want to play a track of an album and simultaneously want the album to finish after the specific song ends, you can supply a ?context=spotify:album:albumid. There is some more information about it in this issue of my library.
Summarizing, you currently can't add songs to the spotify queue, but add your own context which will be used as a future queue
Although it would be nice to know why spotify isn't releasing any documentation about the local-API.

Chromecast Custom Receiver show different content

Is there a way for a Chromecast Customer Receiver app to differentiate which Chromecast device is connected and then show different content based on such ID or unique connector?
If you are asking whether there is an api on the receiver side to return a unique id, the answer is no, there is no such api.

How can I display an endless loop of images via Google Cast?

I'm just getting started with a simple sender app and the default media receiver. Is it possible to either:
a. send a list of images that Chromecast will loop over
b. send a single url that Chromecast will refresh on an interval, letting the server "cycle" the images through
I'd want this to continue without the sender application needing to be open. I was hoping to not have to create a custom media receiver, as I'm assuming I'd be able to do what I want to do. It seems like I'd have to implement a lot of boilerplate and register the custom application just for some fairly simple functionality.
Yes, it is possible but you need to write your own receiver to do that; the Default/Styled receivers that are available for you do not do what you have in mind.

how to get list of subscribers for a particular channel on pubnub

I am writing an application in titanium by making use of pubnub. I need to get the device id or any specific details of all people who are subscribed to a particular channel. Please let me know how do I get the device id of all sudcribers to a particular channel.
Thanks
There is no such function in the whole Documentation of Pubnub.
You have to implement a function like "whosthere()" which posts a message to a Channel. All connected (subscribed) clients then need to answer to that Post with "imhere()" or something similar.
http://www.pubnub.com/devcenter

Resources