mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 04:36:15 -08:00
1 parent
1fe653e3c3
commit
cafff9b155
2 files changed
+8
-4
No files matched your search
@@ -43,10 +43,14 @@ export default async function getVttArray(vttUrl = '') {
|
||||
const start = Math.floor(t2d(timeMatch[1]));
|
||||
const end = Math.floor(t2d(timeMatch[2]));
|
||||
|
||||
const urlArr = vttUrl.split('/');
|
||||
urlArr.pop();
|
||||
urlArr.push(textMatch[1]);
|
||||
const url = urlArr.join('/');
|
||||
let url = textMatch[1];
|
||||
const isAbsoluteUrl = /^\/|((https?|ftp|file):\/\/)/i.test(url);
|
||||
if (!isAbsoluteUrl) {
|
||||
const urlArr = vttUrl.split('/');
|
||||
urlArr.pop();
|
||||
urlArr.push(url);
|
||||
url = urlArr.join('/');
|
||||
}
|
||||
|
||||
const result = { start, end, url };
|
||||
|
||||
|
||||
Reference in new issue
Block a user