From 574decccad5b13e4b3676a19848e91d2a4b6a2e1 Mon Sep 17 00:00:00 2001 From: cebounph Date: Mon, 4 Mar 2024 14:29:34 -0500 Subject: [PATCH] Differentiate between different recording types --- classes/task/get_meeting_recordings.php | 24 +++++++++++++++++++++--- classes/webservice.php | 21 +++++++++++++++++++-- lang/en/zoom.php | 21 +++++++++++++++++++-- 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/classes/task/get_meeting_recordings.php b/classes/task/get_meeting_recordings.php index 57474b14..263ad052 100644 --- a/classes/task/get_meeting_recordings.php +++ b/classes/task/get_meeting_recordings.php @@ -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(); @@ -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; } @@ -127,7 +146,6 @@ public function execute() { } $zoom = $meetings[$recording->meetingid]; - $recordingtype = $recording->recordingtype; $recordingtypestring = $recordingtypestrings[$recordingtype]; diff --git a/classes/webservice.php b/classes/webservice.php index 35257c45..add32080 100644 --- a/classes/webservice.php +++ b/classes/webservice.php @@ -991,6 +991,9 @@ public function get_recording_url_list($meetingid) { $allowedrecordingtypes = [ 'MP4' => 'video', 'M4A' => 'audio', + 'TRANSCRIPT' => 'transcript', + 'CHAT' => 'chat', + 'CC' => 'captions', ]; try { @@ -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); @@ -1038,6 +1041,9 @@ public function get_user_recordings($userid, $from, $to) { $allowedrecordingtypes = [ 'MP4' => 'video', 'M4A' => 'audio', + 'TRANSCRIPT' => 'transcript', + 'CHAT' => 'chat', + 'CC' => 'captions', ]; try { @@ -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; diff --git a/lang/en/zoom.php b/lang/en/zoom.php index 17ab2e30..c52352b7 100644 --- a/lang/en/zoom.php +++ b/lang/en/zoom.php @@ -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';