Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 19 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,33 @@
[![Build Status](https://img.shields.io/github/actions/workflow/status/devopvoid/webrtc-java/build.yml?label=Build&logo=github)](https://github.com/devopvoid/webrtc-java/actions)
[![Maven Central](https://img.shields.io/maven-central/v/dev.onvoid.webrtc/webrtc-java?label=Maven%20Central&logo=apache-maven)](https://search.maven.org/artifact/dev.onvoid.webrtc/webrtc-java)

## webrtc-java
# webrtc-java

Java native interface implementation based on the free, open [WebRTC](https://webrtc.org) project. The goal of this project is to enable development of RTC applications for desktop platforms running Java. This project wraps the [WebRTC Native API](https://webrtc.github.io/webrtc-org/native-code/native-apis) and is similar to the [JS API](https://w3c.github.io/webrtc-pc).
webrtc-java is a Java wrapper for the [WebRTC Native API](https://webrtc.github.io/webrtc-org/native-code/native-apis), providing similar functionality to the [W3C JavaScript API](https://w3c.github.io/webrtc-pc). It allows Java developers to build real-time communication applications for desktop platforms without having to work directly with native code.

### Maven
The library provides a comprehensive set of Java classes that map to the WebRTC C++ API, making it possible to establish peer-to-peer connections, transmit audio and video, share screens, and exchange arbitrary data between applications.

```xml
<dependency>
<groupId>dev.onvoid.webrtc</groupId>
<artifactId>webrtc-java</artifactId>
<version>0.12.0</version>
</dependency>
```
## Features

### Gradle
- **Complete WebRTC API implementation** - Includes peer connections, media devices, data channels, and more
- **Cross-platform support** - Works on Windows, macOS, and Linux (x64, ARM, ARM64)
- **Media capabilities** - Audio and video capture from cameras and microphones
- **Desktop capture** - Screen and application window sharing
- **Data channels** - Bidirectional peer-to-peer data exchange
- **Statistics API** - Detailed metrics for monitoring connection quality
- **Simple integration** - Available as a Maven dependency
- **Native performance** - Thin JNI layer with minimal overhead

```groovy
implementation "dev.onvoid.webrtc:webrtc-java:0.12.0"
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "windows-x86_64"
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "macos-x86_64"
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "macos-aarch64"
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-x86_64"
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-aarch64"
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-aarch32"
```
## Getting Started

### Supported Platforms
Maven Central artifacts contain native libraries that can be loaded on the following platforms:
For more detailed examples and guides, check out the [quickstart guide](quickstart.md) and the specific examples in the project repository.

<table>
<tr>
<td></td>
<td>x64</td>
<td>arm</td>
<td>arm64</td>
</tr>
<tr align="center">
<th>Linux</th>
<td>✔</td>
<td>✔ armeabi-v7a</td>
<td>✔ arm64-v8a</td>
</tr>
<tr align="center">
<th>macOS</th>
<td>✔</td>
<td>-</td>
<td>✔</td>
</tr>
<tr align="center">
<th>Windows</th>
<td>✔</td>
<td>-</td>
<td>-</td>
</tr>
</table>
## License

The native libraries were built using the m138 (7204) WebRTC branch as the stable release, dated June 24, 2025.
### Build Notes
Copyright (c) 2019 Alex Andres

To build the native code, be sure to install the prerequisite software (follow the links):
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

**Note**: You don't have to install the Depot Tools, the build script will do that for you.
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

<table>
<tr>
<td>Linux</td>
<td><a href="https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md#system-requirements">Ubuntu</a>, <a href="https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md#Notes-for-other-distros">other distros</a></td>
</tr>
<tr>
<td>macOS</td>
<td>Xcode 9 or higher</td>
</tr>
<tr>
<td>Windows</td>
<td><a href="https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#visual-studio">Visual Studio</a></td>
</tr>
</table>

Assuming you have all the prerequisites installed for your OS, run:

```
mvn install
```

On the first run, the WebRTC source tree will be loaded into the `/<user home>/webrtc` directory. This will take a while and require about 20 GB of disk space.

#### Build Parameters

| Parameter | Description | Default Value |
| ------------------ | ------------------------------------------------------ |-----------------------------|
| webrtc.branch | The WebRTC branch to checkout. | branch-heads/7204 |
| webrtc.src.dir | The absolute checkout path for the WebRTC source tree. | /\<user_home\>/webrtc |
| webrtc.install.dir | The install path for the compiled WebRTC library. Is also used to link against a pre-compiled WebRTC library to reduce build time. | /\<user_home\>/webrtc/build |
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Empty file added docs/.nojekyll
Empty file.
38 changes: 38 additions & 0 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# webrtc-java

> Connecting the Java world through WebRTC

<ul class="features-list">
<li class="feature-list-item">
<i class="material-icons feature-icon">devices</i>
<span class="feature-text">Cross-platform (Windows, macOS, Linux)</span>
</li>
<li class="feature-list-item">
<i class="material-icons feature-icon">connect_without_contact</i>
<span class="feature-text">Peer-to-peer communication</span>
</li>
<li class="feature-list-item">
<i class="material-icons feature-icon">videocam</i>
<span class="feature-text">Audio and video streaming</span>
</li>
<li class="feature-list-item">
<i class="material-icons feature-icon">screen_share</i>
<span class="feature-text">Screen Sharing</span>
</li>
<li class="feature-list-item">
<i class="material-icons feature-icon">swap_calls</i>
<span class="feature-text">Data Channels</span>
</li>
<li class="feature-list-item">
<i class="material-icons feature-icon">bar_chart</i>
<span class="feature-text">Statistics API for monitoring</span>
</li>
</ul>

<div class="buttons">
<a href="https://github.com/devopvoid/webrtc-java" target="_blank"><span>GitHub</span></a>
<a href="#/README"><span>Get Started</span></a>
</div>

<!-- Background color -->
![color](#ffffff)
18 changes: 18 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- Getting started
- [Overview](README.md)
- [Quick start](quickstart.md)
- [Examples](examples.md)

- Guide
- [Overview](guide/overview.md)
- [Media Devices](guide/media_devices.md)
- [Audio Device Selection](guide/audio_devices.md)
- [Audio Processing](guide/audio_processing.md)
- [Bitrate and Framerate Constraints](guide/constraints.md)
- [Desktop Capture](guide/desktop_capture.md)
- [Data Channels](guide/data_channels.md)
- [RTC Stats](guide/rtc_stats.md)
- [Logging](guide/logging.md)

- [**Build Notes**](build.md)
- [**Changelog**](changelog.md)
139 changes: 139 additions & 0 deletions docs/assets/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
:root {
--theme-color: #6366f1;
}

/* Custom button styles for coverpage */
.cover .buttons {
margin-top: 40px;
display: flex;
justify-content: center;
gap: 20px;
flex-wrap: wrap; /* Ensure buttons wrap on small screens */
}

.cover .buttons a {
display: inline-block;
padding: 10px 20px;
font-size: 1rem;
font-weight: 500;
text-decoration: none;
border-radius: 4px;
transition: all 0.2s ease;
margin: 5px; /* Add margin for when buttons wrap */
background-color: transparent; /* Outlined button */
color: var(--theme-color); /* Text color matches border for outlined style */
border: 1px solid var(--theme-color);
}

.cover .buttons a:hover {
background-color: rgba(99, 102, 241, 0.1); /* Light background on hover */
border-color: #5253d4;
color: #5253d4;
}

.cover .buttons a:active {
background-color: rgba(99, 102, 241, 0.2); /* Slightly darker background when active */
border-color: #4338ca;
color: #4338ca;
}

.cover .buttons a span {
display: inline-block; /* Ensure the span behaves properly */
}

/* Feature list styles */
.cover .features-list {
list-style-type: none;
padding: 0;
margin: 30px auto;
max-width: 700px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 6px;
}

.cover .feature-list-item {
display: flex;
align-items: center;
margin: 0;
padding: 8px 12px;
}

.cover .feature-icon {
margin-right: 15px;
font-size: 28px;
color: var(--theme-color);
flex-shrink: 0;
}

.cover .feature-text {
font-size: 16px;
line-height: 1.4;
margin: 0;
}

/* Media queries for responsive design */
@media screen and (max-width: 768px) {
.cover .buttons {
gap: 15px;
}

.cover .buttons a {
padding: 9px 18px;
font-size: 0.95rem;
}

.cover .features-list {
max-width: 90%;
grid-gap: 5px;
grid-template-columns: repeat(2, 1fr);
}

.cover .feature-list-item {
padding: 6px 10px;
}

.cover .feature-icon {
font-size: 24px;
margin-right: 10px;
}

.cover .feature-text {
font-size: 15px;
}
}

@media screen and (max-width: 480px) {
.cover .buttons {
flex-direction: column;
align-items: center;
gap: 12px;
}

.cover .buttons a {
padding: 8px 16px;
font-size: 0.9rem;
width: 80%;
max-width: 200px;
text-align: center;
}

.cover .features-list {
max-width: 95%;
grid-gap: 4px;
grid-template-columns: 1fr;
}

.cover .feature-list-item {
padding: 5px 8px;
}

.cover .feature-icon {
font-size: 20px;
margin-right: 8px;
}

.cover .feature-text {
font-size: 14px;
}
}
4 changes: 4 additions & 0 deletions docs/assets/versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
window.PROJECT_VARS = {
VERSION: '0.12.0',
VERSION_SNAPSHOT: '0.13.0-SNAPSHOT'
};
36 changes: 36 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Build Notes

To build the native code, be sure to install the prerequisite software (follow the links):

**Note**: You don't have to install the Depot Tools, the build script will do that for you.

<table>
<tr>
<td>Linux</td>
<td><a href="https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md#system-requirements">Ubuntu</a>, <a href="https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md#Notes-for-other-distros">other distros</a></td>
</tr>
<tr>
<td>macOS</td>
<td>Xcode 9 or higher</td>
</tr>
<tr>
<td>Windows</td>
<td><a href="https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#visual-studio">Visual Studio</a></td>
</tr>
</table>

Assuming you have all the prerequisites installed for your OS, run:

```shell
mvn install
```

On the first run, the WebRTC source tree will be loaded into the `/<user home>/webrtc` directory. This will take a while and require about 20 GB of disk space.

## Build Parameters

| Parameter | Description | Default Value |
| ------------------ | ------------------------------------------------------ |-----------------------------|
| webrtc.branch | The WebRTC branch to checkout. | branch-heads/7204 |
| webrtc.src.dir | The absolute checkout path for the WebRTC source tree. | /\<user_home\>/webrtc |
| webrtc.install.dir | The install path for the compiled WebRTC library. Is also used to link against a pre-compiled WebRTC library to reduce build time. | /\<user_home\>/webrtc/build |
Loading