{"id":23903940,"url":"https://github.com/francescocioria/chromecast-media-controls-api","last_synced_at":"2026-06-12T01:31:24.323Z","repository":{"id":57198498,"uuid":"349449954","full_name":"FrancescoCioria/chromecast-media-controls-api","owner":"FrancescoCioria","description":"API to control any media running on the Chromecast","archived":false,"fork":false,"pushed_at":"2021-03-29T12:20:33.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T06:47:04.808Z","etag":null,"topics":["cast","chromecast","chromecast-api","media","media-controller"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FrancescoCioria.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-19T14:24:53.000Z","updated_at":"2021-03-29T12:20:12.000Z","dependencies_parsed_at":"2022-09-16T14:10:28.885Z","dependency_job_id":null,"html_url":"https://github.com/FrancescoCioria/chromecast-media-controls-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrancescoCioria%2Fchromecast-media-controls-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrancescoCioria%2Fchromecast-media-controls-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrancescoCioria%2Fchromecast-media-controls-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrancescoCioria%2Fchromecast-media-controls-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrancescoCioria","download_url":"https://codeload.github.com/FrancescoCioria/chromecast-media-controls-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240306202,"owners_count":19780574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cast","chromecast","chromecast-api","media","media-controller"],"created_at":"2025-01-04T23:29:13.103Z","updated_at":"2026-06-12T01:31:24.219Z","avatar_url":"https://github.com/FrancescoCioria.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chromecast-media-controls\n\nAPI to control any media running on the Chromecast\n\n## Install\n\n```\nyarn add chromecast-media-controls\n```\n\n## Usage\n\n```ts\nimport {\n  ChromecastMediaControls,\n\n  // useful to check in advance if we can call media actions like pause() or resume()\n  appSupportsMediaControls\n} from \"chromecast-media-controls\";\n\nconst chromecast = new ChromecastMediaControls({\n  // called whenever the client receives an error message\n  onError: (error: Error) =\u003e {\n    // handle error\n  },\n\n  /*\n    called if the connection to the device is lost\n    NOTE: this is not called after manually invoking \"chromecast.closeConnection()\"\n  */\n  onDisconnect: () =\u003e {\n    //  handle disconnection, usually by re-initializing:\n    chromecast.initialize();\n  }\n});\n\n/*\n  initialize connection:\n    - find Chromecast device on network\n    - establish connection to Chromecast device\n    - initilize listeners (onError, onDisconnect)\n    - look for active media session, if any\n*/\nawait chromecast.initialize();\n\n// pause\nawait chromecast.pause();\n\n// resume\nawait chromecast.resume();\n\n// stop\nawait chromecast.stop(); // closes current application\n\n// seek\nawait chromecast.seek(120); // 120 seconds from beginning of media\n\n// change volume\nawait chromecast.setVolume({ level: 0.2, muted: false });\n\n// get current volume\nconst currentVolume = await chromecast.getVolume();\n\n// returns \"true\" if client has been initialized and we are connected to a Chromecast device\nchromecast.isConnected();\n\n// get current media session\nconst currentMediaSession = await chromecast.getStatus();\n\n// get current client session\nconst currentClientSession = await chromecast.session();\n\n// close connection (you'll have to re-initialize after this)\nawait chromecast.closeConnection();\n\n// low level usage\nconst player = await chromecast.player();\nplayer._player; // -\u003e instance of DefaultMediaReceiver from \"castv2-client\" library\n\nchromcast.client._client; // -\u003e instance of Platform sender from \"castv2-client\" library\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancescocioria%2Fchromecast-media-controls-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancescocioria%2Fchromecast-media-controls-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancescocioria%2Fchromecast-media-controls-api/lists"}