Add session video beta button
This commit is contained in:
parent
24b4a80853
commit
a1ab88f641
|
|
@ -0,0 +1,9 @@
|
|||
class UseVideoServerOnSessions < ActiveRecord::Migration
|
||||
def self.up
|
||||
execute("ALTER TABLE music_sessions ADD COLUMN use_video_conferencing_server BOOLEAN DEFAULT FALSE;")
|
||||
end
|
||||
|
||||
def self.down
|
||||
execute("ALTER TABLE music_sessions DROP COLUMN use_video_conferencing_server;")
|
||||
end
|
||||
end
|
||||
|
|
@ -854,6 +854,10 @@ module JamRuby
|
|||
music_session.can_see? user
|
||||
end
|
||||
|
||||
def use_video_conferencing_server
|
||||
music_session.use_video_conferencing_server
|
||||
end
|
||||
|
||||
def tick_track_changes
|
||||
self.track_changes_counter += 1
|
||||
self.save!(:validate => false)
|
||||
|
|
@ -979,4 +983,4 @@ module JamRuby
|
|||
music_session.lesson_session
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@ module JamRuby
|
|||
new_session.session_controller = self.session_controller
|
||||
new_session.school_id = self.school_id
|
||||
new_session.is_platform_instructor = self.is_platform_instructor
|
||||
new_session.use_video_conferencing_server = self.use_video_conferencing_server
|
||||
|
||||
# copy rsvp_slots, rsvp_requests, and rsvp_requests_rsvp_slots
|
||||
RsvpSlot.where("music_session_id = '#{self.id}'").find_each do |slot|
|
||||
|
|
@ -666,6 +667,7 @@ module JamRuby
|
|||
if options[:lesson_session]
|
||||
ms.lesson_session = options[:lesson_session]
|
||||
end
|
||||
ms.use_video_conferencing_server = user.use_video_conferencing_server
|
||||
|
||||
|
||||
ms.save
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ rest = context.JK.Rest()
|
|||
]
|
||||
|
||||
useVideoConferencingServer: () ->
|
||||
gon.global.use_video_conferencing_server || @state.user?.use_video_conferencing_server
|
||||
|
||||
gon.global.use_video_conferencing_server || context.SessionStore.currentSession.use_video_conferencing_server
|
||||
|
||||
onUserChanged: (userState) ->
|
||||
@setState({user: userState?.user})
|
||||
|
|
@ -23,8 +22,24 @@ rest = context.JK.Rest()
|
|||
return 'noclose'
|
||||
|
||||
openBrowserToNewVideoServer: () ->
|
||||
rest.getVideoConferencingRoomUrl(context.SessionStore.id()).done((response) => context.JK.popExternalLink(response.url))
|
||||
|
||||
canVideo = window.SessionStore.canVideo()
|
||||
if canVideo
|
||||
rest.getVideoConferencingRoomUrl(context.SessionStore.id()).done((response) => context.JK.popExternalLink(response.url))
|
||||
else
|
||||
buttons = []
|
||||
buttons.push({name: 'CLOSE', buttonStyle: 'button-grey'})
|
||||
buttons.push({name: 'COMPARE PLANS', buttonStyle: 'button-grey', click: (() => (@openBrowserToPlanComparison()))})
|
||||
buttons.push({
|
||||
name: 'UPGRADE PLAN',
|
||||
buttonStyle: 'button-orange',
|
||||
click: (() => (@openBrowserToPayment()))
|
||||
})
|
||||
context.JK.Banner.show({
|
||||
title: "Your Current Plan Does Not Allow Video",
|
||||
html: context._.template($('#template-plan-no-video').html(), {}, { variable: 'data' }),
|
||||
buttons: buttons})
|
||||
|
||||
|
||||
sessionWebCam: (e) ->
|
||||
e.preventDefault();
|
||||
|
||||
|
|
@ -58,4 +73,4 @@ rest = context.JK.Rest()
|
|||
<img src="/assets/content/icon_video.png" align="texttop" height="14" width="14"/>
|
||||
VIDEO
|
||||
</a>`
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@
|
|||
var $quickStartOpenBtn = null;
|
||||
var $startOrScheduledBtn = null;
|
||||
var $featureSessions = null;
|
||||
var $useNewVideo = null;
|
||||
var $useNewVideoSelect = null;
|
||||
|
||||
// Step1 layout
|
||||
var $screenStep1 = null;
|
||||
|
|
@ -1157,6 +1159,33 @@
|
|||
|
||||
function reset() {
|
||||
$selectedFilenames.empty(); // we need to be sure and clear out old uploaded notations on every start of create session flow
|
||||
if(gon.global.use_video_conferencing_server) {
|
||||
// show $useNewVideo.
|
||||
$useNewVideo.css("display", "inline")
|
||||
}
|
||||
app.user()
|
||||
.done(function(userMe) {
|
||||
if(userMe.admin) {
|
||||
$useNewVideo.css("display", "inline")
|
||||
}
|
||||
if(userMe.use_video_conferencing_server) {
|
||||
console.log("select new")
|
||||
$useNewVideoSelect.val("new")
|
||||
}
|
||||
else {
|
||||
console.log("select old")
|
||||
$useNewVideoSelect.val("old")
|
||||
}
|
||||
})
|
||||
$useNewVideoSelect.unbind('change').change(function () {
|
||||
app.updateUserModel({use_video_conferencing_server: $useNewVideoSelect.val() == "new"})
|
||||
.done(function () {
|
||||
console.log("updated user successfully")
|
||||
})
|
||||
.fail(function () {
|
||||
app.layout.notify("Unable to update your video preference. Please try again later.")
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function beforeShow(args) {
|
||||
|
|
@ -1532,6 +1561,8 @@
|
|||
$quickStartOpenBtn = $screen.find('.quick-start-open')
|
||||
$startOrScheduledBtn = $screen.find('.start-or-schedule')
|
||||
$featureSessions = $screen.find('.featured-sessions tbody')
|
||||
$useNewVideo = $screen.find('#video-beta')
|
||||
$useNewVideoSelect = $screen.find('#video-beta-options')
|
||||
|
||||
initializeControls();
|
||||
events();
|
||||
|
|
@ -1542,4 +1573,4 @@
|
|||
return this;
|
||||
}
|
||||
|
||||
})(window, jQuery);
|
||||
})(window, jQuery);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,16 @@
|
|||
margin-bottom:20px !important;
|
||||
}
|
||||
}
|
||||
#video-beta {
|
||||
position:relative;
|
||||
//top:3px;
|
||||
left:40px;
|
||||
display:none;
|
||||
font-size:20px;
|
||||
.easydropdown-wrapper {
|
||||
top:4px;
|
||||
}
|
||||
}
|
||||
table.featured-sessions {
|
||||
.actions {
|
||||
text-align:center;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class ApiUsersController < ApiController
|
|||
@user.country = params[:country] if params.has_key?(:country)
|
||||
@user.musician = params[:musician] if params.has_key?(:musician)
|
||||
@user.update_instruments(params[:instruments].nil? ? [] : params[:instruments]) if params.has_key?(:instruments)
|
||||
|
||||
@user.use_video_conferencing_server = params[:use_video_conferencing_server] if params.has_key?(:use_video_conferencing_server)
|
||||
# genres
|
||||
@user.update_genres(params[:genres].nil? ? [] : params[:genres], GenrePlayer::PROFILE) if params.has_key?(:genres)
|
||||
@user.update_genres(params[:virtual_band_genres].nil? ? [] : params[:virtual_band_genres], GenrePlayer::VIRTUAL_BAND) if params.has_key?(:virtual_band_genres)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ if !current_user
|
|||
}
|
||||
else
|
||||
|
||||
attributes :id, :name, :description, :musician_access, :approval_required, :friends_can_join, :fan_access, :fan_chat, :band_id, :user_id, :claimed_recording_initiator_id, :track_changes_counter, :max_score, :backing_track_path, :metronome_active, :jam_track_initiator_id, :jam_track_id, :music_session_id_int
|
||||
attributes :id, :name, :description, :musician_access, :approval_required, :friends_can_join, :fan_access, :fan_chat, :band_id, :user_id, :claimed_recording_initiator_id, :track_changes_counter, :max_score, :backing_track_path, :metronome_active, :jam_track_initiator_id, :jam_track_id, :music_session_id_int, :use_video_conferencing_server
|
||||
|
||||
if @on_join
|
||||
node :subscription do |session|
|
||||
|
|
@ -179,4 +179,4 @@ else
|
|||
node(:bitrate) { |mount| mount.resolve_string(:bitrate) }
|
||||
node(:subtype) { |mount| mount.resolve_string(:subtype) }
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ else
|
|||
attributes :id, :music_session_id, :name, :description, :musician_access, :approval_required, :fan_access, :fan_chat, :create_type,
|
||||
:band_id, :user_id, :genre_id, :created_at, :like_count, :comment_count, :play_count, :scheduled_duration,
|
||||
:language, :recurring_mode, :language_description, :scheduled_start_date, :access_description, :timezone, :timezone_id, :timezone_description,
|
||||
:musician_access_description, :fan_access_description, :session_removed_at, :legal_policy, :open_rsvps, :is_unstructured_rsvp?, :friends_can_join
|
||||
:musician_access_description, :fan_access_description, :session_removed_at, :legal_policy, :open_rsvps, :is_unstructured_rsvp?, :friends_can_join, :use_video_conferencing_server
|
||||
|
||||
node :can_join do |session|
|
||||
session.can_join?(current_user, true)
|
||||
|
|
@ -239,4 +239,4 @@ else
|
|||
node(:subtype) { |mount| mount.resolve_string(:subtype) }
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<div class="session-wrapper">
|
||||
<div id="session-step-1" class="create-session-wizard" layout-wizard-step="0">
|
||||
<div class="column column-left">
|
||||
<h2>start a session</h2>
|
||||
<h2 style="position:relative">start a session <div id="video-beta">BETA: <select class="easydropdown" id="video-beta-options"><option value="new">Use New Video</option><option value="old">Use Legacy Video</option></select></div></h2>
|
||||
<div class="quick-options">
|
||||
<div class="quick-option"><a class="button-orange quick-start-solo" href="#" >QUICK START PRIVATE</a><p>Quick start a private session now. Good for solo practice. Or invite specific friends to join you.</p></div>
|
||||
<div class="quick-option"><a class="button-orange quick-start-open" href="#" >QUICK START PUBLIC</a><p>Quick start an open session that anyone can join. Good for meeting others, spontaneous jams.</p></div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue