asciinema icon indicating copy to clipboard operation
asciinema copied to clipboard

Breakpoints

Open ku1ik opened this issue 5 years ago • 1 comments

This one adds breakpoints - locations in the recording which allow the player to auto-pause when one is encountered.

A breakpoint is new "b" event type in asciicast stream, with optional annotation (comment) as event data.

To add a breakpoint during recording session press a hotkey (e.g. ctrl+b).

To add breakpoints to existing recording you add "b" events like this:

...
[1.000000, "o", "some text"]
[2.500000, "b", ""]
[3.750000, "o", "more text"]
[4.500000, "b", "chapter 5"]
...

Similarly to #340, the hotkey for adding a breakpoint is hard-coded at the moment to ctrl+b ("b" for breakpoint), but it is very likely to conflict with many interactive applications (e.g. vim), so we may want to find a better one, or go with a prefix + key (like ctrl+a <key> combo used in GNU screen, ctrl+b <key> in tmux).

  • [x] support for breakpoints in asciicast v2 event stream
  • [x] setting breakpoint during recording session via hotkey
  • [ ] documentation
  • [ ] find good default hotkey, and/or hotkey prefix (like GNU screen, tmux)
  • [ ] implement pause-on-breakpoint mode for asciinema play command (opt-in with sth like -b/--breakpoints switch)
  • [ ] jump to next breakpoint during asciinema play with hotkey (>)

ku1ik avatar Mar 17 '19 17:03 ku1ik

@sickill what about giving an optional name to a breakpoint : a such breakpoint can then be considered as a "chapter" (like in youtube) ?

-> we could then display chapters into individual video page

abernier avatar Jul 23 '22 09:07 abernier

Allowing optional names for breakpoints to treat them as "chapters" or "bookmarks" sounds good :+1: That was actually what I meant by "comment" in the desc of the PR.

ku1ik avatar Mar 21 '23 18:03 ku1ik

Bringing this PR from the dead :rocket:

ku1ik avatar Apr 24 '23 20:04 ku1ik