Piped icon indicating copy to clipboard operation
Piped copied to clipboard

Allow timecode to be used as timestamp in Share Modal

Open thecashewtrader opened this issue 3 years ago • 2 comments

Currently, the share modal only allows timestamp to be in seconds. This PR allows the timestamp to be in seconds as well as in HH:MM:SS format.

Some points to note:

  • Currently, YouTube has a bit confusing of a policy about maximum video duration, as stated in #1672. Therefore, this PR parses the timecode string manually instead of using something like Intl.DateFormat.
  • Currently, in the HH:MM:SS format, the seconds/minutes/hours value can be more than expected, which is handled without errors. For example: 10:61 will return &t=661. This can be changed if intended, but imo it's quite convenient.
  • It would be required to update the actions.time_code translations to reflect the new changes.

thecashewtrader avatar Nov 03 '22 16:11 thecashewtrader

I fail to understand what's wrong with the current mechanism, is the number overflowing? (I highly doubt that's the case)

FireMasterK avatar Nov 03 '22 16:11 FireMasterK

I fail to understand what's wrong with the current mechanism, is the number overflowing? (I highly doubt that's the case)

imo it's more convenient to put in a HH:MM:SS string than a raw number, as you don't have to do the calculation yourself, especially if it's a long video.

thecashewtrader avatar Nov 03 '22 16:11 thecashewtrader