Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
31 | private static function generateContents(array $representations, string $filename): string |
||
32 | { |
||
33 | $content = ["#EXTM3U", "#EXT-X-VERSION:3"]; |
||
34 | foreach ($representations as $rep) { |
||
35 | $content[] = "#EXT-X-STREAM-INF:BANDWIDTH=" . $rep->getKiloBitrate() * 1024 . ",RESOLUTION=" . $rep->getResize(); |
||
36 | $content[] = pathinfo($filename, PATHINFO_FILENAME) . "_" . $rep->getHeight() . "p.m3u8"; |
||
37 | } |
||
38 | |||
39 | return implode(PHP_EOL, $content); |
||
40 | } |
||
41 | } |