nodetube
nodetube copied to clipboard
Support time tags
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.
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.