chromecast-device-emulator icon indicating copy to clipboard operation
chromecast-device-emulator copied to clipboard

update required

Open samhammer325 opened this issue 5 years ago • 19 comments

When I run the example cli I get error 426 update required error. Do you know how to solve?

samhammer325 avatar Jul 15 '20 19:07 samhammer325

Hi @samhammer325,

Thanks for the feedback.

Would you mind to share either the detailed error message or a screenshot of it, that would be helpful. It would be even better if you can share the steps that ran into the issue, thanks!

ajhsu avatar Jul 16 '20 15:07 ajhsu

Hi. I cloned the repo, did npm install, and tried to run

node standalone/example.js

I'm on Mac

Screen Shot 2020-07-16 at 2 32 46 PM

samhammer325 avatar Jul 16 '20 21:07 samhammer325

@samhammer325 Thanks for the information, I'm currently looking into the issue.

ajhsu avatar Jul 20 '20 02:07 ajhsu

Hi I am gettig this issue when I just run the app. image

Please help me in this

ishanbhutagate6 avatar Aug 21 '20 07:08 ishanbhutagate6

@samhammer325 Thanks for the information, I'm currently looking into the issue.

Any update ?

damsdev1 avatar Dec 06 '20 22:12 damsdev1

bump

isamuhiro avatar Jan 13 '21 14:01 isamuhiro

Bump

computersandstuff avatar Sep 17 '21 22:09 computersandstuff

is this library still working?

hhanifkhan avatar Sep 24 '21 10:09 hhanifkhan

bump

andriemc avatar Mar 07 '22 17:03 andriemc

Hi all, My apologies for the late reply. Since I am no longer working on a chromecast app for a few years, I have no real-world demands to keep the tool up-to-date; But I don't tend to sunset this tool since some people still rely on it.

So, my plan is that, if anyone has a strong demand for this project, I would love to work with you to fulfill your development requirement; By working on a real project, I think it makes more sense to ensure that the tool is working correctly and the DX is designed reasonably.

So, please let me know if you are interested in collaborating with me, and let us keep the tool up-to-date.

ajhsu avatar Apr 19 '22 07:04 ajhsu

I´m using it daily on a M1 mac, have not had any issues. What kind of device are you trying to emulate?

mimse avatar May 04 '22 09:05 mimse

Hello, any of you can share a working default scenario.json file?

I am receiving the same issue "426 update required error", but I think it is related with the scenario.json file used.

The scenario.json file used is the one from the documentation:

{
  "timeline": [
    {
      "time": 5520,
      "ipcMessage": "{\"data\":\"{\\\"type\\\":\\\"visibilitychanged\\\"}\",\"namespace\":\"urn:x-cast:com.google.cast.system\",\"senderId\":\"SystemSender\"}"
    }, {
      "time": 5538,
      "ipcMessage": "{\"data\":\"{\\\"type\\\":\\\"standbychanged\\\"}\",\"namespace\":\"urn:x-cast:com.google.cast.system\",\"senderId\":\"SystemSender\"}"
    }, {
      "time": 5926,
      "ipcMessage": "{\"data\":\"{\\\"requestId\\\":1,\\\"type\\\":\\\"GET_STATUS\\\"}\"}"
    }
  ]
}

@mimse @ajhsu ??

Hello, any of you can share a working default scenario.json file?

Hi @JeanCarlosChavarriaHughes , thanks for reporting. Can you try again with this example scenario.json and see if that works for you?

ajhsu avatar Jun 21 '22 05:06 ajhsu

Hello @ajhsu I see the same issue with the sceneario.json provided:

HTTP/1.1 426 Upgrade Required
Content-Length: 16
Content-Type: text/plain
Date: Wed, 22 Jun 2022 02:49:11 GMT
Connection: keep-alive

Upgrade Required%    

This is how I start the server:

