KirovBvulgaru / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Casting a custom app from Chrome times out when requesting session #129

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Register app, receive appId
2. Create and deploy custom receiver app using code found: 
https://developers.google.com/cast/docs/custom_receiver
3. Launch app using example code found: 
https://developers.google.com/cast/docs/chrome_sender
4. Request a session using: chrome.cast.requestSession
5. Get a timeout callback every time!

What is the expected output? What do you see instead?
Expected: App is launched on ChromeCast, success callback from request session.
Actual: App is launched on ChromeCast, the error callback of is called every 
time with: 
{ code: "timeout", description: "Timeout at extension", details: null }

I've used the exact same sender code using the default 
DEFAULT_MEDIA_RECEIVER_APP_ID and it works perfectly.
I have stripped my receiver code to the bare minimum example from the example

Original issue reported on code.google.com by gra...@kennery.com on 7 Feb 2014 at 1:33

GoogleCodeExporter commented 8 years ago
There is practically no information here; you need to be more specific 
otherwise it is too generic/vague to be actionable.

Original comment by anad...@google.com on 8 Feb 2014 at 6:22

GoogleCodeExporter commented 8 years ago
I am having the same problem. I have registered my device, and registered (but 
not published) an app, with its URL pointing to a shared Drive directory. (I've 
confirmed that this URL works).

To try to launch my app, I have just modified the Cast-TicTacToe-chrome demo to 
use my APP_ID.

I get the "Timeout at extension" message as above.  If I try to get more 
information by going to port 9022 on the Chromecast, I get a page showing:
  Inspectable WebContents
  404 - PAGE NOT FOUND

The "404" is a link to a devtools/devtools.html URL, which shows a Chrome 
console with an error saying:

 > Uncaught ReferenceError: prettyPrint is not defined cast.html:177

So, I seem to have hit a dead-end. I can't see how I can get any more 
information to figure out what isn't set up correctly.  As far as I can tell, 
the Chromecast is correctly receiving a request to open my app, but whatever 
URL it's trying to open is giving it a 404.

There clearly seems to be a bug in cast.html - it's trying to call a 
non-existent prettyPrint() function. But that doesn't seem to be the root cause 
- but it may be preventing me from finding out why my app isn't working.

Original comment by andrew.b...@gmail.com on 25 Apr 2014 at 8:01

GoogleCodeExporter commented 8 years ago
The port is 9222 not 9022.

Original comment by anad...@google.com on 25 Apr 2014 at 8:05

GoogleCodeExporter commented 8 years ago
Sorry - my mistake - I am using :9222.

To confir: prettyPrint() isn't part of my receiver app.  According to the 
devtools.html console, the calling code looks like this:

                           <script>
        $(function () {
            $('.expander').simpleexpand();
            prettyPrint();
        });
    </script>

Original comment by andrew.b...@gmail.com on 25 Apr 2014 at 8:16

GoogleCodeExporter commented 8 years ago
If you cannot connect to port 9222, it means your device has not been 
whitelisted. Did you add your device on the dev portal, and if so, can you 
double check the serial number (it is very easy to mix 0 and O for example) and 
have you rebooted your cast device after that? You need to be able to access 
that port before being able to play your own app there.

Original comment by anad...@google.com on 25 Apr 2014 at 8:31

GoogleCodeExporter commented 8 years ago
Ah - the root cause seems to be that the Chromecast is cacheing a stale URL. 
When I initially registered my app, I mistyped the URL. The dev console on the 
Chromecast is showing a Hostgator gif -- and I've confirmed that the 
prettyPrint code comes from Hostgator's 404 page -- even though I changed the 
app to a Drive URL several hours ago.

The docs (https://developers.google.com/cast/docs/custom_receiver) say that it 
can take several hours to *publish* an app to Chromecast devices, which implies 
that unpublished apps can be updated reasonably quickly. It would be useful to 
have an indication somewhere to suggest that a) it can take a long time to 
update (or require a reboot of the Chromecast?), and b) to show which URL the 
Chromecast is fetching from (at least for unpublished test apps).

Original comment by andrew.b...@gmail.com on 25 Apr 2014 at 8:41