Fix videocall react cable
This commit is contained in:
parent
032d2adbd4
commit
6887ea8bb8
@ -19,6 +19,7 @@
|
|||||||
// require components
|
// require components
|
||||||
//= require qrcode.min.js
|
//= require qrcode.min.js
|
||||||
//= require eyecandy
|
//= require eyecandy
|
||||||
|
//= require cable
|
||||||
//= require bundle
|
//= require bundle
|
||||||
// require react-rails-hot-loader
|
// require react-rails-hot-loader
|
||||||
// require_tree .
|
// require_tree .
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6,8 +6,8 @@
|
|||||||
//= require_tree ./channels
|
//= require_tree ./channels
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.VideoCall || (this.VideoCall = {});
|
this.App || (this.App = {});
|
||||||
|
|
||||||
VideoCall.cable = ActionCable.createConsumer();
|
App.cable = ActionCable.createConsumer();
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class VideoCall extends React.Component{
|
|||||||
joinCall(e){
|
joinCall(e){
|
||||||
console.log("Hello from joinCall");
|
console.log("Hello from joinCall");
|
||||||
console.log(e);
|
console.log(e);
|
||||||
VideoCall.cable.subscriptions.create(
|
App.cable.subscriptions.create(
|
||||||
{ channel: "CallChannel" },
|
{ channel: "CallChannel" },
|
||||||
{
|
{
|
||||||
connected: () => {
|
connected: () => {
|
||||||
@ -130,7 +130,7 @@ class VideoCall extends React.Component{
|
|||||||
.forEach(function (track) { track.stop(); })
|
.forEach(function (track) { track.stop(); })
|
||||||
|
|
||||||
this.localVideo.srcObject = null;
|
this.localVideo.srcObject = null;
|
||||||
VideoCall.cable.subscriptions.subscriptions = [];
|
App.cable.subscriptions.subscriptions = [];
|
||||||
this.remoteVideoContainer.innerHTML = "";
|
this.remoteVideoContainer.innerHTML = "";
|
||||||
broadcastData({ type: LEAVE_CALL, from: this.userId });
|
broadcastData({ type: LEAVE_CALL, from: this.userId });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user