Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
stsdc committed Sep 11, 2018
2 parents 67bac71 + 6f97066 commit 8a0cb50
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 32 deletions.
3 changes: 3 additions & 0 deletions client/src/js/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const core = (actions) => {
let sockets = new Sockets(actions);

actions.motors = new Motors(sockets);

actions.stream = new Stream();
window.onbeforeunload = () => actions.stream.stop();

actions.manipulator.m = new Manipulator(sockets);
actions.system = new System(sockets);

Expand Down
41 changes: 10 additions & 31 deletions client/src/js/core/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Stream.prototype._onRemoteSdpSuccess = function() {

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

Stream.prototype.close = function(event) {
Expand All @@ -198,35 +198,14 @@ Stream.prototype.error = function(event) {
}

Stream.prototype.stop = function() {
// if (this.dataChannel) {
// console.log("closing data channels");
// this.dataChannel.close();
// this.dataChannel = null;
// document.getElementById('datachannels').disabled = true;
// }
// if (localdatachannel) {
// console.log("closing local data channels");
// localdatachannel.close();
// localdatachannel = null;
// }
// if (audio_video_stream) {
// try {
// audio_video_stream.stop();
// } catch (e) {
// for (var i = 0; i < audio_video_stream.getTracks().length; i++)
// audio_video_stream.getTracks()[i].stop();
// }
// audio_video_stream = null;
// }
// stop_record();
// document.getElementById('remote-video').src = '';
// if (this.peerConnection) {
// this.peerConnection.close();
// this.peerConnection = null;
// }
// if (ws) {
// ws.close();
// ws = null;
// }
// document.documentElement.style.cursor = 'default';
document.getElementById('remote-video').src = '';

this.close();

if (this.websocket) {
this.websocket.close();
this.websocket = null;
}
console.info('[stream] Stop.')
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tcs",
"version": "0.13.2",
"version": "0.13.3",
"description": "Turtle Control Software",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8a0cb50

Please sign in to comment.