Rejoining a default media receiver session, can't control media - google-cast

I'm working with the default media receiver in a chrome sender clientside webapp. I can successfully connect to my chromecast and play an mp3 file and pause/stop/play it.
When I refresh the page, my sessionListener callback sees the active media. I verified that the sessionId is the same, but when I call .pause() or .play() on the existing session, it does not effect the chromecast.
I'm using the Beta Cast extension. Any ideas?

I was mistakenly calling .play(), .pause(), etc on the top level session and not session.media[0]

Related

No XEP-0333 Chat Markers in XMMPP Openfire backend - how to solve it?

We have an Openfire XMPP/Jabber server setup (with a NodeJs backend and React frontend).
Chat is a feature embedded in the app (NOT an overlay or window that is always visible). So the user has to navigate to a specific page to access the chat interface.
It is working via websockets and messaging sending is working fine. We have a React frontend.
The challenge is that XEP-0333 Chat Markers is not supported by Openfire (the spec never become production ready).
Therefore we need to know how can we implement this feature so that :
A users knows when they are online that they have an unread message (and later, how many unread message they have). For example, if they are not in the chat window and messages are arriving, we need to indicate that in the header of the app so they see it)
if a user goes offline, and comes back online but NOT into the chat window, how can we know if they have unread messages and notify them of that?
My understanding is that somehow we have to keep track of unread messages (eg perhaps in indexedb or local storage or even in postgres backend) and after the user reads a message, we delete it from storage. If the storage still has records for that user then clearly those are the unread messages.
Obviously we don't know if they actually READ the message, but we can assume that if the chat window is open and visible (ie. active tab in their browser) that any messages delivered have been read.
So if our application tab is active, but user is not in chat, and a message arrives, we store it. When they open chat and click on the sender, we remove it from storage.
Has anyone solved it this way? (looking for links to React or JS/TS code)
Is there a better way? (links to other solutions would be helpful, esp. code)

Check not log user has almost read my video without cookie and account (nodejs)

Detect a user who has already followed my video or already clicked on a button without using cookies. (Cookies can be deleted from the browser.) Is there a way? much like the youtube view number system

Custom receiver application doesn't work with whitelisted device

I'm just starting to play with Google Cast, so I downloaded the hellotext Chrome example app. If I open the sender that comes with it, everything works. However, if I take the receiver.html file, upload a copy of my own somewhere, create an app, and then replace the app id in the sender.html, it doesn't work.
The console log says "receiver list empty". I do have my Chromecast (both of them actually) added to my account as test devices. I reset them, both via software and by unplugging and replugging them. I even did a factory reset on one of them, but still no luck.
Googling got me to this response: How to launch a receiver app in Chrome once Chromecast device has been whitelisted?
However, the option to enable (or disable) sending the serial number on update check doesn't seem to exist anymore.
Any ideas?
Thanks!

Google Cast Receiver Applications

In the receiver developer's guide is the following:
Applications running on the Google Cast receiver device (receiver applications) are always web applications. They are launched on the device after it receives instructions from the sender application to do so.
How exactly is this accomplished from the sender (in Chrome)? The sender guide doesn't seem to include this anywhere and I'm unable to track down it down in the API docs.
There is the class cast.LaunchRequest, but there isn't anything there that would accept a receiver application URL.
It is a little hard to figure out at first. What happens is you have a sender and a receiver. For the sake of simplicity lets say we are making a chrome app. Chrome app is synonymous with a Web Page running on chrome.
So what we would have is two web apps (pages).
Sender (Web Page)
Receiver (Web Page)
You then get your sender whitelisted, by giving them the url to your web app's root. In a day or two they send you an Application ID. That application ID acts as your ActivityID (in the place of say 'Netflix' or 'YouTube').
When you say cast.LaunchRequest("[AppId]", receiver); from you sender. The receiver pulls down the web page that corresponds to that AppId, which uses the Receiver Javascript API to talk to your sender(s).
The sender can also be on android or iOs in those cases you only have to make one Web App.

Getting Original Phone useragent with J2ME

Kinda new to J2ME. I was wondering how I could go about in getting a J2ME midlet to send the original user agent of the mobile device to a server instead of: "Profile/MIDP-1.0 Configuration/CLDC-1.0"?
The problem here is that I wont be able to kno the specific device the midlet runs on in order to manually set the useragent. This is because I'm developing a J2ME SDK that will be widely distributed for advertising purposes within other applications. It's like a plugin that fetches and display ads within an app.
For example, if the midlet runs on a sonyericsson, how can i get the midlet to send the original phone useragent:
"SonyEricssonW300i/R4EA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
to my server without actually using
"setRequestProperty(" User-Agent", "SonyEricssonW300i/R4EA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1")" ?
I want to detect the true device using WURFL on the server-side. If the midlet sends "Profile/MIDP-1.0 Configuration/CLDC-1.0" as the useragent, WURFL will detect the phone as "Generic J2ME midlet" instead of SonyEricsson W300.
I'd really appreciate it if someone assist.
The fool-proof way is to detect the user-agent when the web browser requests the jad, and set the value in the returned jad file.

Resources