Cann't set base path for ts files in downloaded m3u8
vfumin opened this issue · 0 comments
vfumin commented
In new m3u8 file better don't set global path for ts files, because often ts files has same path as m3u8 file, and video player use this. If download several m3u8 in different dirs, you can start one web server on base path and play files like:
start webserver: http://127.0.0.1:8080/ on dir DOWNLOADS
play file: http://127.0.0.1:8080/1/1.m3u8
play file: http://127.0.0.1:8080/2/2.m3u8
play file: http://127.0.0.1:8080/3/3.m3u8
ps. Sorry for my bad english
for i in 0 ..< tsPlaylist.tsSegmentArray.count {
let segmentModel = tsPlaylist.tsSegmentArray[i]
let length = "#EXTINF:\(segmentModel.duration),\n"
let fileName = "http://127.0.0.1:8080/\(segmentModel.index).ts\n"
content += (length + fileName)
}