chromecast-device-emulator: Scenario file </Users/jeancarlos/Documents/scenario.json> has been loaded.
chromecast-device-emulator: Established a websocket server at port 8008
chromecast-device-emulator: Ready for Chromecast receiver connections..```

Thanks @JeanCarlosChavarriaHughes , I think I kind of understand why people are saying that there's an update required error.

The emulator server (the one serves on http://localhost:8008/) is supposed to serve your receiver app instead of any directly browsing (e.g., visit the localhost:8008 by browsers). Which means, if you're currently developing a cast receiver app from an official template like googlecast/CastReceiver, you will be able to test your receiver app locally by spinning up the emulator on your local machine, and here is how to do that exactly:

  1. Download the example scenario.json from here
  2. Spin up the emulator by running cde start scenario.json
  3. Serve your receiver app locally (if you don't have any local web server, I recommend to use this package)
  4. Open your local-served receiver app (should be something like http://127.0.0.1:8000/receiver.html)
  5. The receiver app should connect to the emulator and start receiving commands from emulator immediately.
  6. The receiver app should start playing the example video as if it is controlled by a sender app.

Please let me know if that works for you, thanks!

ajhsu avatar Jun 22 '22 04:06 ajhsu

Hello @ajhsu thanks for the feedback, I was able to follow each step, however I am confused,

My custom receiver cast application is served with local-web-server as suggested and it works in http://127.0.0.1:8000, I confirmed in the web browser.

chromecast-device-emulator was started previously in another terminal with the scenario .json provided.

But I don't see any indication of step 5 happening. The receiver app should connect to the emulator and start receiving commands from emulator immediately.

I finally opened Youtube in Google Chrome browser expecting to see the "Cast" button without luck.

Any other suggestion?

But I don't see any indication of step 5 happening.

@mimse That's weird. Can you see any output messages from your terminal like this?

chromecast-device-emulator: There is a cast client just connected.
chromecast-device-emulator: << {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"ready\",\"activeNamespaces\":[\"urn:x-cast:com.google.cast.cac\",\"urn:x-cast:com.google.cast.debugoverlay\",\"urn:x-cast:com.google.cast.broadcast\",\"urn:x-cast:com.google.cast.media\",\"urn:x-cast:com.google.cast.inject\"],\"version\":\"2.0.0\",\"messagesVersion\":\"1.0\",\"sdkCapabilities\":{\"show_media_controls_supported\":true,\"group_capabilities_supported\":true,\"playback_device_status_supported\":true}}"}
chromecast-device-emulator: << {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"startheartbeat\",\"maxInactivity\":10}"}
chromecast-device-emulator: >> {"data":"{\"applicationId\":\"628AC8D3\",\"applicationName\":\"CAFV1\",\"closedCaption\":{},\"deviceCapabilities\":{\"bluetooth_supported\":true,\"display_supported\":true,\"focus_state_supported\":true,\"hi_res_audio_supported\":false},\"launchingSenderId\":\"7f8b100d-a1fe-e60b-5a35-6feaa22976df.2:sender-l4koe754cbxf\",\"messagesVersion\":\"1.0\",\"sessionId\":\"46fd154e-f03d-4d58-986d-4998c43639a7\",\"type\":\"ready\",\"version\":\"1.30.113131\"}","namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender"}
chromecast-device-emulator: >> {"data":"{\"level\":1.0,\"muted\":false,\"type\":\"volumechanged\"}","namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender"}
chromecast-device-emulator: >> {"data":"{\"type\":\"visibilitychanged\"}","namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender"}

If everything goes well, you should be able to see the sample video being played on your receiver app like this: Screen Shot 2022-06-23 at 1 34 04 PM

I finally opened Youtube in Google Chrome browser expecting to see the "Cast" button without luck.

I believed this is expected. The emulator doesn't mean to be used that way, and instead, it's for receiver app development only.

ajhsu avatar Jun 23 '22 05:06 ajhsu

Thanks for the explanation @ajhsu This is now working as expected.

jchavarr@sjo-mp4se samples % cde start /tmp/chromecast-scenarios/scenario1.json
chromecast-device-emulator: Scenario file </tmp/chromecast-scenarios/scenario1.json> has been loaded.
chromecast-device-emulator: Established a websocket server at port 8008
chromecast-device-emulator: Ready for Chromecast receiver connections..
chromecast-device-emulator: There is a cast client just connected.
chromecast-device-emulator: << {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"ready\",\"activeNamespaces\":[\"urn:x-cast:com.google.cast.cac\",\"urn:x-cast:com.google.cast.debugoverlay\",\........
......
chromecast-device-emulator: << {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"PLAYING\",\"currentTime\":596.474195,\"supportedMediaCommands\":12303,\"volume\":{\"level\":1,\"muted\":false},\"activeTrackIds\":[],\"currentItemId\":1,\"repeatMode\":\"REPEAT_OFF\",\"breakStatus\":{}}],\"requestId\":0}"}
chromecast-device-emulator: << {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"IDLE\",\"currentTime\":596.474195,\"supportedMediaCommands\":12303,\"volume\":{\"level\":1,\"muted\":false},\"currentItemId\":1,\"idleReason\":\"FINISHED\",\"breakStatus\":{}}],\"requestId\":0}"}

Trying my best here:

It says one of the messages is invalid on google's default sample app image

image

LucasMW avatar Jan 23 '23 20:01 LucasMW