{"id":15397035,"url":"https://github.com/ryanhefner/googlecast-wrappers","last_synced_at":"2025-08-19T03:09:24.256Z","repository":{"id":27469646,"uuid":"30948886","full_name":"ryanhefner/googlecast-wrappers","owner":"ryanhefner","description":"Simplifying the creation of Google Cast (Chrome) Sender and Receiver apps.","archived":false,"fork":false,"pushed_at":"2015-10-26T19:27:20.000Z","size":186,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-16T11:49:23.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"labs.ryanhefner.com/open-source/googlecast-wrappers","language":"JavaScript","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/ryanhefner.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":"2015-02-18T02:30:18.000Z","updated_at":"2024-06-24T06:20:40.000Z","dependencies_parsed_at":"2022-09-04T17:22:39.065Z","dependency_job_id":null,"html_url":"https://github.com/ryanhefner/googlecast-wrappers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ryanhefner/googlecast-wrappers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fgooglecast-wrappers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fgooglecast-wrappers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fgooglecast-wrappers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fgooglecast-wrappers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanhefner","download_url":"https://codeload.github.com/ryanhefner/googlecast-wrappers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fgooglecast-wrappers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271093035,"owners_count":24697915,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-01T15:35:57.661Z","updated_at":"2025-08-19T03:09:24.212Z","avatar_url":"https://github.com/ryanhefner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Cast - Wrappers\n\nSimple wrappers for Google Cast (Chrome) Sender apps and custom Receiver apps.\n\nIt is licensed under the Apache 2.0 license.\n\n## Getting Started (Requirements)\nDepending on which one you are planning on building, either a Chrome Sender or a custom Receiver app, here are the basic things that you need to do to get up and running.\n\n### Chrome Sender\nIn order to create a Chrome Sender app, you'll need to include the following script files in your sender page:\n\n```\n\u003cscript type=\"text/javascript\" src=\"//www.gstatic.com/cv/js/sender/v1/cast_sender.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"libs/polyfills/object-assign-polyfill.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"sender/cast-sender.js\"\u003e\u003c/script\u003e\n```\n\n__NOTE__: `Object.assign()` is used to merge options passed to the `new CastSender({...})` with the default `options` in the sender. Use the supplied polyfill `libs/polyfills/object-assign-polyfill.js` to provide support across all browsers.\n\n### Custom Receiver\nFor Custom Receiver apps, include the following script files in your receiver app page:\n\n```\n\u003cscript type=\"text/javascript\" src=\"//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"//www.gstatic.com/cast/sdk/libs/mediaplayer/1.0.0/media_player.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"libs/polyfills/object-assign-polyfill.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"receiver/cast-receiver.js\"\u003e\u003c/script\u003e\n```\n\n__NOTE__:\n* The `media_player.js` file is only required if you plan to support media playback in your receiver app via the standard media controls.\n* `Object.assign()` support is required for the `CastReceiver` object (same as above).\n\n## Simple Example\nHere are some super simple examples of the basic requirements for creating a Chrome Sender and Custom Receiver app. For more details examples, review the examples supplied in the `examples` directory.\n\n\u003eNOTE: I am trying to resolve an issue with the custom `Player` interface (`vimeo-player-interface.js`) which is not returning an instance of the media session back to the Sender app. Once resolved, the supplied example should be working and usable.\n\n### Chrome Sender\n```\n\u003cbutton type=\"button\" id=\"cast-button\"\u003eCast\u003c/button\u003e\n\u003cbutton type=\"button\" id=\"load-button\"\u003eLoad Media\u003c/button\u003e\n\n\u003cscript\u003e\n\tvar castButton = document.getElementById('cast-button'),\t// Hidden by default\n\t\tloadButton = document.getElementById('load-button'),\n\t\tsender = new CastSender({\n\t\t\tappId: [YOUR APP ID or chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID],\n\t\t\tcustomNamespace: 'urn:x-cast:com.your.app', \t// Only required if you plan to send custom messages to your receiver app\n\t\t\tonReceiverAvailable: receiverAvailableHandler,\n\t\t\tonSessionConnected: sessionSuccessHandler\n\t\t});\n\n\tcastButton.addEventListener('click', function(ev) {\n\t\tsender.requestSession(sessionSuccessHandler);\n\t});\n\n\tloadButton.addEventListener('click', function(ev) {\n\t\tsender.loadMedia({\n\t\t\tcontentId: [VIDEO URL]\n\t\t});\n\t});\n\n\tfunction receiverAvailableHandler() {\n\t\t// Show the castButton since there is a receiver available\n\t\tcastButton.style.display = 'inline-block';\n\t}\n\n\tfunction sessionSuccessHandler() {\n\t\t// Change the state of the cast button when a session has been successfully initiated\n\t\tcastButton.classList.add('active');\n\t}\n\u003c/script\u003e\n```\n\n### Custom Receiver\n```\n\u003cvideo id=\"video-tag\"\u003e\n\n\u003cscript\u003e\n\tvar video = document.getElementById('video-tag'),\n\t\treceiver = new CastReceiver({\n\t\t\tappId: [YOUR APP ID],\n\t\t\tmediaElement: video\n\t\t});\n\u003c/script\u003e\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanhefner%2Fgooglecast-wrappers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanhefner%2Fgooglecast-wrappers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanhefner%2Fgooglecast-wrappers/lists"}