Skip to content

Commit 8499779

Browse files
authored
docs: comprehensive guide and examples (#182)
* docs: add WebRTC Java examples * docs: add guides for media devices and bitrate/framerate constraints * docs: add comprehensive documentation and guides * docs: add guide for working with media devices in WebRTC * docs: add audio processing guide and update sidebar * docs: enhance audio processing documentation with usage approaches * docs: update cover page and sidebar, add examples documentation * docs: update examples instructions for running the examples * docs: update versioning in examples and add dynamic version handling
1 parent 68dbfa4 commit 8499779

27 files changed

+3507
-85
lines changed

README.md

Lines changed: 19 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,33 @@
11
[![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)
22
[![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)
33

4-
## webrtc-java
4+
# webrtc-java
55

6-
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).
6+
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.
77

8-
### Maven
8+
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.
99

10-
```xml
11-
<dependency>
12-
<groupId>dev.onvoid.webrtc</groupId>
13-
<artifactId>webrtc-java</artifactId>
14-
<version>0.12.0</version>
15-
</dependency>
16-
```
10+
## Features
1711

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

20-
```groovy
21-
implementation "dev.onvoid.webrtc:webrtc-java:0.12.0"
22-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "windows-x86_64"
23-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "macos-x86_64"
24-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "macos-aarch64"
25-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-x86_64"
26-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-aarch64"
27-
implementation group: "dev.onvoid.webrtc", name: "webrtc-java", version: "0.12.0", classifier: "linux-aarch32"
28-
```
21+
## Getting Started
2922

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

33-
<table>
34-
<tr>
35-
<td></td>
36-
<td>x64</td>
37-
<td>arm</td>
38-
<td>arm64</td>
39-
</tr>
40-
<tr align="center">
41-
<th>Linux</th>
42-
<td>✔</td>
43-
<td>✔ armeabi-v7a</td>
44-
<td>✔ arm64-v8a</td>
45-
</tr>
46-
<tr align="center">
47-
<th>macOS</th>
48-
<td>✔</td>
49-
<td>-</td>
50-
<td>✔</td>
51-
</tr>
52-
<tr align="center">
53-
<th>Windows</th>
54-
<td>✔</td>
55-
<td>-</td>
56-
<td>-</td>
57-
</tr>
58-
</table>
25+
## License
5926

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

63-
To build the native code, be sure to install the prerequisite software (follow the links):
29+
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
6430

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

67-
<table>
68-
<tr>
69-
<td>Linux</td>
70-
<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>
71-
</tr>
72-
<tr>
73-
<td>macOS</td>
74-
<td>Xcode 9 or higher</td>
75-
</tr>
76-
<tr>
77-
<td>Windows</td>
78-
<td><a href="https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#visual-studio">Visual Studio</a></td>
79-
</tr>
80-
</table>
81-
82-
Assuming you have all the prerequisites installed for your OS, run:
83-
84-
```
85-
mvn install
86-
```
87-
88-
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.
89-
90-
#### Build Parameters
91-
92-
| Parameter | Description | Default Value |
93-
| ------------------ | ------------------------------------------------------ |-----------------------------|
94-
| webrtc.branch | The WebRTC branch to checkout. | branch-heads/7204 |
95-
| webrtc.src.dir | The absolute checkout path for the WebRTC source tree. | /\<user_home\>/webrtc |
96-
| 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 |
33+
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.

docs/.nojekyll

Whitespace-only changes.

docs/_coverpage.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# webrtc-java
2+
3+
> Connecting the Java world through WebRTC
4+
5+
<ul class="features-list">
6+
<li class="feature-list-item">
7+
<i class="material-icons feature-icon">devices</i>
8+
<span class="feature-text">Cross-platform (Windows, macOS, Linux)</span>
9+
</li>
10+
<li class="feature-list-item">
11+
<i class="material-icons feature-icon">connect_without_contact</i>
12+
<span class="feature-text">Peer-to-peer communication</span>
13+
</li>
14+
<li class="feature-list-item">
15+
<i class="material-icons feature-icon">videocam</i>
16+
<span class="feature-text">Audio and video streaming</span>
17+
</li>
18+
<li class="feature-list-item">
19+
<i class="material-icons feature-icon">screen_share</i>
20+
<span class="feature-text">Screen Sharing</span>
21+
</li>
22+
<li class="feature-list-item">
23+
<i class="material-icons feature-icon">swap_calls</i>
24+
<span class="feature-text">Data Channels</span>
25+
</li>
26+
<li class="feature-list-item">
27+
<i class="material-icons feature-icon">bar_chart</i>
28+
<span class="feature-text">Statistics API for monitoring</span>
29+
</li>
30+
</ul>
31+
32+
<div class="buttons">
33+
<a href="https://github.com/devopvoid/webrtc-java" target="_blank"><span>GitHub</span></a>
34+
<a href="#/README"><span>Get Started</span></a>
35+
</div>
36+
37+
<!-- Background color -->
38+
![color](#ffffff)

docs/_sidebar.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
- Getting started
2+
- [Overview](README.md)
3+
- [Quick start](quickstart.md)
4+
- [Examples](examples.md)
5+
6+
- Guide
7+
- [Overview](guide/overview.md)
8+
- [Media Devices](guide/media_devices.md)
9+
- [Audio Device Selection](guide/audio_devices.md)
10+
- [Audio Processing](guide/audio_processing.md)
11+
- [Bitrate and Framerate Constraints](guide/constraints.md)
12+
- [Desktop Capture](guide/desktop_capture.md)
13+
- [Data Channels](guide/data_channels.md)
14+
- [RTC Stats](guide/rtc_stats.md)
15+
- [Logging](guide/logging.md)
16+
17+
- [**Build Notes**](build.md)
18+
- [**Changelog**](changelog.md)

docs/assets/styles.css

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
:root {
2+
--theme-color: #6366f1;
3+
}
4+
5+
/* Custom button styles for coverpage */
6+
.cover .buttons {
7+
margin-top: 40px;
8+
display: flex;
9+
justify-content: center;
10+
gap: 20px;
11+
flex-wrap: wrap; /* Ensure buttons wrap on small screens */
12+
}
13+
14+
.cover .buttons a {
15+
display: inline-block;
16+
padding: 10px 20px;
17+
font-size: 1rem;
18+
font-weight: 500;
19+
text-decoration: none;
20+
border-radius: 4px;
21+
transition: all 0.2s ease;
22+
margin: 5px; /* Add margin for when buttons wrap */
23+
background-color: transparent; /* Outlined button */
24+
color: var(--theme-color); /* Text color matches border for outlined style */
25+
border: 1px solid var(--theme-color);
26+
}
27+
28+
.cover .buttons a:hover {
29+
background-color: rgba(99, 102, 241, 0.1); /* Light background on hover */
30+
border-color: #5253d4;
31+
color: #5253d4;
32+
}
33+
34+
.cover .buttons a:active {
35+
background-color: rgba(99, 102, 241, 0.2); /* Slightly darker background when active */
36+
border-color: #4338ca;
37+
color: #4338ca;
38+
}
39+
40+
.cover .buttons a span {
41+
display: inline-block; /* Ensure the span behaves properly */
42+
}
43+
44+
/* Feature list styles */
45+
.cover .features-list {
46+
list-style-type: none;
47+
padding: 0;
48+
margin: 30px auto;
49+
max-width: 700px;
50+
display: grid;
51+
grid-template-columns: repeat(2, 1fr);
52+
grid-gap: 6px;
53+
}
54+
55+
.cover .feature-list-item {
56+
display: flex;
57+
align-items: center;
58+
margin: 0;
59+
padding: 8px 12px;
60+
}
61+
62+
.cover .feature-icon {
63+
margin-right: 15px;
64+
font-size: 28px;
65+
color: var(--theme-color);
66+
flex-shrink: 0;
67+
}
68+
69+
.cover .feature-text {
70+
font-size: 16px;
71+
line-height: 1.4;
72+
margin: 0;
73+
}
74+
75+
/* Media queries for responsive design */
76+
@media screen and (max-width: 768px) {
77+
.cover .buttons {
78+
gap: 15px;
79+
}
80+
81+
.cover .buttons a {
82+
padding: 9px 18px;
83+
font-size: 0.95rem;
84+
}
85+
86+
.cover .features-list {
87+
max-width: 90%;
88+
grid-gap: 5px;
89+
grid-template-columns: repeat(2, 1fr);
90+
}
91+
92+
.cover .feature-list-item {
93+
padding: 6px 10px;
94+
}
95+
96+
.cover .feature-icon {
97+
font-size: 24px;
98+
margin-right: 10px;
99+
}
100+
101+
.cover .feature-text {
102+
font-size: 15px;
103+
}
104+
}
105+
106+
@media screen and (max-width: 480px) {
107+
.cover .buttons {
108+
flex-direction: column;
109+
align-items: center;
110+
gap: 12px;
111+
}
112+
113+
.cover .buttons a {
114+
padding: 8px 16px;
115+
font-size: 0.9rem;
116+
width: 80%;
117+
max-width: 200px;
118+
text-align: center;
119+
}
120+
121+
.cover .features-list {
122+
max-width: 95%;
123+
grid-gap: 4px;
124+
grid-template-columns: 1fr;
125+
}
126+
127+
.cover .feature-list-item {
128+
padding: 5px 8px;
129+
}
130+
131+
.cover .feature-icon {
132+
font-size: 20px;
133+
margin-right: 8px;
134+
}
135+
136+
.cover .feature-text {
137+
font-size: 14px;
138+
}
139+
}

docs/assets/versions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
window.PROJECT_VARS = {
2+
VERSION: '0.12.0',
3+
VERSION_SNAPSHOT: '0.13.0-SNAPSHOT'
4+
};

docs/build.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Build Notes
2+
3+
To build the native code, be sure to install the prerequisite software (follow the links):
4+
5+
**Note**: You don't have to install the Depot Tools, the build script will do that for you.
6+
7+
<table>
8+
<tr>
9+
<td>Linux</td>
10+
<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>
11+
</tr>
12+
<tr>
13+
<td>macOS</td>
14+
<td>Xcode 9 or higher</td>
15+
</tr>
16+
<tr>
17+
<td>Windows</td>
18+
<td><a href="https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#visual-studio">Visual Studio</a></td>
19+
</tr>
20+
</table>
21+
22+
Assuming you have all the prerequisites installed for your OS, run:
23+
24+
```shell
25+
mvn install
26+
```
27+
28+
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.
29+
30+
## Build Parameters
31+
32+
| Parameter | Description | Default Value |
33+
| ------------------ | ------------------------------------------------------ |-----------------------------|
34+
| webrtc.branch | The WebRTC branch to checkout. | branch-heads/7204 |
35+
| webrtc.src.dir | The absolute checkout path for the WebRTC source tree. | /\<user_home\>/webrtc |
36+
| 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 |

0 commit comments

Comments
 (0)