{"id":21647848,"url":"https://github.com/markknol/hx-googlecast-externs","last_synced_at":"2025-03-20T01:54:34.597Z","repository":{"id":36661920,"uuid":"40968263","full_name":"markknol/hx-googlecast-externs","owner":"markknol","description":"Haxe/JavaScript externs for Google Cast Receiver, Sender, Game SDK for the Google Chromecast","archived":false,"fork":false,"pushed_at":"2015-08-27T09:11:33.000Z","size":224,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-25T05:11:30.686Z","etag":null,"topics":["bindings","chromecast","google","haxe","haxe-externs"],"latest_commit_sha":null,"homepage":"https://github.com/markknol/hx-googlecast-externs","language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markknol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-18T11:31:14.000Z","updated_at":"2024-03-20T20:18:50.000Z","dependencies_parsed_at":"2022-09-02T18:41:16.071Z","dependency_job_id":null,"html_url":"https://github.com/markknol/hx-googlecast-externs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markknol%2Fhx-googlecast-externs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markknol%2Fhx-googlecast-externs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markknol%2Fhx-googlecast-externs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markknol%2Fhx-googlecast-externs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markknol","download_url":"https://codeload.github.com/markknol/hx-googlecast-externs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244536441,"owners_count":20468349,"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":["bindings","chromecast","google","haxe","haxe-externs"],"created_at":"2024-11-25T06:51:59.351Z","updated_at":"2025-03-20T01:54:34.578Z","avatar_url":"https://github.com/markknol.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hx-googlecast-externs\n#### Haxe/JavaScript externs for Google Cast Receiver, Sender, Game SDK.\n\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/576184/9329463/0559a0fe-45b2-11e5-8724-3a606419ecbf.png\" width=100 /\u003e\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/576184/9329443/e3475fec-45b1-11e5-870f-e6f1e1393f27.png\"  width=300 /\u003e\n\n_Targeted at Cast version v1_\n\n---\n\n# Setup _Chrome Sender_ application\n\n\u003e :book: **Tip:** Make sure you read this first https://developers.google.com/cast/docs/chrome_sender\n\n#### Include the _cast_sender.js_ `\u003cscript\u003e` tag\nAdd the script tag to your HTML page\n```html\n\u003cscript type=\"text/javascript\" src=\"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js\"\u003e\u003c/script\u003e \n```\n\n#### Initialization\nInstead of using `window['__onGCastApiAvailable'] = callback` you can use `ChromeCast.boot(callback)`.\n\nTo determine if the API is available and initialize it, you can provide the callback function before the Cast API loads. It is invoked with `loaded == true` when the API loads, or with `errorInfo` when load fails (e.g. when no extension is discovered).\n\n```haxe\nChromeCast.boot(function(loaded:Bool, errorInfo:String):Void\n{\n  trace('ChromeCast: version=${ChromeCast.VERSION}');\n  trace('ChromeCast: loaded=$loaded, errorInfo=$errorInfo');\n});\n```\n#### Requesting session\nYou initialize the API as follows:\n```haxe\nvar sessionRequest = new SessionRequest(appId);\nvar apiConfig = new ApiConfig(sessionRequest, sessionListener, receiverListener);\nChromeCast.initialize(apiConfig, onInitSuccess, onError);\n```\nFrom this point you are good to go and follow the docs.\n\n---\n\n# Setup _Custom Receiver_ application\n\n\u003e :book: **Tip:** Make sure you read this first: https://developers.google.com/cast/docs/custom_receiver\n\n#### Include the _cast_receiver.js_ `\u003cscript\u003e` tag\n\n```html\n\u003cscript src=\"//www.gstatic.com/cast/sdk/libs/receiver/1.0.0/cast_receiver.js\"\u003e\u003c/script\u003e\n```\n#### Initialization\n\n```haxe\nvar castReceiver = CastReceiverManager.getInstance();\ncastReceiver.start();\n```\nFrom this point you are good to go and follow the docs.\n\n---\n\n# Setup _Game Manager API_\n\n\u003e :book: **Tip:** Make sure you read this first: https://developers.google.com/cast/docs/gaming\n\nFollow this order of initialization:\n\n 1. Instantiate GameManager\n 2. Start Custom Receiver\n\n```haxe\nvar config = new GameManagerConfig();\nconfig.maxPlayers = 5;\nconfig.applicationName = \"Haxe ChromeCast Application\";\n\nvar gameManager = new GameManager(config);\ngameManager.addEventListener(EventType.GAME_MESSAGE_RECEIVED, onGameMessage);\n\n#if debug\n// nice simple UI for debugging Cast Receiver.\nvar debugUI = new DebugUI(gameManager);\ndebugUI.open();\n#end\n\nvar castReceiver = CastReceiverManager.getInstance();\ncastReceiver.start();\n```\nFrom this point you are good to go and follow the docs.\n\n---\n\n# Implementation notes\n\n* **Package name** The package of the Haxe externs are prefixed with `chromecast` instead of `cast`. This is to avoid conflicts with the `cast`-keyword in Haxe. As you can [see](https://github.com/markknol/hx-googlecast-externs/blob/master/googlecast/Receiver.hx#L10) in the extern classes, the `@:native` keyword rewrites this package to the expected package.\n\n# Updates\n * I'm not sure if I will maintain the extern classes. It it provides as is. Feel free to do a pull-request.\n\n# Credits\n * Part of the type definitions are created by Mark Knol. I'm not associated with Google. It could be the case stuff is missing, incomplete or even incorrect. I manually collected the Haxe extern classes and copy/pasted the documentation at it.\n * Part of the definitions are created by renaudbardet, see https://github.com/renaudbardet/google-cast-receiver-hx-headers I've put it together for convinience.\n\nThis software is distributed under the MIT licence which extends only to the headers themselves, the actual software they give access to are the property of Google and may be subject to a different license.\n\n# Learn more\n * https://developers.google.com/cast/\n * http://haxe.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkknol%2Fhx-googlecast-externs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkknol%2Fhx-googlecast-externs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkknol%2Fhx-googlecast-externs/lists"}