Skip to content

Commit

Permalink
Merge pull request #109 from techies23/hotfix_recording_by_meeting_id
Browse files Browse the repository at this point in the history
Recording by meeting bug fix
  • Loading branch information
techies23 authored Feb 5, 2024
2 parents ea3afc2 + 711da19 commit 4983a30
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 199 deletions.
7 changes: 5 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: zoom video conference, video conference, zoom, zoom video conferencing, we
Donate link: https://www.paypal.com/donate?hosted_button_id=2UCQKR868M9WE
Requires at least: 5.0
Tested up to: 6.3
Stable tag: 4.4.1
Stable tag: 4.4.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -159,7 +159,10 @@ Yes, you should be registered in Zoom. Also, depending on the zoom account plan

== Changelog ==

= 4.4.1 January 2th, 2024 =
= 4.4.2 January 26th, 2024 =
* Minor Warning issue fix.

= 4.4.1 January 24th, 2024 =
* Fixed: Gallery View should now be supported for IFrame join via browser shortcode.

= 4.4.0 January 16th, 2024 =
Expand Down
2 changes: 1 addition & 1 deletion includes/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function version_update_warning( $current_version, $new_version ) {
*/
function set_corp_headers( $headers, $wp ) {
$type = filter_input( INPUT_GET, 'type' );
if ( ( isset( $wp->query_vars['post_type'] ) && $wp->query_vars['post_type'] == 'zoom-meetings' && ! empty( $type ) ) || has_shortcode( get_post()->post_content, 'zoom_join_via_browser' ) ) {
if ( ( isset( $wp->query_vars['post_type'] ) && $wp->query_vars['post_type'] == 'zoom-meetings' && ! empty( $type ) ) || ( ! empty( get_post()->post_content ) && has_shortcode( get_post()->post_content, 'zoom_join_via_browser' ) ) ) {
$headers['Cross-Origin-Embedder-Policy'] = 'require-corp';
$headers['Cross-Origin-Opener-Policy'] = 'same-origin';
}
Expand Down
25 changes: 17 additions & 8 deletions includes/Shortcodes/Recordings.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,26 @@ public function getRecordingsByMeetingID() {
wp_send_json_error( __( 'Meeting ID is not specified', "video-conferencing-with-zoom-api" ) );
}

$zoomObj = Zoom::instance();
$all_past_meetings = $zoomObj->getPastMeetingDetails( $meeting_id );
if ( ! empty( $all_past_meetings->meetings ) && ! isset( $all_past_meetings->code ) ) {
//loop through all instance of past / completed meetings and get recordings
foreach ( $all_past_meetings->meetings as $meeting ) {
$recordings[] = $zoomObj->recordingsByMeeting( $meeting->uuid );
}
} else {
$zoomObj = Zoom::instance();
$meeting_info = json_decode( zoom_conference()->getMeetingInfo( $meeting_id ) );
//if it's a regular meeting or webinar use the meeting id as it seems it's more reliable
//https://devforum.zoom.us/t/recording-api-issue/102992
if ( $meeting_info->type == '2' || $meeting_info->type == '5' ) {
$recordings[] = $zoomObj->recordingsByMeeting( $meeting_id );
} else {
//if it's a recurring meeting / webinar we're going to need to get pass meeting details
$all_past_meetings = $zoomObj->getPastMeetingDetails( $meeting_id );
if ( ! empty( $all_past_meetings->meetings ) && ! isset( $all_past_meetings->code ) ) {
//loop through all instance of past / completed meetings and get recordings
foreach ( $all_past_meetings->meetings as $meeting ) {
$recordings[] = $zoomObj->recordingsByMeeting( $meeting->uuid );
}
} else {
$recordings[] = $zoomObj->recordingsByMeeting( $meeting_id );
}
}


if ( ! empty( $recordings ) ) {
if ( ! empty( $recordings[0]->code ) && ! empty( $recordings[0]->message ) ) {
wp_send_json_error( $recordings[0]->message );
Expand Down
Loading

0 comments on commit 4983a30

Please sign in to comment.