|
|
|
@ -102,6 +102,7 @@ window.RecordAudio = (function () { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var btnSaveText = btnSave.html(); |
|
|
|
|
var fileExtension = '.' + recordedBlob.type.split('/')[1]; |
|
|
|
|
|
|
|
|
|
var formData = new FormData(); |
|
|
|
@ -113,21 +114,31 @@ window.RecordAudio = (function () { |
|
|
|
|
data: formData, |
|
|
|
|
processData: false, |
|
|
|
|
contentType: false, |
|
|
|
|
type: 'POST' |
|
|
|
|
}).then(function (fileUrl) { |
|
|
|
|
type: 'POST', |
|
|
|
|
beforeSend: function () { |
|
|
|
|
btnStart.prop('disabled', true); |
|
|
|
|
btnPause.prop('disabled', true); |
|
|
|
|
btnPlay.prop('disabled', true); |
|
|
|
|
btnStop.prop('disabled', true); |
|
|
|
|
btnSave.prop('disabled', true).text(btnSave.data('loadingtext')); |
|
|
|
|
} |
|
|
|
|
}).done(function (fileUrl) { |
|
|
|
|
if (!fileUrl) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
btnSave.prop('disabled', true).addClass('hidden'); |
|
|
|
|
btnStop.prop('disabled', true).addClass('hidden'); |
|
|
|
|
btnStart.prop('disabled', false).removeClass('hidden'); |
|
|
|
|
|
|
|
|
|
if ($('#audio-title-rtc').length) { |
|
|
|
|
$('#audio-title-rtc').prop('readonly', false); |
|
|
|
|
|
|
|
|
|
window.location.reload(); |
|
|
|
|
} |
|
|
|
|
}).fail(function () { |
|
|
|
|
alert(btnSave.data('errortext')); |
|
|
|
|
}).always(function () { |
|
|
|
|
btnSave.prop('disabled', true).addClass('hidden').html(btnSaveText); |
|
|
|
|
btnStop.prop('disabled', true).addClass('hidden'); |
|
|
|
|
btnPause.prop('disabled', true).addClass('hidden'); |
|
|
|
|
btnStart.prop('disabled', false).removeClass('hidden'); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|