YouTube Timestamps Component

AI-generated summary

The discussion revolves around the YouTube Timestamps Component, a plugin that converts timestamps in posts into clickable hyperlinks to a YouTube video associated with the topic. balupton explains its functionality and provides examples of its use, noting that it currently does not work in Firefox due to unsupported named capture groups in regular expressions 5. jordan.vidrine reports the issue in Firefox, and balupton confirms the limitation and updates the documentation accordingly. However, support is expected in Firefox v78, which is set to release soon 11. Users also report issues such as incorrect timestamp parsing 12 and a desire for the timestamps to play the video directly from the post 14. balupton invites contributions and maintains the plugin on GitHub. The component appears to have stopped working for some users 16.

Converts timestamps within a post, to timestamp hyperlinks to the post’s (otherwise the topic’s) associated YouTube video.

https://github.com/bevry/discourse-component-youtubetimestamps

See it in action here

Note: Firefox is currently unsupported.

15 Likes

Seems like a great plugin. Unless I am misunderstanding the plugin’s purpose, the example topics you’ve supplied don’t seem to be displaying the links as timestamps though.

5 Likes

Which browser are you using? Has been working fine for me on chrome and safari.

1 Like

I used Firefox to test this out. I can confirm that viewing in chrome does work though.

Looking in dev tools for FireFox this is whats rendered in html for each timestamp:

<li>
<p>0:00 - what are the constants of experience?</p>
</li>

In chrome, this is whats rendered:

<li>
<p><a href="https://www.youtube.com/watch?v=yXZSeiAl4PI&amp;t=0s" title="View the video yXZSeiAl4PI at 00s">00s</a> — recap of jung, archetypes</p>
</li>
3 Likes

So checked the console in Firefox and got SyntaxError: invalid regexp group errors.

Turns out Firefox doesn’t supported named capture groups for regular expressions:

Going to mark Firefox as unsupported, however seems they are working on it - perhaps will land by the end of the year looking at current progress on their side.

Will update the readmes accordingly, thanks for the heads up!

3 Likes

@jordan.vidrine

An update on Firefox support. The functionality has landed in the upcoming Firefox v78 which will be released next week:

3 Likes

Hey folks, seems like whatever time stamp I use, it picks 00s

Using a format like 2:20:23 - hrs mins secs or 2:23 min secs. Could you help?

If the timestamps could link to the YouTube video in the OP and make it play from there rather than redirecting to YouTube essentially mirroring their native comments timestamp function that would be game-changing. I think it may be possible by setting up a function to append the URL of the YouTube video in the OP with &t= and whatever value the timestamp is upon click and then playing it?

1 Like

This component is indie open-source so please submit fixes to:
https://github.com/bevry/discourse-component-youtubetimestamps

Happy to add additional maintainers.

2 Likes

Doesn’t work anymore?

1 Like