Changeset 12043 for sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-rest/wordpresstv-rest.php
- Timestamp:
- 09/02/2022 05:03:46 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-rest/wordpresstv-rest.php
r9762 r12043 97 97 'producer' => array(), 98 98 'video' => array( 99 'mp4' => array(), 100 'ogg' => array(), 101 ) 99 'mp4' => array(), 100 'ogg' => array(), 101 'original' => false, 102 ), 103 'subtitles' => array(), 102 104 ); 103 105 … … 145 147 if ( $post_videos ) { 146 148 $post_video = video_get_info_by_guid( $post_videos[0] ); 147 148 // Ogg 149 $api_data = video_get_single_response( $post_video ); 150 151 // Original uploaded file, may vary in format. 152 $video['video']['original'] = $api_data['original']; 153 154 // Ogg - No longer generated as of May 2021 149 155 if ( $link = video_highest_resolution_ogg( $post_video ) ) { 150 156 $video['video']['ogg']['low'] = $link; 151 157 } 152 158 153 // MP4 159 // MP4 - Audio no longer available in all formats 154 160 $mp4_formats = array( 'low' => 'fmt_std', 'med' => 'fmt_dvd', 'high' => 'fmt_hd' ); 155 161 foreach ( $mp4_formats as $mp4_field => $mp4_format ) { 156 if ( $link = video_url_by_format( $post_video, $mp4_format ) ) { 157 $video['video']['mp4'][ $mp4_field ] = $link; 162 // Check if HLS transcoded, no audio, no need to link to it. 163 if ( ! empty( $api_data['files'][ str_replace( 'fmt_', '', $mp4_format ) ]['hls'] ) ) { 164 continue; 158 165 } 166 167 $video['video']['mp4'][ $mp4_field ] = video_url_by_format( $post_video, $mp4_format ); 159 168 } 160 169 } 170 171 // Expose the subtitles 172 $video['subtitles'] = (array) $api_data['subtitles']; 161 173 } 162 174
Note: See TracChangeset
for help on using the changeset viewer.