Skip to content

Controls stop working when trying to replay after end of recording on paused state #282

@luizhf42

Description

@luizhf42

Describe the bug
When the player reaches the end of recording in paused state (through seek or fast-forwarding the playback with keyboard shortcuts), and then tries to play again, the controls stop working, and an uncaught error is thrown.

To Reproduce
Steps to reproduce the behavior:

  1. Start playing normally
  2. Pause the playback
  3. Press right arrow until reaching the end, still on pause
  4. After ending, press the play button or space

Controls stop working (except fullscreen and keyboard shortcuts buttons/shortcuts), and an uncaught error is thrown in the console.

Expected behavior
The recording replay normally, just like when the end of the recording is reached in playing state.

Versions:

  • OS: Pop!_OS 22.04 LTS 64-bit
  • Browsers: Brave 1.76.82 - Chromium 134.0.6998.178 | Firefox 137
  • asciinema player: 3.9.0

Additional context
Error (tried to replay using space shortcut):

Uncaught (in promise) already ended
  | Promise.then 
  | _enqueueCommand @ asciinema-player.js?v=d4cfb7fc:2569
  | _withState      @ asciinema-player.js?v=d4cfb7fc:2566
  | togglePlay      @ asciinema-player.js?v=d4cfb7fc:2503
  | onKeyDown       @ asciinema-player.js?v=d4cfb7fc:4676
  | eventHandler    @ asciinema-player.js?v=d4cfb7fc:3560

error screenshot

That's the PR making the player implementation in Shellhub, and the source of the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions