Skip to content

Commit 21a8c2f

Browse files
committed
Reformat Code in Readme text
1 parent df302f9 commit 21a8c2f

1 file changed

Lines changed: 22 additions & 37 deletions

File tree

README.md

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -479,15 +479,12 @@ function createMediaElements(pipeline, ws, callback) {
479479

480480
```javascript
481481
function connectMediaElements(webRtcEndpoint, callback) {
482-
webRtcEndpoint.connect(
483-
webRtcEndpoint,
484-
error => {
485-
if (error) {
486-
return callback(error);
487-
}
488-
return callback(null);
482+
webRtcEndpoint.connect(webRtcEndpoint, error => {
483+
if (error) {
484+
return callback(error);
489485
}
490-
);
486+
return callback(null);
487+
});
491488
}
492489
```
493490

@@ -667,24 +664,18 @@ function createMediaElements(pipeline, ws, callback) {
667664

668665
```javascript
669666
function connectMediaElements(webRtcEndpoint, faceOverlayFilter, callback) {
670-
webRtcEndpoint.connect(
671-
faceOverlayFilter,
672-
error => {
667+
webRtcEndpoint.connect(faceOverlayFilter, error => {
668+
if (error) {
669+
return callback(error);
670+
}
671+
faceOverlayFilter.connect(webRtcEndpoint, error => {
673672
if (error) {
674673
return callback(error);
675674
}
676-
faceOverlayFilter.connect(
677-
webRtcEndpoint,
678-
error => {
679-
if (error) {
680-
return callback(error);
681-
}
682675
683-
return callback(null);
684-
}
685-
);
686-
}
687-
);
676+
return callback(null);
677+
});
678+
});
688679
}
689680
```
690681

@@ -815,25 +806,19 @@ function createMediaElements(pipeline, ws, callback) {
815806

816807
```javascript
817808
function connectMediaElements(webRtcEndpoint, filter, callback) {
818-
webRtcEndpoint.connect(
819-
filter,
820-
error => {
809+
webRtcEndpoint.connect(filter, error => {
810+
if (error) {
811+
return callback(error);
812+
}
813+
814+
filter.connect(webRtcEndpoint, error => {
821815
if (error) {
822816
return callback(error);
823817
}
824818

825-
filter.connect(
826-
webRtcEndpoint,
827-
error => {
828-
if (error) {
829-
return callback(error);
830-
}
831-
832-
return callback(null);
833-
}
834-
);
835-
}
836-
);
819+
return callback(null);
820+
});
821+
});
837822
}
838823
```
839824

0 commit comments

Comments
 (0)