mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 00:20:37 +01:00
MDL-60848 atto_recordrtc: changed HTML of attached recordings
This was done so the user can then click on the recording and add subtitles etc - the same behaviour as 'atto_media'.
This commit is contained in:
parent
b5a3388bb1
commit
c8520ca45f
@ -26,9 +26,6 @@
|
||||
|
||||
$string['allowedtypes'] = 'Allowed types';
|
||||
$string['allowedtypes_desc'] = 'Which recording buttons should appear in Atto';
|
||||
$string['annotationprompt'] = 'What should the annotation appear as?';
|
||||
$string['annotation:audio'] = 'Audio annotation';
|
||||
$string['annotation:video'] = 'Video annotation';
|
||||
$string['attachrecording'] = 'Attach recording';
|
||||
$string['audioandvideo'] = 'Audio and video';
|
||||
$string['audiobitrate'] = 'Audio bitrate';
|
||||
|
@ -104,10 +104,7 @@ function atto_recordrtc_strings_for_js() {
|
||||
'uploadprogress',
|
||||
'uploadfailed',
|
||||
'uploadfailed404',
|
||||
'uploadaborted',
|
||||
'annotationprompt',
|
||||
'annotation:audio',
|
||||
'annotation:video'
|
||||
'uploadaborted'
|
||||
);
|
||||
|
||||
$PAGE->requires->strings_for_js($strings, 'atto_recordrtc');
|
||||
|
@ -292,16 +292,22 @@ M.atto_recordrtc.commonmodule = {
|
||||
|
||||
// Generates link to recorded annotation to be inserted.
|
||||
create_annotation: function(type, recording_url) {
|
||||
var linkText = window.prompt(M.util.get_string('annotationprompt', 'atto_recordrtc'),
|
||||
M.util.get_string('annotation:' + type, 'atto_recordrtc'));
|
||||
|
||||
// Return HTML for annotation link, if user did not press "Cancel".
|
||||
if (!linkText) {
|
||||
return undefined;
|
||||
} else {
|
||||
var annotation = '<a target="_blank" href="' + recording_url + '">' + linkText + '</a>';
|
||||
return annotation;
|
||||
var html = '';
|
||||
if (type == 'audio') {
|
||||
html = "<audio controls='true'>";
|
||||
} else { // Must be video.
|
||||
html = "<video controls='true'>";
|
||||
}
|
||||
|
||||
html += "<source src='" + recording_url + "'>" + recording_url;
|
||||
|
||||
if (type == 'audio') {
|
||||
html += "</audio>";
|
||||
} else { // Must be video.
|
||||
html += "</video>";
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
// Inserts link to annotation in editor text area.
|
||||
|
File diff suppressed because one or more lines are too long
@ -292,16 +292,22 @@ M.atto_recordrtc.commonmodule = {
|
||||
|
||||
// Generates link to recorded annotation to be inserted.
|
||||
create_annotation: function(type, recording_url) {
|
||||
var linkText = window.prompt(M.util.get_string('annotationprompt', 'atto_recordrtc'),
|
||||
M.util.get_string('annotation:' + type, 'atto_recordrtc'));
|
||||
|
||||
// Return HTML for annotation link, if user did not press "Cancel".
|
||||
if (!linkText) {
|
||||
return undefined;
|
||||
} else {
|
||||
var annotation = '<a target="_blank" href="' + recording_url + '">' + linkText + '</a>';
|
||||
return annotation;
|
||||
var html = '';
|
||||
if (type == 'audio') {
|
||||
html = "<audio controls='true'>";
|
||||
} else { // Must be video.
|
||||
html = "<video controls='true'>";
|
||||
}
|
||||
|
||||
html += "<source src='" + recording_url + "'>" + recording_url;
|
||||
|
||||
if (type == 'audio') {
|
||||
html += "</audio>";
|
||||
} else { // Must be video.
|
||||
html += "</video>";
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
// Inserts link to annotation in editor text area.
|
||||
|
@ -290,16 +290,22 @@ M.atto_recordrtc.commonmodule = {
|
||||
|
||||
// Generates link to recorded annotation to be inserted.
|
||||
create_annotation: function(type, recording_url) {
|
||||
var linkText = window.prompt(M.util.get_string('annotationprompt', 'atto_recordrtc'),
|
||||
M.util.get_string('annotation:' + type, 'atto_recordrtc'));
|
||||
|
||||
// Return HTML for annotation link, if user did not press "Cancel".
|
||||
if (!linkText) {
|
||||
return undefined;
|
||||
} else {
|
||||
var annotation = '<a target="_blank" href="' + recording_url + '">' + linkText + '</a>';
|
||||
return annotation;
|
||||
var html = '';
|
||||
if (type == 'audio') {
|
||||
html = "<audio controls='true'>";
|
||||
} else { // Must be video.
|
||||
html = "<video controls='true'>";
|
||||
}
|
||||
|
||||
html += "<source src='" + recording_url + "'>" + recording_url;
|
||||
|
||||
if (type == 'audio') {
|
||||
html += "</audio>";
|
||||
} else { // Must be video.
|
||||
html += "</video>";
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
// Inserts link to annotation in editor text area.
|
||||
|
Loading…
x
Reference in New Issue
Block a user