Skip to content

Commit 0578d00

Browse files
[BUGFIX] Parsing timecode in TableOfContent Chapter-Links for A/V Media Files (#1673)
Co-authored-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
1 parent 09acd45 commit 0578d00

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Resources/Private/JavaScript/SlubMediaPlayer/SlubMediaPlayer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ export default class SlubMediaPlayer extends DlfMediaPlayer {
253253
}
254254
}
255255

256-
// Attempt: Parse timecode hash in URL ("#timecode=120;fileId=FILE_0000_DEFAULT_MPD,FILE_0000_DEFAULT_HLS")
257-
const timecodeMatch = link.hash.match(/timecode=(\d+(?:\.\d?)?)(?:;fileIds=([a-zA-Z0-9_,]+))?/);
256+
// Attempt: Parse timecode hash in URL. Accepts URLs with hashes like:
257+
// #timecode=120;fileIds=FILE_0000_DEFAULT_MPD,FILE_0000_DEFAULT_HLS
258+
// #timecode=123.456;fileIds=uuid-0aabcd1e-12a3-xxx,uuid-0aabcd1e-12a3-yyy
259+
const timecodeMatch = link.hash.match(/#timecode=(\d+(?:\.\d+)?)(?:;fileIds=([\w,-]+))?/);
258260
if (timecodeMatch !== null) {
259261
const timecode = Number(timecodeMatch[1]);
260262
if (Number.isFinite(timecode)) {

0 commit comments

Comments
 (0)