diff --git a/projects/plugins/jetpack/changelog/update-videopress-video-url-hls b/projects/plugins/jetpack/changelog/update-videopress-video-url-hls new file mode 100644 index 0000000000000..ba2844b9bdcd8 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-videopress-video-url-hls @@ -0,0 +1,4 @@ +Significance: minor +Type: compat + +VideoPress file url field now displays the HLS playlist if one was generated. The fragmented mp4 file is not meant to be played on its own. MP4 file will only be displayed as the video url if it was created prior to the HLS update. diff --git a/projects/plugins/jetpack/modules/videopress/utility-functions.php b/projects/plugins/jetpack/modules/videopress/utility-functions.php index 370bf74932843..4dfc56ebcba4e 100644 --- a/projects/plugins/jetpack/modules/videopress/utility-functions.php +++ b/projects/plugins/jetpack/modules/videopress/utility-functions.php @@ -731,7 +731,11 @@ function videopress_get_attachment_url( $post_id ) { return null; } } else { - $return = $meta['videopress']['file_url_base']['https'] . $meta['videopress']['files']['hd']['mp4']; + $return = $meta['videopress']['file_url_base']['https'] . ( + isset( $meta['videopress']['files']['hd']['hls'] ) + ? $meta['videopress']['files']['hd']['hls'] + : $meta['videopress']['files']['hd']['mp4'] + ); } // If the URL is a string, return it. Otherwise, we shouldn't to avoid errors downstream, so null.