Skip to content

Canary v3.0.0 - Updating state variables through the player with fallback = false restarts the video #1905

@suuf

Description

@suuf

Current Behavior

In canary v3.0.0, when I use fallback = false, whenever any state variable updated from the player has an updated value, the video starts again from the beginning.

Expected Behavior

The video should continue to play.

Steps to Reproduce

  1. Use a state variable like const [isPlaying, setIsPlaying] = useState<boolean>(false);
  2. Use fallback = false (or fallback={false as unknown as ReactElement})
  3. Update the state variable using a player prop, like:
onPause={() => {
    setIsPlaying(!isPlaying);
}}
  1. Let the video play/pause it to trigger the change of your state variable.
  2. The video starts again from the beginning.
  • fallback={false as unknown as ReactElement} is typed like this as fallback cannot be false with the current typings in v3.
  • The state variable needs to have an updated value for the restart to happen.

Environment

  • URL attempting to play: Any URL
  • Browser: Chromium
  • OS: Windows
  • Preview: Stackblitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions