webrtc-streamer 0.6.5 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/c_cpp_properties.json +4 -1
- package/README.md +9 -9
- package/html/libs/adapter.min.js +3480 -1
- package/html/libs/body-pix +18 -0
- package/html/libs/coco-ssd +17 -16
- package/html/libs/deeplab +53 -3
- package/html/libs/posenet +3 -2
- package/html/libs/tf-backend-wasm.js +5796 -0
- package/html/libs/tfjs +17 -2
- package/html/libs/tfjs-backend-wasm-simd.wasm +0 -0
- package/html/libs/tfjs-backend-wasm.wasm +0 -0
- package/html/webrtc-streamer-element.html +9 -5
- package/html/webrtc-streamer-element.js +7 -7
- package/html/webrtcstreamer.js +5 -2
- package/package.json +2 -2
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<html>
|
|
2
2
|
<head>
|
|
3
3
|
<link rel="icon" type="image/png" href="webrtc.png" />
|
|
4
|
-
<script src="libs/tfjs"
|
|
5
|
-
<script src="
|
|
6
|
-
<script
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<script src="libs/tfjs"></script>
|
|
5
|
+
<script src="libs/tf-backend-wasm.js"></script>
|
|
6
|
+
<script>
|
|
7
|
+
tf.setBackend('wasm').then(() => main());
|
|
8
|
+
</script>
|
|
9
|
+
<script src="libs/coco-ssd"> </script>
|
|
10
|
+
<script src="libs/posenet"> </script>
|
|
11
|
+
<script src="libs/deeplab"> </script>
|
|
12
|
+
<script src="libs/body-pix"></script>
|
|
9
13
|
<script type="module" src="webrtc-streamer-element.js"></script>
|
|
10
14
|
<script type="module" src="webrtc-streamer-footer-element.js"></script>
|
|
11
15
|
<script type="module" src="webrtc-streamer-menu-element.js"></script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./libs/adapter.min.js";
|
|
2
2
|
import "./tensorflow.js";
|
|
3
|
-
import
|
|
3
|
+
import "./webrtcstreamer.js";
|
|
4
4
|
|
|
5
5
|
class WebRTCStreamerElement extends HTMLElement {
|
|
6
6
|
static get observedAttributes() {
|
|
@@ -84,14 +84,14 @@ class WebRTCStreamerElement extends HTMLElement {
|
|
|
84
84
|
let imgLoaded;
|
|
85
85
|
if (reconnect) {
|
|
86
86
|
this.disconnectStream();
|
|
87
|
-
this.webRtcServer = new WebRtcStreamer(this.videoElement, webrtcurl);
|
|
88
|
-
this.webRtcServer.connect(videostream, audiostream, this.getAttribute("options"));
|
|
89
87
|
|
|
90
88
|
imgLoaded = new Promise( (resolve,rejet) => {
|
|
91
|
-
this.videoElement.addEventListener('
|
|
92
|
-
resolve(event)
|
|
93
|
-
});
|
|
89
|
+
this.videoElement.addEventListener('loadedmetadata', () => resolve(), { once: true });
|
|
94
90
|
} );
|
|
91
|
+
|
|
92
|
+
this.webRtcServer = new WebRtcStreamer(this.videoElement, webrtcurl);
|
|
93
|
+
this.webRtcServer.connect(videostream, audiostream, this.getAttribute("options"));
|
|
94
|
+
|
|
95
95
|
} else {
|
|
96
96
|
imgLoaded = new Promise( (resolve) => resolve() );
|
|
97
97
|
}
|
|
@@ -101,7 +101,7 @@ class WebRTCStreamerElement extends HTMLElement {
|
|
|
101
101
|
Promise.all([imgLoaded, modelLoaded]).then(([event,model]) => {
|
|
102
102
|
this.setVideoSize(this.videoElement.videoWidth, this.videoElement.videoHeight)
|
|
103
103
|
|
|
104
|
-
if (model) {
|
|
104
|
+
if (model && modelLoaded.run) {
|
|
105
105
|
model.run = modelLoaded.run;
|
|
106
106
|
model.run(model, this.videoElement, this.canvasElement)
|
|
107
107
|
modelLoaded.model = model;
|
package/html/webrtcstreamer.js
CHANGED
|
@@ -57,8 +57,11 @@ WebRtcStreamer.prototype.connect = function(videourl, audiourl, options, localst
|
|
|
57
57
|
* Disconnect a WebRTC Stream and clear videoElement source
|
|
58
58
|
*/
|
|
59
59
|
WebRtcStreamer.prototype.disconnect = function() {
|
|
60
|
-
if (this.videoElement) {
|
|
61
|
-
this.videoElement.
|
|
60
|
+
if (this.videoElement?.srcObject) {
|
|
61
|
+
this.videoElement.srcObject.getTracks().forEach(track => {
|
|
62
|
+
track.stop()
|
|
63
|
+
this.videoElement.srcObject.removeTrack(track);
|
|
64
|
+
});
|
|
62
65
|
}
|
|
63
66
|
if (this.pc) {
|
|
64
67
|
fetch(this.srvurl + "/api/hangup?peerid="+this.pc.peerid)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webrtc-streamer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "joinjanusvideoroom.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"url": "https://github.com/mpromonet/webrtc-streamer/"
|
|
19
19
|
},
|
|
20
20
|
"author": "Michel Promonet",
|
|
21
|
-
"license": "
|
|
21
|
+
"license": "Unlicense"
|
|
22
22
|
}
|