Added back getYouTubeVideoStartTime

This commit is contained in:
Official Noob
2019-08-23 17:19:44 +01:00
committed by GitHub
parent fc4da038e9
commit a2af4dba52

View File

@@ -37,4 +37,15 @@ function getYouTubeVideoID(url) {
return false; return false;
} }
} }
} return false;
}
//returns the start time of the video if there was one specified (ex. ?t=5s)
function getYouTubeVideoStartTime(url) {
let searchParams = new URL(url).searchParams;
let startTime = searchParams.get("t");
if (startTime == null) {
startTime = searchParams.get("time_continue");
}
return startTime;
}