How can I know my chromecast custom receiver is functioning? - chromecast

I am trying to cast videos from my html video player to TV via chromecast.
Sender: CastVideos-chrome
https://github.com/googlecast/CastVideos-chrome
Receiver: CastReferencePlayer (registered as a Custom receiver, hosted on my github,
https://github.com/PhilSSOO/052617_CastReferencePlayer
and the app ID was input to the sender's CastVideos.js file)
The whole sender folder was put to my server applied from Apache. The path is
C:\Apache24\htdocs\CastVideos-chrome
Putting http//localhost/CastVideos-chrome/ to the address bar of the chrome browser and hit Enter, the app is up and running with videos being cast to TV. Now, my question is: How can I know my custom receiver is functioning? I tried to do some modifications on my css file (receiver app consists of player.html, player.js, player.css) but nothing seemed to be changing on my TV screen.
Please help!

Here's what the Custom Receiver Application has to say:
Note: Google Cast receiver applications must be hosted on secure
servers supporting https when published. Publishing a Google Cast
receiver application may take several hours to propagate to all Google
Cast devices (up to 6 hours). If you wish to verify that your
published application is working properly, you can manually restart
your Google Cast device to force a load of new configuration data.
Check the docs for more details about Application Configuration.

noogui,
Thank you for your reply.
I purposely modified the CSS file of my custom receiver (styled the progressBar with green color --- rgb(48, 249, 55) --- ), hosted it on my github account, published the receiver, waited 6 h and started testing. Upon starting my sender app the video got cast to TV, and the progressBar is still yellow, NOT GREEN. This means my receiver is not functioning!
I also tried a style receiver, and even styled the progressBar with a wrong color (rgb(48, 249, $$$)). The sender app also cast the video to TV without any complaint. The conclusion is, my receiver is not being called!
I tried to use the Chrome Remote Debugger to debug, but my chromecast device, although showed up on my laptop, didn't have the inspect link with it, so I couldn't go further.
BTW, my sender works fine with default receiver.
I got lost!
Thanks!

I figured that out. The issue was related to app hosting.
When a custom receiver is registered to google cast console, the receiver hosting URL and associated sender hosting URL are not where they are stored, but where they are published. For example, the receiver hosting URL
https://github.com/USER/REPOSITORYNAME
is not to be used, but the following URL is
https://USER.github.io/REPOSITORYNAME......
(this can be accessed via Settings --- GitHub Pages)
Once the correct URL is used, my custom receiver is up and running!
Cheers!

Related

Can the default media receiver for Chromecast handle a contentId/contentUrl that results in a redirect?

I'm using a service for live-streaming videos that provides a link (say https://example.com/video.m3u8) to the relevant file in order to cast it. Following the link manually, I go through a 302 redirect (to e.g. https://anotherdomain.com/video.m3u8), and get to the video file. When I try to cast the link (both chrome & android sender sdk's, the latter through a cordova plugin) I see an error if I use the example.com url, but succeed using the anotherdomain.com url.
I can check for redirects manually before casting, but ideally the default receiver would do that for me.
Is this failing on a redirect the expected behaviour? Is there any way to configure it so that it follows redirects?
I'm not sure if the redirect being of the wrong Content-Type (text/html rather than application/x-mpegURL) could be part of the cause

Google Drive API Console: Error saving Drive UI integration page

