mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-27 17:23:22 +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;
|
||||
lastHash = hash;
|
||||
if (hash) {
|
||||
let loc = hash.slice(1).split('/');
|
||||
let segmentId = loc[0];
|
||||
if (loc.length > 1)
|
||||
seek(momentsBySegment[segmentId][loc[1]].startMs);
|
||||
else
|
||||
seek(getSegmentMs(segmentId));
|
||||
hash = hash.slice(1);
|
||||
if (hash[0] == 't')
|
||||
seek(Number(Math.round(hash.slice(1) * 1000.0)));
|
||||
else {
|
||||
let loc = hash.split('/');
|
||||
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