- 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/sidebar-single.php
r8230 r12043 26 26 $videos = array_keys( find_all_videopress_shortcodes( $originalcontent ) ); 27 27 if ( ! empty( $videos ) ) { 28 $video = video_get_info_by_guid( $videos[0] ); 29 $formats = array( 'fmt_std' => 'Low', 'fmt_dvd' => 'Med', 'fmt_hd' => 'High', 'fmt1_ogg' => 'Low' ); 28 $video = video_get_info_by_guid( $videos[0] ); 29 $api_data = video_get_single_response( $video ); 30 $formats = array( 'fmt_std' => 'Low', 'fmt_dvd' => 'Med', 'fmt_hd' => 'High', 'fmt1_ogg' => 'Low' ); 30 31 $mp4_links = array(); 31 $ogg_link = NULL; 32 $ogg_link = false; 33 32 34 foreach ( $formats as $format => $name ) { 33 35 if ( 'fmt1_ogg' == $format ) { 34 36 $link = video_highest_resolution_ogg( $video ); 35 37 } else { 38 39 // Check if HLS transcoded, no audio, no need to link to it. 40 if ( ! empty( $api_data['files'][ str_replace( 'fmt_', '', $format ) ]['hls'] ) ) { 41 continue; 42 } 43 36 44 $link = video_url_by_format( $video, $format ); 37 45 } … … 46 54 $mp4_links[] = "<a href='$link'>$name</a>"; 47 55 } 56 } 57 58 if ( ! empty( $api_data['original'] ) ) { 59 $mp4_links[] = "<a href='{$api_data['original']}'>Original</a>"; 48 60 } 49 61
Note: See TracChangeset
for help on using the changeset viewer.