VRFS-1333 added recordingId
This commit is contained in:
parent
db3a063bd2
commit
77528ddc9d
|
|
@ -6,6 +6,7 @@
|
||||||
context.JK.FeedItemRecording = function($parentElement, options){
|
context.JK.FeedItemRecording = function($parentElement, options){
|
||||||
|
|
||||||
var claimedRecordingId = $parentElement.attr('data-claimed-recording-id');
|
var claimedRecordingId = $parentElement.attr('data-claimed-recording-id');
|
||||||
|
var recordingId = $parentElement.attr('id');
|
||||||
|
|
||||||
var $feedItem = $parentElement;
|
var $feedItem = $parentElement;
|
||||||
var $name = $('.name', $feedItem);
|
var $name = $('.name', $feedItem);
|
||||||
|
|
@ -98,7 +99,7 @@
|
||||||
function initialize() {
|
function initialize() {
|
||||||
$('.timeago', $feedItem).timeago();
|
$('.timeago', $feedItem).timeago();
|
||||||
$('.dotdotdot', $feedItem).dotdotdot();
|
$('.dotdotdot', $feedItem).dotdotdot();
|
||||||
$controls.listenRecording({claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'});
|
$controls.listenRecording({recordingId: recordingId, claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'});
|
||||||
context.JK.prettyPrintElements($('time.duration', $feedItem));
|
context.JK.prettyPrintElements($('time.duration', $feedItem));
|
||||||
context.JK.setInstrumentAssetPath($('.instrument-icon', $feedItem));
|
context.JK.setInstrumentAssetPath($('.instrument-icon', $feedItem));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
var logger = context.JK.logger;
|
var logger = context.JK.logger;
|
||||||
var rest = context.JK.Rest();
|
var rest = context.JK.Rest();
|
||||||
var $parent = $parentElement;
|
var $parent = $parentElement;
|
||||||
|
var recordingId = null;
|
||||||
var claimedRecordingId = null;
|
var claimedRecordingId = null;
|
||||||
var $currentTime = null;
|
var $currentTime = null;
|
||||||
var $slider = null;
|
var $slider = null;
|
||||||
|
|
@ -76,7 +77,7 @@
|
||||||
if(lastTime > -1) {audioDomElement.currentTime = lastTime;}
|
if(lastTime > -1) {audioDomElement.currentTime = lastTime;}
|
||||||
audioDomElement.play();
|
audioDomElement.play();
|
||||||
isPlaying = true;
|
isPlaying = true;
|
||||||
context.JK.Rest().addPlayablePlay(null, null, null, context.JK.currentUserId);
|
context.JK.Rest().addPlayablePlay(recordingId, 'JamRuby::Recording', claimedRecordingId, context.JK.currentUserId);
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -390,6 +391,7 @@
|
||||||
$sliderBar = $(options.sliderBarSelector, $parent);
|
$sliderBar = $(options.sliderBarSelector, $parent);
|
||||||
$currentTime = $(options.currentTimeSelector, $parent);
|
$currentTime = $(options.currentTimeSelector, $parent);
|
||||||
claimedRecordingId = options.claimedRecordingId;
|
claimedRecordingId = options.claimedRecordingId;
|
||||||
|
recordingId = options.recordingId;
|
||||||
$audio = $('audio', $parent);
|
$audio = $('audio', $parent);
|
||||||
|
|
||||||
if($audio.length == 0) {
|
if($audio.length == 0) {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
$playButton.click(togglePlay);
|
$playButton.click(togglePlay);
|
||||||
$controls.bind('statechange.listenRecording', stateChange);
|
$controls.bind('statechange.listenRecording', stateChange);
|
||||||
|
|
||||||
$controls.listenRecording({claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'});
|
$controls.listenRecording({recordingId: recordingId, claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'});
|
||||||
|
|
||||||
if (JK.currentUserId) {
|
if (JK.currentUserId) {
|
||||||
var shareDialog = new JK.ShareDialog(JK.app, claimedRecordingId, "recording");
|
var shareDialog = new JK.ShareDialog(JK.app, claimedRecordingId, "recording");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
class ApiUsersController < ApiController
|
class ApiUsersController < ApiController
|
||||||
|
|
||||||
before_filter :api_signed_in_user, :except => [:create, :show, :signup_confirm, :auth_session_create, :complete, :finalize_update_email, :isp_scoring]
|
before_filter :api_signed_in_user, :except => [:create, :show, :signup_confirm, :auth_session_create, :complete, :finalize_update_email, :isp_scoring, :add_play]
|
||||||
before_filter :auth_user, :only => [:session_settings_show, :session_history_index, :session_user_history_index, :update, :delete,
|
before_filter :auth_user, :only => [:session_settings_show, :session_history_index, :session_user_history_index, :update, :delete,
|
||||||
:liking_create, :liking_destroy, # likes
|
:liking_create, :liking_destroy, # likes
|
||||||
:following_create, :following_show, :following_destroy, # followings
|
:following_create, :following_show, :following_destroy, # followings
|
||||||
|
|
@ -580,7 +580,7 @@ class ApiUsersController < ApiController
|
||||||
|
|
||||||
play = PlayablePlay.new
|
play = PlayablePlay.new
|
||||||
play.playable_id = params[:id]
|
play.playable_id = params[:id]
|
||||||
play.playable_type = params[:claimed_recording_id].present? ? 'JamRuby::Recording' : 'JamRuby::MusicSession'
|
play.playable_type = params[:playable_type]
|
||||||
play.player_id = params[:user_id]
|
play.player_id = params[:user_id]
|
||||||
play.claimed_recording_id = params[:claimed_recording_id]
|
play.claimed_recording_id = params[:claimed_recording_id]
|
||||||
play.ip_address = request.remote_ip
|
play.ip_address = request.remote_ip
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue