{"id":13597620,"url":"https://github.com/livepeer/webrtmp-sdk","last_synced_at":"2025-04-10T01:31:09.899Z","repository":{"id":46918309,"uuid":"406880440","full_name":"livepeer/webrtmp-sdk","owner":"livepeer","description":"SDK for streaming media via RTMP from the web.","archived":false,"fork":false,"pushed_at":"2023-08-07T18:07:15.000Z","size":269,"stargazers_count":13,"open_issues_count":0,"forks_count":9,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-08T12:15:27.602Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/livepeer.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-15T18:16:55.000Z","updated_at":"2025-02-13T10:58:45.000Z","dependencies_parsed_at":"2024-01-14T06:04:48.407Z","dependency_job_id":"240e8248-f1b0-4672-a3ea-0d73da96b657","html_url":"https://github.com/livepeer/webrtmp-sdk","commit_stats":{"total_commits":32,"total_committers":3,"mean_commits":"10.666666666666666","dds":0.59375,"last_synced_commit":"25e35415afae4cfb84e005d8e6ce08e70a6ab769"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fwebrtmp-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fwebrtmp-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fwebrtmp-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livepeer%2Fwebrtmp-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livepeer","download_url":"https://codeload.github.com/livepeer/webrtmp-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140293,"owners_count":21054274,"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":[],"created_at":"2024-08-01T17:00:37.319Z","updated_at":"2025-04-10T01:31:04.883Z","avatar_url":"https://github.com/livepeer.png","language":"TypeScript","funding_links":[],"categories":["Developer Tools"],"sub_categories":["Demo Apps"],"readme":"# [[ DEPRECATED ]] webrtmp-sdk [![npm version](https://badge.fury.io/js/@livepeer%2Fwebrtmp-sdk.svg)](https://badge.fury.io/js/@livepeer%2Fwebrtmp-sdk)\n\n\u003e THIS SDK IS DEPRECATED. REACT DEVELOPERS SHOULD USE THE [NEW BROADCAST SDK](https://docs.livepeer.org/reference/livepeer-js/Broadcast), AND ALL OTHER DEVELOPERS SHOULD FOLLOW THIS [GUIDE ON WEBRTC BROADCASTING](https://docs.livepeer.org/guides/developing/stream-via-browser.en-US#adding-broadcasting-with-plain-webrtc)\n\nJavaScript SDK for streaming media via RTMP from the Web. Originally designed\nfor [Livepeer.com](livepeer.com), but can be used for any other service by\nrunning your own [webrtmp-server](https://github.com/livepeer/webrtmp-server).\n\n\u003e This SDK works best on Chrome Desktop, as it currently only supports WebSocket on H.264-capable browsers. We are working on WebRTC support to allow the use of non-Chrome and non-Desktop browsers. Check out the [Browser Support](#browser-support) section for more.\n\n\n## Installation\n\n### CDN\n\nAdd the following script tag to the header of your HTML file:\n\n```html\n\u003cscript src=\"https://unpkg.com/@livepeer/webrtmp-sdk@0.2.3/dist/index.js\"\u003e\u003c/script\u003e\n```\n\nThe API will be available as a global named `webRTMP`:\n\n```js\nconst { Client } = webRTMP\n```\n\n### Package Managers\n\n#### yarn\n\n```sh\nyarn add @livepeer/webrtmp-sdk\n```\n\n#### npm\n```sh\nnpm install @livepeer/webrtmp-sdk\n```\n\nThe API can then be imported as a regular module:\n\n```js\nconst { Client } = require('webrtmp-sdk')\n```\n\n## Usage\n\nIn order to stream through Livepeer, you are going to need a secret `streamKey`,\nwhich can be obtained by following these steps:\n\n1) Create Livepeer Account at [livepeer.com](https://www.livepeer.com);\n2) Go to the Livepeer [Streams Dashboard](https://www.livepeer.com/dashboard/streams);\n3) Create a stream;\n4) Grab the stream key and replace the `{{STREAM_KEY}}` in the example below.\n\n\n```js\nconst client = new Client()\n\nasync function start() {\n  const streamKey = '{{STREAM_KEY}}'\n\n  const stream = await navigator.mediaDevices.getUserMedia({\n    video: true,\n    audio: true\n  })\n\n  const session = client.cast(stream, streamKey)\n\n  session.on('open', () =\u003e {\n    console.log('Stream started.')\n  })\n\n  session.on('close', () =\u003e {\n    console.log('Stream stopped.')\n  })\n\n  session.on('error', (err) =\u003e {\n    console.log('Stream error.', err.message)\n  })\n}\n\nstart()\n```\n\n\u003e **NOTE:** If you have multiple streaming users you will need a separate\n\u003e `streamKey` for each of them. So you should have a backend service\n\u003e programmatically create a stream through Livepeer API and return the\n\u003e `streamKey` for your front-end. Check out [Livepeer API\n\u003e Documentation](https://livepeer.com/docs/guides) on how to [get an API\n\u003e key](https://livepeer.com/docs/guides/start-live-streaming/api-key) and then\n\u003e how to [create a stream](https://livepeer.com/docs/guides/start-live-streaming/create-a-stream).\n\n## Browser Support\n\nWe provide a utility function to check whether the current browser is supported by the SDK:\n\n```js\nconst { isSupported } = require('@livepeer/webrtmp-sdk')\n\nif (!isSupported()) {\n  alert('webrtmp-sdk is not currently supported on this browser')\n}\n```\n\n## Examples\n\nThe `examples` folder at the root of this repository contains two projects:\n - [webrtmp-static](examples/webrtmp-static), implemented in vanilla HTML, CSS\n   and JavaScript. Check it out on\n   [CodePen](https://codepen.io/samuelmtimbo/pen/QWgaZGL).\n - [webrtmp-react](examples/webrtmp-react), implemented with React (created\n   using [create-react-app](https://github.com/facebook/create-react-app)).\n\nFor a full working example, check out [justcast.it](https://justcast.it) ([source\ncode](https://github.com/victorges/justcast.it)).\n\n## Contributing\n\nPull Requests are always welcome!\n\n## License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivepeer%2Fwebrtmp-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivepeer%2Fwebrtmp-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivepeer%2Fwebrtmp-sdk/lists"}