I have a webapp in production that interacts with Google Drive through Google Drive API.
I need to change some settings in Drive interaction but I can't save.
When I save the Drive UI integration page, I receive this error:
There's a problem at our end.
Please try again. If the problem persists, please let us know using
the "Send feedback" link below. Thanks!
(spying Network console: there is an Internal Server Error in a POST call)
I tried to send feedback for months: nobody answers and the bug is still there.
I tried also to create another project: I can save the first time but then the bug returns.
How can I do? Has someone the same problem?
Is there a way to receive a reply from Google? Is there some workaround?
Thank you.
i think that problem must be Client ID
before adding Client ID, go to the Credentials -> OAuth 2.0 Client IDs
then select edit your Client ID. after that your production site url add to Authorized JavaScript origins and Authorized redirect URIs.
then enter your Client ID in Drive UI integration page
For myself trying to get the Drive UI configured I noticed a couple of errors (that don't have any specific error messages)
When adding in an Open URL it has to be a valid domain, so for instance I tried to test it out with local host, to no avail. However something like https://devbox.app.com worked, but something like https://localhost:8888 does not. Even though https://localhost is a valid javascript origin in the client_id configuration (at least for the app I am working on, not sure about other apps), localhost doesn't work as an open URL.
When adding in the mimeTypes it needs to be in the format */* and can include custom mimeTypes like application/custom+xml and application/custom-name+json not sure for other custom types that are not in a particular format like xml or json. Also not sure about wildcards.
When adding in file extensions do not add in the '.' just the name of the file extension.
The app icon I found only failed to upload the image when the image wasn't the exact dimensions, I actually ended up editing some icons in photoshop to change the pixel x pixel values as a quick work around during dev.
That worked for me to get it to save and I tested it with a file that had a custom mimeType (application/custom-name+xml specifically) and custom file extension!

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

Chrome Cast Sender "session_error" NOT_FOUND

I can't get a basic sender app set up. I've tried the CastHelloText sender example, put in my own AppId and get an error immediately after chrome.cast.requestSession() is called when I select my device from the top-right Google Cast extension button. My receiver is based off of Cast-Simple-Receiver. I've done the whole unplugging power/plugging back in thing to restart ChromeCast, but that doesn't resolve my issue.
Resources out there seem kind of slim at the moment, but is there a place that explains everything in-depth without having to jump from site to site? Also, take a look at the image I've attached. I can't figure out what that other URL is supposed to be.
My specific error from the requestSession() looks like this:
{code: "session_error", description: "NOT_FOUND", details: null}
EDIT: I've verified that I can connect to the default chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID but my receiver app can't be connected to. I've registered my device and restarted it multiple times. I've now removed it and am trying to re-register it to see if that helps (even though it said it was ready for dev).
Check these; hopefully they get things sorted out:
Make sure you have registered your chromecast device on the developer console. Double check the serial number since sometimes it is hard to read it.
During the chromecast setup, there was a box stating something like "Send the serial number ..", make sure that is checked
Wait 1/2 hour or so and reboot your chromecast
Check whether you can access http://<chromecast-ip>:9222 from a chrome browser on the same wifi network; if you can, then your device is ready for development
As for the area on the image that you have pointed to, that is more for informational purposes at this point

Chromecast taking longer time to cast a mp4 from my host service

I'm using iOS Chromecast app, from iPhone simulator, when I try to cast video (say, Big Buck Bunny), sample video starts almost instantly. However when I host (using godaddy.com ost service) the same video/mp4 (Bigbuckbunny.mp4) using same JSON file (videos-enhanced-b.json) from source http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ its takes about 2 minutes to render? Any explanations are greatly appreciated. Thanks
My media.h as below:
#import <Foundation/Foundation.h>
#define MEDIA_URL_BASE #"http://www.myhosturl.com/subdirectory/"
#define MEDIA_URL_FILE #"videos-enhanced-b.json"
I suggest you open a browser and point to port 9222 on your receiver and watch as the messages come in to see what is causing the delay. The sender app sends the load message directly to your receiver, so that is obviously very fast (and that wouldn't care if your media is here or there) but after that, the receiver has to go fetch the movie from your site and render that. Watch the log to see if you notice anything unusual there. Also, from your wifi network and on your laptop, try to do download the movie (point your browser to it, for example) and see how that performs.
Based on the log I got from the X-Code its takes about 3 minutes after "Media control channel metadata changed" as highlighted below.
2014-02-17 00:08:45.337 YouCast[1510:a0b] -[GCKMediaControlChannel didReceiveTextMessage:] message received: {"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PAUSED","currentTime":0,"supportedMediaCommands":15,"volume":{"level":1,"muted":false},"media":{"contentId":"http://myurl.com/dd1.mp4","streamType":"NONE","duration":40.77424,"contentType":"video/mp4","metadata":{"title":"Elephant Dream","images":[{"url":"http://myurl.com/images_480x270/ElephantsDream.jpg","width":200,"height":100}],"metadataType":0,"subtitle":"Blender Foundation"}}}],"requestId":3}
2014-02-17 00**:08:45.338** YouCast[1510:a0b] Media control channel status changed
**2014-02-17 0**0:08:45.34**0 YouCast[1510:a0b] Media control channel metadata changed
2014-02-17 00:08:48.617 YouCast[1510:a0b] -[GCKCastSocket socket:didReadData:withTag:] prefix read, expected message length=248**
2014-02-17 00:08:48.618 YouCast[1510:a0b] -[GCKMediaControlChannel didReceiveTextMessage:] message received: {"type":"MEDIA_STATUS","status":[{"mediaSessionId":1,"playbackRate":1,"playerState":"PLAYING","currentTime":1.291666,"supportedMediaCommands":15,"volume":{"level":1,"muted":false}}],"requestId":0}
Note:not able to point chrome browser to 9222

Resources