{"id":16512971,"url":"https://github.com/mslosarz/nextrtc-js-client","last_synced_at":"2025-10-28T04:32:01.664Z","repository":{"id":22738905,"uuid":"26083981","full_name":"mslosarz/nextrtc-js-client","owner":"mslosarz","description":"JavaScript client written for NextRTC signaling server","archived":false,"fork":false,"pushed_at":"2018-09-08T12:34:21.000Z","size":59,"stargazers_count":13,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T12:01:34.741Z","etag":null,"topics":["nextrtc","webrtc","webrtc-javascript-library","webrtc-libraries"],"latest_commit_sha":null,"homepage":"https://nextrtc.org","language":"JavaScript","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/mslosarz.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":"2014-11-02T15:15:08.000Z","updated_at":"2021-11-30T08:09:44.000Z","dependencies_parsed_at":"2022-08-21T10:30:47.148Z","dependency_job_id":null,"html_url":"https://github.com/mslosarz/nextrtc-js-client","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/mslosarz%2Fnextrtc-js-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslosarz%2Fnextrtc-js-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslosarz%2Fnextrtc-js-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslosarz%2Fnextrtc-js-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mslosarz","download_url":"https://codeload.github.com/mslosarz/nextrtc-js-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219860179,"owners_count":16556026,"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":["nextrtc","webrtc","webrtc-javascript-library","webrtc-libraries"],"created_at":"2024-10-11T16:06:47.569Z","updated_at":"2025-10-28T04:31:56.320Z","avatar_url":"https://github.com/mslosarz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NextRTC JavaScript client\nNextRTC js client constructor requires:\n\n* **wsURL** which should points to your endpoint `{ws/wss}://{host}:{port}/{applicationName}/{endpointGivenInAnnotation}`\nendpointGivenInAnnotation e.g. – @ServerEndpoint(value = “/signaling” …)\n* **mediaConfig** are passed straight to adapter, so more information about parametres you can find in webrtc/adapter documentation.\n* **peerConfig** are also described in [webrtc/adapter](https://github.com/webrtc/adapter) project.\n\nExample is shown below and it’s also available in [nextrtc-sample-webapp](https://github.com/mslosarz/nextrtc-sample-webapp)\n\n```js\nnew NextRTC({\n    wsURL : 'wss://examples.nextrtc.org/videochat/signaling',\n    mediaConfig : {\n        video : true,\n        audio : true,\n    },\n    peerConfig : {\n        'iceServers' : [ {\n            url : \"stun:stun.l.google.com:19302\"\n        }]\n    }\n}/*, optional DEBUG mode /true or false/*/);\n```\n\n## How to use nextrtc-js-client on static page?\n \nWhen page will be fully loaded you should create nextrtc object.\nIf you don’t know when your page is fully loaded you can use override method NextRTC.onReady (this way of use is presented in example).\n\nWhen you create NextRTC object you have to provide function which will be called when event happens.\nTo register function you have to call method on() as presented in snipped:\n\n```js\nvar nextRTC = new NextRTC({\n    ...\n});\n\nnextRTC.on('{eventName}', function(event:Event){\n    \n});\n```\nThere are two signals which are providing other second parameter type. Those signals are:\n`localStream` and `remoteStream`, when you are handling local audio/video stream and incoming audio/video stream you can simply attach stream to valid element (without additional action like resolving stream by description provided in event).\n\n```js\nnextRTC.on('{localStream|remoteStream}', function({stream: Stream, member: memberId}){\n\n});\n```\n\n## How to send / handle custom signals?\n\nOn the js side you have to write two methods. One for sending new signal\n```js\nNextRTC.prototype.upperCase = function upperCase(content, custom) {\n    this.channel.send({signal: 'upperCase', content: 'content', custom: custom});\n}; \n```\nsecond one which will react on the response:\n```js\nnextRTC.on('upperCase', content =\u003e {\n// here you should handle the response\n});\n```\nThen you will be able to use structure like this to post your custom signal:\n```js\nnexrtc.upperCase('lowerCase');\n```\n\n## Model\n\nEvent structure and available events are presented [here](https://github.com/mslosarz/nextrtc-signaling-server)\n\nEvent is serialized java version of message.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslosarz%2Fnextrtc-js-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmslosarz%2Fnextrtc-js-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslosarz%2Fnextrtc-js-client/lists"}