Skip to content

Commit

Permalink
Differentiate between different recording types
Browse files Browse the repository at this point in the history
  • Loading branch information
cebounph committed Mar 4, 2024
1 parent a969f57 commit 574decc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 7 deletions.
24 changes: 21 additions & 3 deletions classes/task/get_meeting_recordings.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,25 @@ public function execute() {
mtrace('Finding meeting recordings for this account...');

$recordingtypestrings = [
'audio' => get_string('recordingtypeaudio', 'mod_zoom'),
'video' => get_string('recordingtypevideo', 'mod_zoom'),
'active_speaker' => get_string('recordingtype_active_speaker', 'mod_zoom'),
'audio_interpretation' => get_string('recordingtype_audio_interpretation', 'mod_zoom'),
'audio_only' => get_string('recordingtype_audio_only', 'mod_zoom'),
'audio_transcript' => get_string('recordingtype_audio_transcript', 'mod_zoom'),
'chat_file' => get_string('recordingtype_chat', 'mod_zoom'),
'closed_caption' => get_string('recordingtype_closed_caption', 'mod_zoom'),
'gallery_view' => get_string('recordingtype_gallery', 'mod_zoom'),
'poll' => get_string('recordingtype_poll', 'mod_zoom'),
'production_studio' => get_string('recordingtype_production_studio', 'mod_zoom'),
'shared_screen' => get_string('recordingtype_shared', 'mod_zoom'),
'shared_screen_with_gallery_view' => get_string('recordingtype_shared_gallery', 'mod_zoom'),
'shared_screen_with_speaker_view' => get_string('recordingtype_shared_speaker', 'mod_zoom'),
'shared_screen_with_speaker_view(CC)' => get_string('recordingtype_shared_speaker_cc', 'mod_zoom'),
'sign_interpretation' => get_string('recordingtype_sign', 'mod_zoom'),
'speaker_view' => get_string('recordingtype_speaker', 'mod_zoom'),
'summary' => get_string('recordingtype_summary', 'mod_zoom'),
'summary_next_steps' => get_string('recordingtype_summary_next_steps', 'mod_zoom'),
'summary_smart_chapters' => get_string('recordingtype_summary_smart_chapters', 'mod_zoom'),
'timeline' => get_string('recordingtype_timeline', 'mod_zoom'),
];

$localmeetings = zoom_get_all_meeting_records();
Expand Down Expand Up @@ -112,6 +129,8 @@ public function execute() {

if (empty($meetings[$recording->meetingid])) {
// Skip meetings that are not in Moodle.

var_dump($recording);
mtrace('Meeting id: ' . $recording->meetingid . ' does not exist...skipping');
continue;
}
Expand All @@ -127,7 +146,6 @@ public function execute() {
}

$zoom = $meetings[$recording->meetingid];

$recordingtype = $recording->recordingtype;
$recordingtypestring = $recordingtypestrings[$recordingtype];

Expand Down
21 changes: 19 additions & 2 deletions classes/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,9 @@ public function get_recording_url_list($meetingid) {
$allowedrecordingtypes = [
'MP4' => 'video',
'M4A' => 'audio',
'TRANSCRIPT' => 'transcript',
'CHAT' => 'chat',
'CC' => 'captions',
];

try {
Expand All @@ -1005,7 +1008,7 @@ public function get_recording_url_list($meetingid) {
$recordinginfo->meetinguuid = $response->uuid;
$recordinginfo->url = $recording->play_url;
$recordinginfo->filetype = $recording->file_type;
$recordinginfo->recordingtype = $allowedrecordingtypes[$recording->file_type];
$recordinginfo->recordingtype = $recording->recording_type;
$recordinginfo->passcode = $response->password;
$recordinginfo->recordingstart = strtotime($recording->recording_start);

Expand Down Expand Up @@ -1038,6 +1041,9 @@ public function get_user_recordings($userid, $from, $to) {
$allowedrecordingtypes = [
'MP4' => 'video',
'M4A' => 'audio',
'TRANSCRIPT' => 'transcript',
'CHAT' => 'chat',
'CC' => 'captions',
];

try {
Expand All @@ -1054,7 +1060,18 @@ public function get_user_recordings($userid, $from, $to) {
$recordinginfo->meetinguuid = $meeting->uuid;
$recordinginfo->url = $recording->play_url;
$recordinginfo->filetype = $recording->file_type;
$recordinginfo->recordingtype = $allowedrecordingtypes[$recording->file_type];
$recordinginfo->recordingtype = $recording->recording_type;
$recordinginfo->recordingstart = strtotime($recording->recording_start);

$recordings[$recording->id] = $recordinginfo;
}else if (!empty($recording->download_url) && isset($allowedrecordingtypes[$recording->file_type])) {
$recordinginfo = new stdClass();
$recordinginfo->recordingid = $recording->id;
$recordinginfo->meetingid = $meeting->id;
$recordinginfo->meetinguuid = $meeting->uuid;
$recordinginfo->url = $recording->download_url;
$recordinginfo->filetype = $recording->file_type;
$recordinginfo->recordingtype = $recording->recording_type;
$recordinginfo->recordingstart = strtotime($recording->recording_start);

$recordings[$recording->id] = $recordinginfo;
Expand Down
21 changes: 19 additions & 2 deletions lang/en/zoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,25 @@
$string['recordingshowtoggle'] = 'Toggle Show Recording';
$string['recordingurl'] = 'Recording URL';
$string['recordingview'] = 'View Recordings';
$string['recordingtypeaudio'] = 'Audio only';
$string['recordingtypevideo'] = 'Video and Audio';
$string['recordingtype_active_speaker'] = 'Active Speaker';
$string['recordingtype_audio_interpretation'] = 'Audio Interpretation';
$string['recordingtype_audio_only'] = 'Audio Only';
$string['recordingtype_audio_transcript'] = 'Audio Transcript';
$string['recordingtype_chat'] = 'Chat File';
$string['recordingtype_closed_caption'] = 'Closed Caption';
$string['recordingtype_gallery'] = 'Gallery View';
$string['recordingtype_poll'] = 'Poll';
$string['recordingtype_production_studio'] = 'Production Studio';
$string['recordingtype_shared'] = 'Shared Screen';
$string['recordingtype_shared_gallery'] = 'Shared Screen with Gallery View';
$string['recordingtype_shared_speaker'] = 'Shared Screen with Speaker View';
$string['recordingtype_shared_speaker_cc'] = 'Shared Screen with Speaker View (CC)';
$string['recordingtype_sign'] = 'Sign Interpretation';
$string['recordingtype_speaker'] = 'Speaker View';
$string['recordingtype_summary'] = 'Summary';
$string['recordingtype_summary_next_steps'] = 'Summary Next Steps';
$string['recordingtype_summary_smart_chapters'] = 'Summary Smart Chapters';
$string['recordingtype_timeline'] = 'Timeline';
$string['recordingvisibility'] = 'Are recordings for this meeting visible by default?';
$string['recordingvisibility_help'] = 'When new recordings for this meeting are fetched, should they be visible in Moodle by default?';
$string['recurrencetype'] = 'Recurrence';
Expand Down

0 comments on commit 574decc

Please sign in to comment.