fix to m3u8

This commit is contained in:
Brooke Vibber 2021-11-03 11:16:06 -07:00
parent a105f49742
commit ece8847b9c

View file

@ -137,6 +137,11 @@ foreach ( $lines as $line ) {
if ( preg_match( '/^#EXTINF:\s*(\d+(?:\.\d+)?),/', $line, $matches ) ) {
$duration = floatval( $matches[1] );
}
if ( preg_match( '/^#EXT-X-VERSION:(.*)/', $line, $matches ) ) {
if ( intval( $matches[1] ) < 4 ) {
$line = "#EXT-X-VERSION:7";
}
}
if (preg_match( '/^#/', $line ) ) {
$lines_out[] = $line;
continue;