Skip to content

Commit 361003b

Browse files
committed
Bugfix HLS exporter
1 parent 262094d commit 361003b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/SegmentedExporter.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getFilter(): SegmentedFilter
3333
}
3434

3535
return $this->filter = new SegmentedFilter(
36-
$this->getPlaylistFilename(),
36+
$this->getPlaylistFullPath(),
3737
$this->segmentLength
3838
);
3939
}
@@ -54,6 +54,14 @@ public function saveStream(string $playlistPath): MediaExporter
5454
return $this;
5555
}
5656

57+
public function getPlaylistFullPath(): string
58+
{
59+
return implode(DIRECTORY_SEPARATOR, [
60+
pathinfo($this->playlistPath, PATHINFO_DIRNAME),
61+
$this->getPlaylistFilename(),
62+
]);
63+
}
64+
5765
public function getSegmentFullPath(): string
5866
{
5967
return implode(DIRECTORY_SEPARATOR, [

tests/SegmentedTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testFilter()
2424

2525
$this->assertInstanceOf(SegmentedFilter::class, $filter);
2626

27-
$this->assertEquals('MyPlaylist_1000.m3u8', $filter->getPlaylistPath());
27+
$this->assertEquals('./MyPlaylist_1000.m3u8', $filter->getPlaylistPath());
2828
$this->assertEquals(20, $filter->getSegmentLength());
2929

3030
$this->assertEquals($filter->apply($media(), $format), [
@@ -37,7 +37,7 @@ public function testFilter()
3737
'-segment_format',
3838
'mpeg_ts',
3939
'-segment_list',
40-
'MyPlaylist_1000.m3u8',
40+
'./MyPlaylist_1000.m3u8',
4141
'-segment_time',
4242
20,
4343
]);

0 commit comments

Comments
 (0)