Skip to content

Commit 8a0cb50

Browse files
author
stsdc
committed
Merge branch 'dev'
2 parents 67bac71 + 6f97066 commit 8a0cb50

File tree

3 files changed

+14
-32
lines changed

3 files changed

+14
-32
lines changed

client/src/js/core/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const core = (actions) => {
1111
let sockets = new Sockets(actions);
1212

1313
actions.motors = new Motors(sockets);
14+
1415
actions.stream = new Stream();
16+
window.onbeforeunload = () => actions.stream.stop();
17+
1518
actions.manipulator.m = new Manipulator(sockets);
1619
actions.system = new System(sockets);
1720

client/src/js/core/stream.js

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Stream.prototype._onRemoteSdpSuccess = function() {
182182

183183
Stream.prototype._onRemoteSdpError = function(event) {
184184
console.error('[stream] Failed to set remote description (unsupported codec on this browser?):', event);
185-
// stop();
185+
this.stop();
186186
}
187187

188188
Stream.prototype.close = function(event) {
@@ -198,35 +198,14 @@ Stream.prototype.error = function(event) {
198198
}
199199

200200
Stream.prototype.stop = function() {
201-
// if (this.dataChannel) {
202-
// console.log("closing data channels");
203-
// this.dataChannel.close();
204-
// this.dataChannel = null;
205-
// document.getElementById('datachannels').disabled = true;
206-
// }
207-
// if (localdatachannel) {
208-
// console.log("closing local data channels");
209-
// localdatachannel.close();
210-
// localdatachannel = null;
211-
// }
212-
// if (audio_video_stream) {
213-
// try {
214-
// audio_video_stream.stop();
215-
// } catch (e) {
216-
// for (var i = 0; i < audio_video_stream.getTracks().length; i++)
217-
// audio_video_stream.getTracks()[i].stop();
218-
// }
219-
// audio_video_stream = null;
220-
// }
221201
// stop_record();
222-
// document.getElementById('remote-video').src = '';
223-
// if (this.peerConnection) {
224-
// this.peerConnection.close();
225-
// this.peerConnection = null;
226-
// }
227-
// if (ws) {
228-
// ws.close();
229-
// ws = null;
230-
// }
231-
// document.documentElement.style.cursor = 'default';
202+
document.getElementById('remote-video').src = '';
203+
204+
this.close();
205+
206+
if (this.websocket) {
207+
this.websocket.close();
208+
this.websocket = null;
209+
}
210+
console.info('[stream] Stop.')
232211
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tcs",
3-
"version": "0.13.2",
3+
"version": "0.13.3",
44
"description": "Turtle Control Software",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)