{"id":18554635,"url":"https://github.com/vudangngoc/janus-java-client","last_synced_at":"2026-03-11T01:02:04.718Z","repository":{"id":182004652,"uuid":"644717302","full_name":"vudangngoc/janus-java-client","owner":"vudangngoc","description":"A Java library of Janus WebRTC Server","archived":false,"fork":false,"pushed_at":"2024-10-02T06:46:24.000Z","size":69,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-29T08:38:09.277Z","etag":null,"topics":["java","webrtc","webrtc-demos","webrtc-signaling"],"latest_commit_sha":null,"homepage":"","language":"Java","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/vudangngoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-05-24T05:40:52.000Z","updated_at":"2025-08-05T12:56:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a4d6f4c-590b-40d9-b01b-a3c9887e7cbe","html_url":"https://github.com/vudangngoc/janus-java-client","commit_stats":null,"previous_names":["vudangngoc/janus-java-client"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vudangngoc/janus-java-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vudangngoc%2Fjanus-java-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vudangngoc%2Fjanus-java-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vudangngoc%2Fjanus-java-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vudangngoc%2Fjanus-java-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vudangngoc","download_url":"https://codeload.github.com/vudangngoc/janus-java-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vudangngoc%2Fjanus-java-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30364607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["java","webrtc","webrtc-demos","webrtc-signaling"],"created_at":"2024-11-06T21:23:04.532Z","updated_at":"2026-03-11T01:02:04.689Z","avatar_url":"https://github.com/vudangngoc.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# janus-java-client\nThis library provide a Java client to manage Janus gateway WebRTC. Working features:\n+ Start a live stream to Janus server\n+ Subscribe a live stream from Janus server\n+ Handle some events from Janus then forward to clients\n+ Support Video room plugin: create/join/leave/delete a video room. Other features of Video room plugin will be supported soon.\n\nEverything is early state, feel free to contribute and request features!\n# Signaling server\nJanus server and client need to exchange connection information, there is a working example in the /signaling folder (include frontend with jQuery, backend with Java support websocket and signaling process)\n\n# JanusClient\nJanusClient take care about how to interactive with Janus server: create Janus session, attach to plugin, send message to Janus\n+ public JanusClient(MessageCallback messageCallback, String address): Constructor of class\n  + messageCallback: There are some Janus's messages don't have transactionId then Janus client cannot find\n      a handler to process. Those messages will forward to user's context\n  + address: URL of Janus's websocket, if the URL doesn't start with \"ws\" nor \"wss\", a \"ws://\" will be appended at start of the URL\n+ public boolean connect(): Connect Janus client to Janus server, \n  + return true if connect successful \n+ public Long createSession(): Create a Janus session, this function should be called after the method connect() is success\n  + return a sessionId in Long\n+ public long attachToPlugin(Long sessionId, String pluginName, JSONObject data): Attach to any plugin of Janus server\n  + sessionId: Janus session ID of user\n  + pluginName: plugin will handle the command\n  + data: data of command\n  + return handleId of user in context of the plugin\n+ public void sendToSession(String transactionId, Long sessionId, JSONObject data, JanusTransactionAbstractHandler handler): Send a command/event to a plugin\n  + transactionId: a random string that the client can use to match response messages from the Janus server.\n  + sessionId: Janus session ID of user\n  + data: information about the command\n  + handler: object will process returned message\n+ public long destroySession(Long sessionId): Kill an exists Janus session\n  + sessionId: Janus session ID of user\n# VideoRoomAdaptor\nVideoRoomAdaptor provide APIs to work with Video Room plugin: create/join/leave/delete a video room. Most of methods require\n+ sessionId: Janus sessionId of user \n+ handleId:  Unique Id of user in the context of plugin, created when user attach to plugin\nAll APIs:\n+ public Long attachToVideoRoom(Long sessionId): Create a handleId for interacting with Videoroom plugin\n    + sessionId: Janus session ID of user\n    + return a handleId in Long for future interaction\n+ public long createRoom(Long sessionId, Long handleId):\n  + return a unique room name that has just created\n+ public JSONObject getAllRooms(Long sessionId, Long handleId):\n  + return A JSON represent all rooms with detail information\n+ public JSONObject publisherJoinRoom(Long sessionId, Long handleId, long roomName, String displayName): \"publishers are those participant handles that are able (although may choose not to, more on this later) publish media in the room\"\n  + roomName: unique room name in long\n  + displayName: a name for display in VideoRoom, can be duplicated\n  + return Information about the room\n+ public String startLive(Long sessionId, Long handleId, String sdp)\n  + spd: SDP offer describe connection info, to start handshake process\n  + return SDP answer from Janus server\n+ public void sendConnectionInfo(Long sessionId, Long handleId, JSONObject candidate): Client send ICE candidates to Janus server. A RTCConnection can have multiple candidate, then call this method multiple times.\n  + candidate: information about a candidate\n+ public void sendCompleteIceGathering(Long sessionId, Long handleId): Client notice that they send all candidates, signaling server will send a special event to tell Janus server.\n+ public JSONObject subscriberJoinRoom(Long sessionId, Long handleId, long roomName, String displayName, long[] feederIds, Long privateId): \"subscribers are NOT participants, but simply handles that will be used exclusively to receive media from one or more publishers in the room\"\n  + roomName: Unique room name to join\n  + displayName: A name to show to other participants in the room\n  + feederIds: List of streams to subscribe, Janus support to subscribe multiple stream, but currently, the library support only one\n  + return A SDP offer from Janus, clients have to process this message then return a SDP answer with the next method\n+ public String sendViewerSDPAnswer(Long sessionId, Long handleId, String sdp, Long roomId): After receive SDP offer from Janus, subscriber has to process and return a SDP answer\n  + sdp: SDP answer\n  + roomId: Unique room name to join\n  + return output of subscriber join\n+ public JSONObject stopPublishStream(Long sessionId, Long handleId): stop publish a stream\n  + return output of action\n+ public void leaveRoom(Long sessionId, Long handleId): a publisher/subscriber left room and stop publish/subscribe a stream\n+ public void destroyRoom(Long sessionId, Long roomId, Long handleId): delete a room\n  + roomId: unique room name to destroy\n# Examples\n```java\npublic class TestMainFlow {\n    @Test\n    public void testVideoRoom() {\n        VideoRoomAdaptor videoRoomAdaptor = new VideoRoomAdaptor(client);\n        Long sessionId = client.createSession();\n        Long handleId = videoRoomAdaptor.attachToVideoRoom(sessionId);\n        System.out.printf(videoRoomAdaptor.getAllRooms(sessionId, handleId).toString());\n        videoRoomAdaptor.publisherJoinRoom(sessionId, handleId, 1234, \"janus-java-client\");\n        videoRoomAdaptor.leaveRoom(sessionId, handleId);\n    }\n}\n```\nPlease refer to file TestMainFlow and folder /signaling for detail information","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvudangngoc%2Fjanus-java-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvudangngoc%2Fjanus-java-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvudangngoc%2Fjanus-java-client/lists"}