Skip to content

Commit be4cbcf

Browse files
committed
Just some tweaks + updated dependencies
1 parent 46ec15d commit be4cbcf

File tree

8 files changed

+54
-48
lines changed

8 files changed

+54
-48
lines changed

.vitepress/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default {
141141
collapsible: true,
142142
items: [
143143
{
144-
text: 'Android 6+',
144+
text: 'Android 7+',
145145
link: '/guides/extra-steps/android'
146146
},
147147
{

.vitepress/theme/styles.css

+9-11
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,27 @@
33
* -------------------------------------------------------------------------- */
44

55
:root {
6-
--primary: #ed8a80; /* congo pink */
7-
--primary-content: #3C3C3B; /* charcoal */
8-
--neutral: #27464F; /* midnight green */
9-
--neutral-content: #EDEDED; /* cloud */
10-
--secondary: #EDEDED; /* charcoal */
11-
--secondary-content: #3C3C3B; /* cloud */
12-
--accent: #3C3C3B; /* charcoal */
13-
--accent-content: #EDEDED; /* cloud */
6+
/*
7+
--primary: #ed8a80;
8+
--primary-content: #3C3C3B;
9+
--neutral: #27464F;
10+
--neutral-content: #EDEDED;
11+
--secondary: #EDEDED;
12+
--secondary-content: #3C3C3B;
13+
--accent: #3C3C3B;
14+
--accent-content: #EDEDED;
1415
--btn-focus-scale: 1.05;
1516
1617
--vp-c-accent: rgb(218, 180, 11);
1718
18-
/*
1919
--vp-c-brand: var(--primary);
2020
--vp-c-brand-light: #FFA69D;
2121
--vp-c-brand-lighter: #FA978D;
2222
--vp-c-brand-dark: #e47f75;
2323
--vp-c-brand-darker: #db6d62;
24-
*/
2524
2625
--vp-code-block-bg: rgba(125, 125, 125, 0.04);
2726
28-
/*
2927
--vp-c-green-light: rgb(18, 181, 157);
3028
--vp-custom-block-tip-border: rgba(18, 181, 157, 0.5);
3129
--vp-custom-block-tip-bg: rgba(18, 181, 157, 0.1);

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"serve": "vitepress serve"
1010
},
1111
"devDependencies": {
12-
"vitepress": "1.0.0-alpha.71",
13-
"vue": "^3.2.47"
12+
"vitepress": "1.0.0-beta.5",
13+
"vue": "^3.3.4"
1414
}
1515
}

src/guides/basic-usage.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Most of the included functionality is similar to how you would deal with WebRTC
66

77
If you see functions that are listed in the document above but not listed below then they are likely not supported by this module yet and will most likely be supported in the near future, we're open to contributions.
88

9-
```javascript
9+
```typescript
1010
import {
1111
RTCIceCandidate,
1212
RTCPeerConnection,
@@ -31,7 +31,7 @@ Some devices might not have more than 1 camera. The following will allow you to
3131

3232
You can of-course use `enumerateDevices` to list other media device information too.
3333

34-
```javascript
34+
```typescript
3535
let cameraCount = 0;
3636

3737
try {
@@ -52,7 +52,7 @@ try {
5252
By default we're sending both audio and video.
5353
This will allow us to toggle the video stream during a call.
5454

55-
```javascript
55+
```typescript
5656
let mediaConstraints = {
5757
audio: true,
5858
video: {
@@ -71,7 +71,7 @@ Fill me in.
7171
If you only want a voice call then you can flip `isVoiceOnly` over to `true`.
7272
You can then cycle and enable or disable the video tracks on demand during a call.
7373

74-
```javascript
74+
```typescript
7575
let localMediaStream;
7676
let isVoiceOnly = false;
7777

@@ -95,7 +95,7 @@ This will allow capturing the device screen, requests permission on execution.
9595
Make sure to follow [these](/guides/extra-steps/android#screen-capture-support-android-10) extra steps for Android and [these](/guides/extra-steps/ios#screen-capture-support) for iOS.
9696
Otherwise you'll experience blank streams.
9797

98-
```javascript
98+
```typescript
9999
try {
100100
const mediaStream = await mediaDevices.getDisplayMedia();
101101

@@ -110,7 +110,7 @@ try {
110110
Cycling all of the tracks and stopping them is more than enough to clean up after a call has finished.
111111
You won't usually need to do this for remote tracks, only local.
112112

113-
```javascript
113+
```typescript
114114
localMediaStream.getTracks().map(
115115
track => track.stop()
116116
);
@@ -123,7 +123,7 @@ localMediaStream = null;
123123
We're only specifying a STUN server but you should also be using a TURN server.
124124
Check [this guide](/guides/improving-call-reliability) if you'd like some advice on how to improve call reliability.
125125

126-
```javascript
126+
```typescript
127127
let peerConstraints = {
128128
iceServers: [
129129
{
@@ -138,7 +138,7 @@ let peerConstraints = {
138138
Here we're creating a peer connection required to create a call.
139139
You can also overwrite hook functions instead of using event listeners.
140140

141-
```javascript
141+
```typescript
142142
let peerConnection = new RTCPeerConnection( peerConstraints );
143143
peerConnection.addEventListener( 'connectionstatechange', event => {} );
144144
peerConnection.addEventListener( 'icecandidate', event => {} );
@@ -156,7 +156,7 @@ peerConnection.addEventListener( 'removestream', event => {} );
156156
When ending a call you should always make sure to dispose of everything ready for another call.
157157
The following should dispose of everything.
158158

159-
```javascript
159+
```typescript
160160
peerConnection._unregisterEvents();
161161
peerConnection.close();
162162
peerConnection = null;
@@ -167,7 +167,7 @@ peerConnection = null;
167167
After using one of the media functions above you can then add the media stream to the peer.
168168
The negotiation needed event will be triggered on the peer afterwords.
169169

170-
```javascript
170+
```typescript
171171
peerConnection.addStream( localMediaStream );
172172
```
173173

@@ -176,7 +176,7 @@ peerConnection.addStream( localMediaStream );
176176
Usually the call initialiser would create the data channel but it can be done on both sides.
177177
The negotiation needed event will be triggered on the peer connection afterwords.
178178

179-
```javascript
179+
```typescript
180180
let datachannel = peerConnection.createDataChannel( 'my_channel' );
181181
datachannel.addEventListener( 'open', event => {} );
182182
datachannel.addEventListener( 'close', event => {} );
@@ -188,7 +188,7 @@ datachannel.addEventListener( 'message', message => {} );
188188
The following event is for the second client, not the client which created the data channel.
189189
Unless of-course you want both sides to create separate data channels.
190190

191-
```javascript
191+
```typescript
192192
peerConnection.addEventListener( 'datachannel', event => {
193193
let datachannel = event.channel;
194194

@@ -203,7 +203,7 @@ You can send a range of different data types over data channels, but for this ex
203203

204204
Bare in mind there are limits so sending large amounts of data isn't usually advised.
205205

206-
```javascript
206+
```typescript
207207
datachannel.send( 'Hey There!' );
208208
```
209209

@@ -213,7 +213,7 @@ When the peer connection is destroyed everything attached should also be destroy
213213

214214
But as good practice, you can always make sure they are closed.
215215

216-
```javascript
216+
```typescript
217217
datachannel.close();
218218
datachannel = null;
219219
```
@@ -224,7 +224,7 @@ As mentioned above we're going for the approach of offering both video and voice
224224

225225
That will allow you to enable and disable video streams while a call is active.
226226

227-
```javascript
227+
```typescript
228228
let sessionConstraints = {
229229
mandatory: {
230230
OfferToReceiveAudio: true,
@@ -241,7 +241,7 @@ Typically inside the `negotiationneeded` event.
241241

242242
ICE Candidate creation and gathering will start as soon as an offer has been created.
243243

244-
```javascript
244+
```typescript
245245
try {
246246
const offerDescription = await peerConnection.createOffer( sessionConstraints );
247247
await peerConnection.setLocalDescription( offerDescription );
@@ -257,7 +257,7 @@ try {
257257
All parties will need to ensure they are handling ICE Candidates correctly.
258258
Otherwise the offer and answer handshake stages will go a little wonky.
259259

260-
```javascript
260+
```typescript
261261
try {
262262
// Use the received offerDescription
263263
const offerDescription = new RTCSessionDescription( offerDescription );
@@ -278,7 +278,7 @@ During an active call you might want to mute your microphone.
278278
Easy to accomplish by flipping the track enabled value to `false`.
279279
Also possible on remote tracks.
280280

281-
```javascript
281+
```typescript
282282
let isMuted = false;
283283

284284
try {
@@ -296,7 +296,7 @@ try {
296296
Naturally we assume you'll be using the front camera by default when starting a call.
297297
So we set `isFrontCam` as `true` and let the value flip on execution.
298298

299-
```javascript
299+
```typescript
300300
let isFrontCam = true;
301301

302302
try {
@@ -317,7 +317,7 @@ try {
317317
Once you've gained a local and/or remote stream then rendering it is as follows.
318318
Don't forget, the user facing camera is usually mirrored.
319319

320-
```javascript
320+
```typescript
321321
<RTCView
322322
mirror={true}
323323
objectFit={'cover'}

src/guides/extra-steps/android.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Android 6+
1+
# Android 7+
22

33
Starting with React Native 0.60 due to a new auto linking feature you no longer need to follow manual linking steps but you will need to follow the other steps below if you plan on releasing your app to production.
44

@@ -68,7 +68,7 @@ You will be prompted for permissions automatically each time you want to start s
6868

6969
A notification channel is also required and created.
7070

71-
```javascript
71+
```typescript
7272
import notifee, { AndroidImportance } from '@notifee/react-native';
7373

7474
try {
@@ -97,7 +97,7 @@ Once screen capturing has finished you should then stop the foreground service.
9797
Usually you'd run a notification cancellation function but as there is a service involved.
9898
Instead you should run the following to get the job done.
9999

100-
```javascript
100+
```typescript
101101
try {
102102
await notifee.stopForegroundService();
103103
} catch( err ) {
@@ -108,7 +108,7 @@ try {
108108
Lastly you need to add this to your projects main `index.js` file.
109109
Otherwise you will receive an error relating to the service not being registered.
110110

111-
```javascript
111+
```typescript
112112
notifee.registerForegroundService( notification => {
113113
return new Promise( () => {
114114
// Handle Notification

src/guides/extra-steps/react-native-web.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ That will allow you to use ["almost"](https://github.com/react-native-webrtc/rea
66

77
## Registering Globals
88

9-
```javascript
9+
```typescript
1010
import { registerGlobals } from 'react-native-webrtc';
1111
```
1212

1313
You'll only really need to use this function if you are mixing project development with libraries that use browser based WebRTC functions. Also applies if you are making your project compatible with react-native-web.
1414

15-
```javascript
15+
```typescript
1616
registerGlobals();
1717
```
1818

1919
Here is a list of everything that will be linked up.
2020

21-
```javascript
21+
```typescript
2222
navigator.mediaDevices.getUserMedia();
2323
navigator.mediaDevices.getDisplayMedia();
2424
navigator.mediaDevices.enumerateDevices();

src/guides/getting-a-call-connected.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If you want to start the call as voice only then you can flip the boolean but th
2121
**Don't forget, you will be prompted to accept permissions for the camera and microphone.**
2222
**Usually it is better to request permissions at an earlier stage to improve the user experience.**
2323

24-
```javascript
24+
```typescript
2525
let mediaConstraints = {
2626
audio: true,
2727
video: {
@@ -63,7 +63,7 @@ In some instances you might find that the `negotiationneeded` event can fire mul
6363

6464
The `iceServers` below include one of Googles public STUN servers, you should also provide your own TURN server alongside a STUN server to ensure that connections can actually be established between callers.
6565

66-
```javascript
66+
```typescript
6767
let peerConstraints = {
6868
iceServers: [
6969
{
@@ -150,7 +150,7 @@ But do intend to provide an example app along with signalling app in the near fu
150150
We've added the media stream to the peer connection and got most of the basic events hooked up.
151151
You can now start creating an offer which then needs sending off to the other call participant.
152152

153-
```javascript
153+
```typescript
154154
let sessionConstraints = {
155155
mandatory: {
156156
OfferToReceiveAudio: true,
@@ -180,7 +180,7 @@ An easy solution is to hold onto some of the candidates and process them immedia
180180

181181
We will process any leftover candidates in the next step.
182182

183-
```javascript
183+
```typescript
184184
let remoteCandidates = [];
185185

186186
function handleRemoteCandidate( iceCandidate ) {
@@ -209,7 +209,7 @@ Set the offer as the remote description, create an answer and set the local desc
209209
You can now process any candidates if any got caught in-between the handshake process.
210210
Lastly you need to send the answer back to the caller who gave the offer.
211211

212-
```javascript
212+
```typescript
213213
try {
214214
// Use the received offerDescription
215215
const offerDescription = new RTCSessionDescription( offerDescription );
@@ -235,7 +235,7 @@ Then the waiting game begins and the connection is a success or a failure.
235235
Hopefully the whole process wasn't too complex to understand.
236236
But it definitely can get more complex when involving more participants.
237237

238-
```javascript
238+
```typescript
239239
try {
240240
// Use the received answerDescription
241241
const answerDescription = new RTCSessionDescription( answerDescription );

src/guides/misc/faqs.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
# Frequently Asked Questions
22

3-
To be filled in soon.
3+
To be filled in soon.
4+
Just some notes so far.
5+
6+
## Screen Capture
7+
**Why can't i see my own stream?**
8+
9+
If you are trying to display your own screen capture then the chances are you won't see anything.
10+
That is an artificial limitation in place which prevents the infinite mirror effect.
11+
The screen capture should display correctly for whoever you are streaming to.

0 commit comments

Comments
 (0)