mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-28 09:42:55 +00:00
assets/scripts.js: Allow #t12345 hash syntax
Similar to YouTube's ?t=12345. Mostly for debugging.
This commit is contained in:
parent
363b1e32a8
commit
776c2d1aaa
1 changed files with 11 additions and 6 deletions
|
@ -472,11 +472,16 @@ function playHash(hash) {
|
||||||
return;
|
return;
|
||||||
lastHash = hash;
|
lastHash = hash;
|
||||||
if (hash) {
|
if (hash) {
|
||||||
let loc = hash.slice(1).split('/');
|
hash = hash.slice(1);
|
||||||
let segmentId = loc[0];
|
if (hash[0] == 't')
|
||||||
if (loc.length > 1)
|
seek(Number(Math.round(hash.slice(1) * 1000.0)));
|
||||||
seek(momentsBySegment[segmentId][loc[1]].startMs);
|
else {
|
||||||
else
|
let loc = hash.split('/');
|
||||||
seek(getSegmentMs(segmentId));
|
let segmentId = loc[0];
|
||||||
|
if (loc.length > 1)
|
||||||
|
seek(momentsBySegment[segmentId][loc[1]].startMs);
|
||||||
|
else
|
||||||
|
seek(getSegmentMs(segmentId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue