Fix videocall react cable

This commit is contained in:
icwizardmonke 2023-09-18 15:37:33 +00:00
parent 285a296ba7
commit c8636e0b2c
4 changed files with 6 additions and 5 deletions

View File

@ -19,6 +19,7 @@
// require components
//= require qrcode.min.js
//= require eyecandy
//= require cable
//= require bundle
// require react-rails-hot-loader
// require_tree .

File diff suppressed because one or more lines are too long

View File

@ -6,8 +6,8 @@
//= require_tree ./channels
(function() {
this.VideoCall || (this.VideoCall = {});
this.App || (this.App = {});
VideoCall.cable = ActionCable.createConsumer();
App.cable = ActionCable.createConsumer();
}).call(this);

View File

@ -22,7 +22,7 @@ class VideoCall extends React.Component{
joinCall(e){
console.log("Hello from joinCall");
console.log(e);
VideoCall.cable.subscriptions.create(
App.cable.subscriptions.create(
{ channel: "CallChannel" },
{
connected: () => {
@ -130,7 +130,7 @@ class VideoCall extends React.Component{
.forEach(function (track) { track.stop(); })
this.localVideo.srcObject = null;
VideoCall.cable.subscriptions.subscriptions = [];
App.cable.subscriptions.subscriptions = [];
this.remoteVideoContainer.innerHTML = "";
broadcastData({ type: LEAVE_CALL, from: this.userId });
}