Merged in VRFS-5123_change_video_button_url (pull request #13)
change video_btn url generation Approved-by: Seth Call
This commit is contained in:
commit
da8133bd8f
|
|
@ -2933,7 +2933,14 @@
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
function getVideoConferencingRoomUrl(musicSessionId){
|
||||
return $.ajax({
|
||||
type: 'GET',
|
||||
url: "/video/room/" + musicSessionId,
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
})
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
return self;
|
||||
|
|
@ -3196,6 +3203,7 @@
|
|||
this.changeSubscription = changeSubscription;
|
||||
this.cancelSubscription= cancelSubscription;
|
||||
this.listInvoices = listInvoices;
|
||||
this.getVideoConferencingRoomUrl = getVideoConferencingRoomUrl;
|
||||
return this;
|
||||
};
|
||||
})(window, jQuery);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
context = window
|
||||
SessionActions = @SessionActions
|
||||
rest = context.JK.Rest()
|
||||
|
||||
@SessionVideoBtn = React.createClass({
|
||||
|
||||
|
|
@ -22,8 +23,8 @@ SessionActions = @SessionActions
|
|||
return 'noclose'
|
||||
|
||||
openBrowserToNewVideoServer: () ->
|
||||
context.JK.popExternalLink("/video/room/#{context.SessionStore.id()}")
|
||||
|
||||
rest.getVideoConferencingRoomUrl(context.SessionStore.id()).done((response) => context.JK.popExternalLink(response.url))
|
||||
|
||||
sessionWebCam: (e) ->
|
||||
e.preventDefault();
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,6 @@ class MusicSessionsController < ApplicationController
|
|||
music_session = current_user.music_sessions.find(params[:music_session_id])
|
||||
tok = current_user.temp_tokens.create
|
||||
video_conf_url = "#{Rails.application.config.video_conferencing_host}/room/#{music_session.id}?token=#{tok.token}"
|
||||
redirect_to video_conf_url
|
||||
render json: { url: video_conf_url }
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,21 +20,17 @@ describe MusicSessionsController, type: :controller do
|
|||
connection.connect!
|
||||
end
|
||||
|
||||
describe "video redirect" do
|
||||
describe "video conferencing server url" do
|
||||
it "GET /video/room/:music_session_id" do
|
||||
get :session_video, music_session_id: music_session.id
|
||||
temp_token = TempToken.order(created_at: :desc).first
|
||||
expect(temp_token.user).to eq(user)
|
||||
video_conf_url = "#{Rails.application.config.video_conferencing_host}/room/#{music_session.id}?token=#{temp_token.token}"
|
||||
response.should redirect_to video_conf_url
|
||||
end
|
||||
|
||||
it "GET /video/room/:music_session_id" do
|
||||
get :session_video, music_session_id: music_session.id
|
||||
temp_token = TempToken.order(created_at: :desc).first
|
||||
expect(temp_token.user).to eq(user)
|
||||
video_conf_url = "#{Rails.application.config.video_conferencing_host}/room/#{music_session.id}?token=#{temp_token.token}"
|
||||
response.should redirect_to video_conf_url
|
||||
#response.should redirect_to video_conf_url
|
||||
resp = {
|
||||
url: video_conf_url
|
||||
}
|
||||
response.body.should == resp.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue