Skip to content

vvideo/chromecast-type

Repository files navigation

chromecast-type

NPM Version NPM Downloads Bundlephobia install size

Google Cast Web SDK does not allow you to determine the Chromecast version, but indirectly, this can be done.

Support

  • Chromecast 1st generation
  • Chromecast 2nd generation
  • Chromecast Ultra
  • Chromecast 3th generation
  • Chromecast with Google TV 4K
  • Chromecast with Google TV HD
  • Android TV with Chromecast
  • Google Nest Hub
  • Google Nest Hub Max

Install

npm install chromecast-type

Using

getChromecastTypeByUserAgent(userAgent): string

For Node.js:

import { getChromecastTypeByUserAgent } from 'chromecast-type';
// ...
console.log(getChromecastTypeByUserAgent(userAgent));

For browser:

import { getChromecastTypeByUserAgent } from 'chromecast-type';
// ...
console.log(getChromecastTypeByUserAgent(navigator.userAgent));

getChromecastType(): string

For only browser using.

import { getChromecastType } from 'chromecast-type';

console.log(getChromecastType());

Stand

Links