Fix react videochat component
This commit is contained in:
parent
b378f2a93d
commit
d7ed50c5a4
@ -35,7 +35,7 @@ guard :bundler do
|
|||||||
files.each { |file| watch(helper.real_path(file)) }
|
files.each { |file| watch(helper.real_path(file)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
guard 'rails', host: '0.0.0.0', port: 9913 do
|
guard 'rails', host: '0.0.0.0', port: 9914 do
|
||||||
watch('Gemfile.lock')
|
watch('Gemfile.lock')
|
||||||
watch(%r{^(config|lib)/.*})
|
watch(%r{^(config|lib)/.*})
|
||||||
end
|
end
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6,8 +6,8 @@
|
|||||||
//= require_tree ./channels
|
//= require_tree ./channels
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.App || (this.App = {});
|
this.VideoCall || (this.VideoCall = {});
|
||||||
|
|
||||||
App.cable = ActionCable.createConsumer();
|
VideoCall.cable = ActionCable.createConsumer();
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
%main#root
|
%main#root
|
||||||
%h1 If you're seeing this, something broke
|
%h1 react component failed to load
|
||||||
-# , props = {id: @game.id, current_user: current_user}, html_options = {id: "game-component-container"}
|
-# , props = {id: @game.id, current_user: current_user}, html_options = {id: "game-component-container"}
|
||||||
|
|||||||
@ -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);
|
||||||
App.cable.subscriptions.create(
|
VideoCall.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;
|
||||||
App.cable.subscriptions.subscriptions = [];
|
VideoCall.cable.subscriptions.subscriptions = [];
|
||||||
this.remoteVideoContainer.innerHTML = "";
|
this.remoteVideoContainer.innerHTML = "";
|
||||||
broadcastData({ type: LEAVE_CALL, from: this.userId });
|
broadcastData({ type: LEAVE_CALL, from: this.userId });
|
||||||
}
|
}
|
||||||
@ -150,4 +150,4 @@ class VideoCall extends React.Component{
|
|||||||
</div>)
|
</div>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default App;
|
export default VideoCall;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user