{"id":16054961,"url":"https://github.com/innovailable/rtc-lib","last_synced_at":"2025-03-18T04:31:11.085Z","repository":{"id":30895877,"uuid":"34453627","full_name":"Innovailable/rtc-lib","owner":"Innovailable","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-25T17:29:20.000Z","size":312,"stargazers_count":15,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T07:02:59.677Z","etag":null,"topics":["library","typescript","webrtc"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Innovailable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-23T12:00:47.000Z","updated_at":"2022-03-04T00:17:42.000Z","dependencies_parsed_at":"2022-09-07T15:01:29.475Z","dependency_job_id":null,"html_url":"https://github.com/Innovailable/rtc-lib","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/Innovailable%2Frtc-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Frtc-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Frtc-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Innovailable%2Frtc-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Innovailable","download_url":"https://codeload.github.com/Innovailable/rtc-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902277,"owners_count":20366259,"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":["library","typescript","webrtc"],"created_at":"2024-10-09T02:05:02.410Z","updated_at":"2025-03-18T04:31:10.628Z","avatar_url":"https://github.com/Innovailable.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rtc-lib\n\n## What is this?\n\nThis is a WebRTC client library/abstraction layer. It is inspired by\n[palava-client](https://github.com/palavatv/palava-client) and attempts to\noffer users and developers a better experience.\n\nThe design goals and principles are\n\n* allow simple code for basic usage as well as complex usage scenarios\n* hide complexity of WebRTC\n* heavy use of Promises\n* support for multiple Streams and DataChannels\n* consistent handling of errors and success notifications\n\n## How to use this?\n\nThe central element of the library is a `Room`. Multiple users, which are called\n`Peer`, can join a room and will create peer to peer connections to each other.\nYou can send audio/video data to the peers through this connection, this is\nrepresented by a `Stream`, or send custom data using a `DataChannel`.\n\nAll streams added to the local peer using `addStream()` will be sent to all\npeers which are in the room. If you want to send a stream only to specific peers\nyou can add them later using `addStream()` on the remote peer as soon as they\nare encountered. The same applies to data channels.\n\nHere is a simple example:\n\n    // create a room\n    var room = new rtc.Room(\"wss://rtc.innovailable.eu/testroom\");\n\n    // create a local stream from the users camera\n    var stream = room.local.addStream();\n\n    // display that stream\n    var ve = new rtc.MediaDomElement($('video'), stream);\n\n    // get notified whenever we meet a new peer\n    room.on('peer_joined', function(peer) {\n        // create a video tag for the peer\n        var view = $('\u003cvideo\u003e');\n        $('body').append(view);\n        var ve = new rtc.MediaDomElement(view, peer);\n\n        // remove the tag after peer left\n        peer.on('left', function() {\n            view.remove();\n        });\n    });\n\n    // join the room\n    room.connect();\n\nThis can be considered a minimal example implementing a multi user video chat.\nFor your own implementation you might want to have more control over the\nworkflow and handle errors.\n\nFor a more complex example have a look at the `example` folder. You can run this\ncode using `make example` which will create a server which includes everything\nyou need. Feel free to play around with this test code to get to know the API.\n\nThe complete API documentation is embedded as\n[YUIDoc](http://yui.github.io/yuidoc/) in the source code. You can create an\nHTML page from it using `make doc` or view it online\n[here](http://innovailable.github.io/rtc-lib/).\n\n## What else do I need?\n\nYou will need a signaling server to enable the peers to find each other and\nestablish the peer to peer connections. rtc-lib supports multiple different\nsignaling protocols including\n[calling-signaling](https://github.com/Innovailable/calling-signaling) and the\npalava protocol (implemented by [signal\ntower](https://github.com/palavatv/signaltower) and others). You could also\nwrite your own signaling server or implement another signaling protocol.\n\nIt is also recommended to use a [STUN](https://en.wikipedia.org/wiki/STUN)\nserver which will allow peers to connect through routers and firewalls. If you\ndo not use one only clients on the same network would be able to connect to each\nother. There are several STUN servers open for public use or you can set up your\nown STUN server using one of multiple open source projects.\n\nA [TURN](https://en.wikipedia.org/wiki/Traversal_Using_Relays_around_NAT)\nserver can be added to allow connections in nearly all scenarios.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnovailable%2Frtc-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnovailable%2Frtc-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnovailable%2Frtc-lib/lists"}