Skip to content

Commit 82dd053

Browse files
committed
feat(flv): add path as a String API for FLV muxer and demuxer
1 parent 464c109 commit 82dd053

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

flv/src/commonMain/kotlin/io/github/thibaultbee/krtmp/flv/FLVDemuxer.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ import kotlinx.io.readString
2828
/**
2929
* Creates a [FLVDemuxer] dedicated to read from a file.
3030
*
31-
* @param path the path to the file
31+
* @param path the path to the file as a [String]
32+
* @return a [FLVDemuxer]
33+
*/
34+
fun FLVDemuxer(
35+
pathString: String
36+
) = FLVDemuxer(Path(pathString))
37+
38+
/**
39+
* Creates a [FLVDemuxer] dedicated to read from a file.
40+
*
41+
* @param path the path to the file as a [Path]
3242
* @return a [FLVDemuxer]
3343
*/
3444
fun FLVDemuxer(

flv/src/commonMain/kotlin/io/github/thibaultbee/krtmp/flv/FLVMuxer.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,19 @@ import kotlinx.io.files.SystemFileSystem
3131
/**
3232
* Creates a [FLVMuxer] dedicated to write to a file.
3333
*
34-
* @param path the path to the file
34+
* @param pathString the path to the file as a [String]
35+
* @param amfVersion the AMF version to use
36+
* @return a [FLVMuxer]
37+
*/
38+
fun FLVMuxer(
39+
pathString: String,
40+
amfVersion: AmfVersion = AmfVersion.AMF0
41+
) = FLVMuxer(Path(pathString), amfVersion)
42+
43+
/**
44+
* Creates a [FLVMuxer] dedicated to write to a file.
45+
*
46+
* @param path the path to the file as a [Path]
3547
* @param amfVersion the AMF version to use
3648
* @return a [FLVMuxer]
3749
*/

0 commit comments

Comments
 (0)