forked from External/greenlight
add HTML5 support
This commit is contained in:
@ -19,13 +19,19 @@ class UsersController < ActionController::Base
|
||||
# For updating a users background image.
|
||||
def update
|
||||
|
||||
# Make sure they actually select a file.
|
||||
if params[:user] then
|
||||
if params[:commit] == t('upload')
|
||||
# Make sure they actually select a file.
|
||||
if params[:user] then
|
||||
@user = User.find(params[:id])
|
||||
@user.assign_attributes(background: user_params[:background])
|
||||
flash[:danger] = t('invalid_file') unless @user.save
|
||||
else
|
||||
flash[:danger] = t('no_file')
|
||||
end
|
||||
elsif params[:commit] == t('switch_clients')
|
||||
# Switch the users default client.
|
||||
@user = User.find(params[:id])
|
||||
@user.assign_attributes(background: user_params[:background])
|
||||
flash[:danger] = t('invalid_file') unless @user.save
|
||||
else
|
||||
flash[:danger] = t('no_file')
|
||||
@user.update_attributes(use_html5: !@user.use_html5)
|
||||
end
|
||||
|
||||
# Reload the page to apply changes and show flash messages.
|
||||
|
@ -80,6 +80,7 @@ module BbbApi
|
||||
"meta_#{BbbApi::META_LISTED}": false,
|
||||
"meta_#{BbbApi::META_TOKEN}": meeting_token
|
||||
}
|
||||
|
||||
meeting_options.merge!(
|
||||
{ "meta_#{BbbApi::META_HOOK_URL}": options[:hook_url] }
|
||||
) if options[:hook_url]
|
||||
@ -116,7 +117,31 @@ module BbbApi
|
||||
else
|
||||
password = bbb_meeting_info[:attendeePW]
|
||||
end
|
||||
join_url = bbb.join_meeting_url(meeting_id, full_name, password )
|
||||
|
||||
# Determine which client to join as.
|
||||
if current_user.nil?
|
||||
use_html5 = Rails.configuration.use_html5_by_default
|
||||
else
|
||||
use_html5 = current_user.use_html5 == true
|
||||
end
|
||||
|
||||
# If the user wants to use HTML5, verfiy it's running.
|
||||
if use_html5
|
||||
html5_check = Faraday.get bbb_endpoint.gsub('bigbluebutton/', 'html5client/check')
|
||||
# If HTML5 is not running, must use Flash.
|
||||
unless html5_check.status == 200
|
||||
use_html5 = false
|
||||
end
|
||||
end
|
||||
|
||||
# Generate the join URL.
|
||||
if use_html5
|
||||
clientURL = bbb_endpoint.gsub('bigbluebutton/', 'html5client/join')
|
||||
join_url = bbb.join_meeting_url(meeting_id, full_name, password, {clientURL: clientURL})
|
||||
else
|
||||
join_url = bbb.join_meeting_url(meeting_id, full_name, password)
|
||||
end
|
||||
|
||||
return success_join_res(join_url)
|
||||
end
|
||||
end
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
<% if @user %>
|
||||
<div class="upload-form">
|
||||
<h3><%= t('background_image') %></h3>
|
||||
<p> <%= t('background_image') + ": " + (@user.background_file_name || '') %> </p>
|
||||
<%= form_for @user, :html => { :multipart => true } do |f| %>
|
||||
<div class="form-group">
|
||||
@ -31,6 +32,14 @@
|
||||
<%= f.submit t('upload'), class: 'btn btn-info' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<br>
|
||||
<div class="html5-check">
|
||||
<h3><%= t('prefered_client') %></h3>
|
||||
<p><%= t('currently_joining_with', client: @user.use_html5 ? t('client_html5') : t('client_flash')) %></p>
|
||||
<%= form_for @user do |f| %>
|
||||
<%= f.submit t('switch_clients'), class: 'btn btn-info' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<h3><%= t('preferences_logged') %></h3>
|
||||
<% end %>
|
||||
|
Reference in New Issue
Block a user