mirror of
https://github.com/beatriceo/polyglot.git
synced 2025-10-22 17:52:10 +00:00
set up action able to work with webrtc in localhost
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery with: :exception
|
||||
before_action :authenticate_user!
|
||||
protect_from_forgery unless: -> { request.format.json? } # Only accept json
|
||||
end
|
||||
|
15
app/controllers/video_sessions_controller.rb
Normal file
15
app/controllers/video_sessions_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class VideoSessionsController < ApplicationController
|
||||
def create
|
||||
# HTTP status code 200 with an empty body
|
||||
head :no_content
|
||||
ActionCable.server.broadcast "video_session_channel", session_params
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def session_params
|
||||
# SDP = Session description protocol (codec info from client)
|
||||
# Candidate = ICE candidates (e.g. TURN and STUN server)
|
||||
params.permit(:type, :from, :to, :sdp, :candidate)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user