Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support time tags #361

Open
mayeaux opened this issue Oct 12, 2020 · 1 comment
Open

Support time tags #361

mayeaux opened this issue Oct 12, 2020 · 1 comment

Comments

@mayeaux
Copy link
Owner

mayeaux commented Oct 12, 2020

So you could put something like 0:10 in the description and it would work as expected. Should be pretty simple to do, regexp to match and then change to link with javascript and then player.currentTime is the proper value when clicked.

@BassOfBass
Copy link
Collaborator

BassOfBass commented Oct 12, 2020

Are you talking about <time> html tag? Pretty sure the way YT does timestamps is semantically wrong and way too automated, as it will style any string in XX:XX format to a timestamp, which may not be the case.
IMO the decision to put a timestamp should be left up to the commenter/uploader and thus it should be a separate button in the editor.

As an inline html element it would look like this:

<button class="vidtimestamp">
  <time datetime=`PT${hours}H${minutes}M${seconds}S`>
    `${userPrefTimeStamps}`
  </time>
</button>

The <button> because it is an interactive element (clicking on it presumably changes the timestamp and focuses on the video), but it doesn't need to be styled as a full blown button, just cursor: pointer and some coloring on the text will be enough.
The HTMLVideoElement interface allows the direct manipulation of the <video>, without the hacky way YT does it through GET links. And none of this will require regexp pattern matching, as datetime attribute in <time> tag stores the value in the machine-friendly format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants