{"id":16398666,"url":"https://github.com/ken107/janus-videoroom-js","last_synced_at":"2026-03-07T18:31:29.500Z","repository":{"id":65185281,"uuid":"438031355","full_name":"ken107/janus-videoroom-js","owner":"ken107","description":"Provides a simple high-level API that makes it easy to work with the Janus VideoRoom plugin","archived":false,"fork":false,"pushed_at":"2026-01-19T06:42:49.000Z","size":283,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-19T12:50:46.861Z","etag":null,"topics":["janus","janus-gateway","videoroom"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ken107.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-13T21:33:24.000Z","updated_at":"2026-01-19T06:42:53.000Z","dependencies_parsed_at":"2024-10-28T09:16:10.766Z","dependency_job_id":null,"html_url":"https://github.com/ken107/janus-videoroom-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ken107/janus-videoroom-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fjanus-videoroom-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fjanus-videoroom-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fjanus-videoroom-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fjanus-videoroom-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ken107","download_url":"https://codeload.github.com/ken107/janus-videoroom-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fjanus-videoroom-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30226246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T18:12:09.766Z","status":"ssl_error","status_checked_at":"2026-03-07T18:11:58.786Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["janus","janus-gateway","videoroom"],"created_at":"2024-10-11T05:13:26.952Z","updated_at":"2026-03-07T18:31:29.466Z","avatar_url":"https://github.com/ken107.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# janus-simple-videoroom-client\nBuilt on top of janus.js, this thin client library provides a simple high-level API that makes it easy to work with the Janus VideoRoom plugin.\n\n## Install\n`npm install janus-simple-videoroom-client`\n\n## Usage\n```javascript\nimport { createVideoRoomClient } from \"janus-simple-videoroom-client\"\n\nasync function joinRoom(server, roomId, displayName) {\n    const client = await createVideoRoomClient()\n    const session = await client.createSession(server)\n    const room = await session.joinRoom(roomId)\n\n    const pub = await room.publish({display: displayName})\n    pub.onTrackAdded(track =\u003e showVideo(track))\n    pub.onTrackRemoved(track =\u003e hideVideo(track))\n\n    const subs = {}\n    room.onPublisherAdded(publishers =\u003e publishers.forEach(subscribe))\n    room.onPublisherRemoved(unsubscribe)\n\n\n    async function subscribe(publisher) {\n        subs[publisher.id] = await room.subscribe([{feed: publisher.id}])\n        subs[publisher.id].onTrackAdded(track =\u003e showVideo(track))\n        subs[publisher.id].onTrackRemoved(track =\u003e hideVideo(track))\n    }\n    async function unsubscribe(publisherId) {\n        await subs[publisherId].unsubscribe()\n    }\n}\n```\n\n## Example\nCheck out the [example](https://ken107.github.io/janus-videoroom-js/example.html).\n\n## API\n\n### VideoRoomClient\n\n| Property | Description |\n| -------- | ----------- |\n| createSession(_server_, _options_) | Create a new VideoRoom session |\n\n### VideoRoomSession\n\n| Property | Description |\n| -------- | ----------- |\n| isValid() | Return whether the session is connected and valid |\n| joinRoom(_roomId_) | Joins a room, returns a VideoRoom object |\n| watch(_mountpointId_, _options_) | Subscribe to a streaming mountpoint, return a StreamingSubscriber object |\n| attachToPlugin() | Attach to the VideoRoom plugin without joining a room, returns a JanusPluginHandleEx object |\n| destroy() | Destroy the session |\n\n### VideoRoom\n\n| Property | Description |\n| -------- | ----------- |\n| pluginHandle | The JanusPluginHandleEx object associated with this room |\n| onPublisherAdded(_callback_) | Register a callback for when a publisher publishes media to the room |\n| onPublisherRemoved(_callback_) | Register a callback for when a publisher unpublishes |\n| publish(_options_) | Publish my webcam and return a VideoRoomPublisher object |\n| subscribe(_streams_, _options_) | Subscribe to the specified streams and return a VideoRoomSubscriber object |\n| leave() | Leave the room |\n\n### VideoRoomPublisher\n\n| Property | Description |\n| -------- | ----------- |\n| publisherId | |\n| onTrackAdded(_callback_) | Register a callback for when a local MediaStreamTrack is available to display |\n| onTrackRemoved(_callback_) | Register a callback for when a local MediaStreamTrack terminates |\n| configure(_options_) | Modify publisher properties |\n| restart(_options_) | Trigger an ICE restart |\n| unpublish() | Stop publishing |\n\n### VideoRoomSubscriber\n\n| Property | Description |\n| -------- | ----------- |\n| pluginHandle | The JanusPluginHandleEx object associated with this subscriber |\n| onTrackAdded(_callback_) | Register a callback for when a remote MediaStreamTrack is available to display |\n| onTrackRemoved(_callback_) | Register a callback for when a remote MediaStreamTrack terminates |\n| addStreams(_streams_) | Add additional streams to this (multi-stream) subscriber |\n| removeStreams(_streams_) | Remove streams from this subscriber |\n| pause() | Pause media delivery for this subscriber |\n| resume() | Resume media delivery |\n| configure(_options_) | Modify subscription properties |\n| restart(_options_) | Trigger an ICE restart |\n| unsubscribe() | Stop subscribing |\n\n### JanusPluginHandleEx\nThis object is the Janus plugin handle, but augmented with these convenient methods:\n\n| Property | Description |\n| -------- | ----------- |\n| eventTarget | Used to listen for events on the handle (e.g. consentDialog, webrtcState, slowLink, etc.) |\n| sendRequest(_message_) | Send a synchronous request to the plugin |\n| sendAsyncRequest(_message_, _jsep_?, _expectResponse_) | Send an asynchronous request to the plugin (_expectResponse_ is a function that will be passed a response and must return a boolean indicating whether it matches the request, e.g. a `{\"request\":\"start\"}` will expect a response like `{\"videoroom\":\"event\",\"started\":\"ok\"}`) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken107%2Fjanus-videoroom-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fken107%2Fjanus-videoroom-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken107%2Fjanus-videoroom-js/lists"}