From a2af4dba524913123f85de61fe18350b9d6c30ea Mon Sep 17 00:00:00 2001 From: Official Noob <31563761+OfficialNoob@users.noreply.github.com> Date: Fri, 23 Aug 2019 17:19:44 +0100 Subject: [PATCH] Added back getYouTubeVideoStartTime --- utils.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/utils.js b/utils.js index e0954047..a4eba321 100644 --- a/utils.js +++ b/utils.js @@ -37,4 +37,15 @@ function getYouTubeVideoID(url) { return false; } } -} \ No newline at end of file + 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; +}