12

Background

I'm planning to make an app that casts things (urls, content,...) to chromecast .

I've bought a ChromeCast dongle, and it worked fine using the samples of Google.

The problem

It's quite annoying to have 3 screens to look at while developing such apps, and I'd prefer to have the receiver on the PC side too.

Such a thing would also make it much easier to debug and test.

What I've tried

I've searched for this a lot, and found some Chrome plugins (like CR Cast), but they all have terrible bugs. I've even found a python based solution (here), but I failed to compile it.

I've noticed that there is a reciever side description of ChromeCast in the documentation. Does this have anything to do with a replacement of ChromeCast?

The question

I'd like to know if it's possible to do the testing on the computer itself, including all of the features that ChromeCast has.

nobody
  • 19,814
  • 17
  • 56
  • 77
android developer
  • 114,585
  • 152
  • 739
  • 1,270
  • Are you planning on using `RemotePlaybackClient`, or the Cast SDK? If the former, you can "cast" to your own `MediaRouteProvider`. If the latter, since Google has not released a Chromecast emulator, you will probably need to use hardware. You could look into HDMI input cards or monitors supporting picture-in-picture, to avoid the third screen. Personally, I just use a pico projector for that. – CommonsWare Jun 16 '14 at 21:52
  • @CommonsWare Since I'm still a Newb with developing for ChromeCast, I'm not aware of the various ways to cast to it. Can you please tell what is the difference between using RemotePlaybackClient and Cast SDK ? I plan on casting local video, and I've already found a way to open a web server on Android, so all I'd probably need is to cast the url to the device's path of the file, right? – android developer Jun 16 '14 at 22:20
  • 1
    "Can you please tell what is the difference between using RemotePlaybackClient and Cast SDK ?" -- at the 50,000-foot level, `RemotePlaybackClient` only allows you to use what the Cast SDK would refer to as the "default receiver". The Cast SDK lets you create the "styled" and "custom" receivers. It may also give you a bit more control over the playback -- `RemotePlaybackClient` is mostly play, pause, seek, and stop. But, `RemotePlaybackClient` is open, and other non-Chromecast devices may support it in the future. – CommonsWare Jun 16 '14 at 22:23
  • @CommonsWare Looking at the API, it seems both of them support casting a url of a file, right? Do both also support subtitles ? Also, do both of them require the device to have the google-play-services? – android developer Jun 16 '14 at 22:28
  • 2
    "it seems both of them support casting a url of a file, right?" -- correct. "Do both also support subtitles ?" -- AFAIK, that is tied to the media, not the API, but I'm no expert on subtitles. "Also, do both of them require the device to have the google-play-services?" -- that's the big benefit of `RemotePlaybackClient`, as it is part of the Android SDK. No Play Services required. Hence, it will work on other devices (e.g., Kindle Fire) that are on the appropriate API level. Downside: it's a bit buggy, though some of that is in the Chromecast `MediaRouteProvider`. – CommonsWare Jun 16 '14 at 22:31
  • @CommonsWare So besides some bugs you've found, it seems RemotePlaybackClient is a very good choice. Any other good tips ? It's too bad there isn't a solution to the original question I asked. You said that if I use "RemotePlaybackClient", I can cast to my own "MediaRouteProvider". What does it mean? that I could cast from the Android device, to the same device? Or to the PC ? or any ? – android developer Jun 16 '14 at 22:41
  • 2
    "What does it mean?" -- a `RemotePlaybackClient` talks to an on-device component called a `MediaRouteProvider`. Chromecast has one, that ships with Play Services AFAICT. AllCast may have one. And you can write your own. For the purposes of automated testing, think of it as a mock Chromecast. "that I could cast from the Android device, to the same device?" -- yes. A production `MediaRouteProvider` then talks to something else using proprietary means (e.g., Chromecast provider talks to Chromecast via WiFiDirect or something) to actually display your desired media. – CommonsWare Jun 16 '14 at 23:02
  • @CommonsWare Wow cool. Didn't know that. Are there any other tips/info you think I should know about? – android developer Jun 17 '14 at 05:13
  • OK, I've decided to request this feature of having an emulator of ChromeCast : https://code.google.com/p/android/issues/detail?id=71654 . Hope people will like this idea. – android developer Jun 17 '14 at 06:43

2 Answers2

3

Unfortunately there is no replacement for testing a Chromecast other then testing on a Chromecast been developing on CC for 3 years... (If someone knows how please enlighten me).

The receiver web application that is run on the CC references Google JS libraries that are dependent specifically on CC hardware and must run on the devices builtin browser.

I've been in the similar situation where while traveling I had no access to a TV and needed to fix a CC issue. In this case I would recommend just plugging the CC into USB (to power it) and leave the display out of it. The CC has no dependency on being plugged into a display to function and it will operate, stream, log events just the same. Then just access its remote debugger on the CC's IP address and port 9222. Every log regarding its operation will be there and you can inspect the HTML (But you probably know this).

  • 1
    Is it possible to have the CC somehow cast to a PC monitor ? Even the one that is currently being used for developing? – android developer Aug 18 '17 at 19:27
  • When your monitor has a hmdi input it is possible to connect your CC to your monitor. Otherwise you need a converter for another input source. – JeKa Dec 11 '17 at 14:37
0

The Chromecast connects to a TV via an HDMI port which is available on most monitors. You may simply connect, if your monitor has an HDMI port. Modern monitors support the latest HDMI protocol, so you will be able to get video and audio. I am currently using this setup using a NEC MultuSync EA275UHD. The output is visible by switching Inputs but there is also a PIP mode on the monitor that allows the screen to be slit to view the Chromecast and Desktop output side by side or with one of them scaled down and overlaid near a corner.

Now, if your computer screen does not have an HDMI port, you can get converters but sometimes you will lose features. A HDMI to DVI for example will be limited to Full HD and not transmit sound. DisplayPort adapters can handle 4K resolution and audio, but read the specs because not all do.

The last and more expensive option is an HDMI capture card or adapter. That will let you see the display on a laptop even. The advantage is that you can even record the output for demos, for example. Those costs from $80 to $400 USD, depending if they can capture 4K and at which refresh rate.

Itai
  • 227
  • 3
  • 12