|
4 | 4 | [](https://opensource.org/licenses/MIT) |
5 | 5 | [](http://doc-kurento.readthedocs.io/) |
6 | 6 | [](https://stackoverflow.com/questions/tagged/fiware) |
7 | | -<br/> |
8 | | -[](https://fiware-tutorials.rtfd.io) |
| 7 | +<br/> [](https://fiware-tutorials.rtfd.io) |
9 | 8 |
|
10 | 9 | <!-- prettier-ignore --> |
11 | 10 |
|
@@ -576,15 +575,12 @@ function createMediaElements(pipeline, ws, callback) { |
576 | 575 |
|
577 | 576 | ```javascript |
578 | 577 | function connectMediaElements(webRtcEndpoint, callback) { |
579 | | - webRtcEndpoint.connect( |
580 | | - webRtcEndpoint, |
581 | | - error => { |
582 | | - if (error) { |
583 | | - return callback(error); |
584 | | - } |
585 | | - return callback(null); |
| 578 | + webRtcEndpoint.connect(webRtcEndpoint, error => { |
| 579 | + if (error) { |
| 580 | + return callback(error); |
586 | 581 | } |
587 | | - ); |
| 582 | + return callback(null); |
| 583 | + }); |
588 | 584 | } |
589 | 585 | ``` |
590 | 586 |
|
@@ -638,9 +634,7 @@ function start() { |
638 | 634 | onicecandidate: onIceCandidate |
639 | 635 | }; |
640 | 636 |
|
641 | | - webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function( |
642 | | - error |
643 | | - ) { |
| 637 | + webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error) { |
644 | 638 | if (error) return onError(error); |
645 | 639 | this.generateOffer(onOffer); |
646 | 640 | }); |
@@ -791,24 +785,18 @@ function createMediaElements(pipeline, ws, callback) { |
791 | 785 |
|
792 | 786 | ```javascript |
793 | 787 | function connectMediaElements(webRtcEndpoint, faceOverlayFilter, callback) { |
794 | | - webRtcEndpoint.connect( |
795 | | - faceOverlayFilter, |
796 | | - error => { |
| 788 | + webRtcEndpoint.connect(faceOverlayFilter, error => { |
| 789 | + if (error) { |
| 790 | + return callback(error); |
| 791 | + } |
| 792 | + faceOverlayFilter.connect(webRtcEndpoint, error => { |
797 | 793 | if (error) { |
798 | 794 | return callback(error); |
799 | 795 | } |
800 | | - faceOverlayFilter.connect( |
801 | | - webRtcEndpoint, |
802 | | - error => { |
803 | | - if (error) { |
804 | | - return callback(error); |
805 | | - } |
806 | 796 |
|
807 | | - return callback(null); |
808 | | - } |
809 | | - ); |
810 | | - } |
811 | | - ); |
| 797 | + return callback(null); |
| 798 | + }); |
| 799 | + }); |
812 | 800 | } |
813 | 801 | ``` |
814 | 802 |
|
@@ -952,41 +940,32 @@ function createMediaElements(pipeline, ws, callback) { |
952 | 940 | return callback(error); |
953 | 941 | } |
954 | 942 |
|
955 | | - pipeline.create( |
956 | | - "platedetector.PlateDetectorFilter", |
957 | | - (error, filter) => { |
958 | | - if (error) { |
959 | | - return callback(error); |
960 | | - } |
961 | | - |
962 | | - return callback(null, webRtcEndpoint, filter); |
| 943 | + pipeline.create("platedetector.PlateDetectorFilter", (error, filter) => { |
| 944 | + if (error) { |
| 945 | + return callback(error); |
963 | 946 | } |
964 | | - ); |
| 947 | + |
| 948 | + return callback(null, webRtcEndpoint, filter); |
| 949 | + }); |
965 | 950 | }); |
966 | 951 | } |
967 | 952 | ``` |
968 | 953 |
|
969 | 954 | ```javascript |
970 | 955 | function connectMediaElements(webRtcEndpoint, filter, callback) { |
971 | | - webRtcEndpoint.connect( |
972 | | - filter, |
973 | | - error => { |
| 956 | + webRtcEndpoint.connect(filter, error => { |
| 957 | + if (error) { |
| 958 | + return callback(error); |
| 959 | + } |
| 960 | + |
| 961 | + filter.connect(webRtcEndpoint, error => { |
974 | 962 | if (error) { |
975 | 963 | return callback(error); |
976 | 964 | } |
977 | 965 |
|
978 | | - filter.connect( |
979 | | - webRtcEndpoint, |
980 | | - error => { |
981 | | - if (error) { |
982 | | - return callback(error); |
983 | | - } |
984 | | - |
985 | | - return callback(null); |
986 | | - } |
987 | | - ); |
988 | | - } |
989 | | - ); |
| 966 | + return callback(null); |
| 967 | + }); |
| 968 | + }); |
990 | 969 | } |
991 | 970 | ``` |
992 | 971 |
|
|
0 commit comments