mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -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 start = Math.floor(t2d(timeMatch[1]));
|
||||||
const end = Math.floor(t2d(timeMatch[2]));
|
const end = Math.floor(t2d(timeMatch[2]));
|
||||||
|
|
||||||
const urlArr = vttUrl.split('/');
|
let url = textMatch[1];
|
||||||
urlArr.pop();
|
const isAbsoluteUrl = /^\/|((https?|ftp|file):\/\/)/i.test(url);
|
||||||
urlArr.push(textMatch[1]);
|
if (!isAbsoluteUrl) {
|
||||||
const url = urlArr.join('/');
|
const urlArr = vttUrl.split('/');
|
||||||
|
urlArr.pop();
|
||||||
|
urlArr.push(url);
|
||||||
|
url = urlArr.join('/');
|
||||||
|
}
|
||||||
|
|
||||||
const result = { start, end, url };
|
const result = { start, end, url };
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user