Profile cover photo
Profile photo
Joe Shelby
119 followers -
Just a me. They had a sale.
Just a me. They had a sale.

119 followers
About
Posts

Post has attachment
http://jwsdev.net/jottings/chromecast-in-react/

The new updated API works much better in React than the old did (since the old API didn't support 'is' properly, it broke in React 16/JSX, and the workaround was a componentDidMount bit of painful hackery).

The new API works much more reliably, and here's a demo.

The one thing to remember when instantiating web components in React with JSX is that it doesn't use "className=". Instead, you just pass class= like old-school HTML. Any time React/JSX recognizes a web component, it passes the props as attributes as-is, no conversions.

Post has attachment
Joe Shelby commented on a post on Blogger.
Just an fyi, the latest version of Silk for Amazon's Fire Tablets is based on Chromium M67, and now supports this feature as well as service workers. Still no full PWA support (doesn't follow the manifest to open the page full-screen), but closer.
Add a comment...

Post has attachment
How I got the Chromecast button to work in a React JSX Component.

I'm having issues getting <button is="google-cast-button"/> working in a react.js app. It seems that the Chromecast framework only wants to add the event handlers and all to the button if the button exists in the DOM before the framework script is run.

The button is not working for me when I use react.js and have the buttons created later in the process.

Any advice on how to do this properly? I'd really rather not code up all the separate event handlers.

I'm trying to use it in material-ui@1.0.0b47. I did have it working in a material-ui@0.20 app earlier this year so yes it may be that something in material-ui's new version is breaking it, but even if I don't attempt to wrap it in their theming, it still fails.

Post has attachment
Joe Shelby commented on a post on Blogger.
This seems to have one more side effect: if you push multiple notifications in a relatively short time period (looks like 30 seconds), only the first one is ever visible. It seems there's some kind of blocker going on - only one notification can be shown in a certain amount of time before the next one is allowed. You can't even remove the current one to replace it if you're still in that window of time.
Add a comment...

Post has attachment
Joe Shelby commented on a post on Blogger.
Media Session API is very easy to work with (much easier than trying to use notifications, requiring a functioning service worker etc, which you can't do when the site has to be HTTP). I had it up on my new WIP app and deployed in less than an hour.
Add a comment...

Simple web audio player, default receiver.

Loading first song works fine. My controller gets events and is able to send them.

When I attempt to load the second song, either because user clicked 'next' or because receiver sent back an "IDLE" event indicating the song had finished, I get 2 run-throughs of the promise reply.

The first one returns the catch with the error code: "session_error" (and little else). Immediately after that, I get the then called. The file appears on the cast as it should...but the disconnect has happened: my PlayerController has ceased to receive any events anymore. My UI is completely unable to control the cast device (except to disconnect the cast session entirely).

Can someone PLEASE tell me what I'm doing wrong, what I should be doing to allow new file to be loaded? I have been bashing my head on this for 2 weeks now (finding other things to work on in the mean time).

Post has attachment
Joe Shelby commented on a post on Blogger.
Will there be a fix for the issue in arc-welder where the html5 windows are "shrunk" slightly, making fonts look ugly and causing horizontal lines to disappear? My app looks horrible when I view it in arc-welder, making that a less than ideal test platform.
Add a comment...

Post has attachment
Joe Shelby commented on a post on Blogger.
This annoys me greatly. The biggest reason I went to Chrome Apps is (pardon the pun) because of the ability to have a lack of chrome. A music player has a certain aesthetic, one that is disturbed by having the framed windows around it. I got away from the hosted app approach because Chrome stopped supporting the ability to remove the OS's bar with its expand/minimize/close buttons. I handle those on my own, thank you very much. Chrome Apps gave me that without all of the weight (and lack of platform updates) of Adobe's SubAir.

Yes, I'm looking at electron, but distribution is much more obnoxious that way, including informing users of updates. I would rather be spending the next few months adding new features instead of writing significant updates including an update-available detect feature that was originally nicely built in to the Chrome app distribution platform.
Add a comment...

Post has attachment
Wait while more posts are being loaded