Skip to content

MediaPlayer producing empty video.src attribute when it has never been part of the viewport #1548

Closed
@MatthewHerbst

Description

@MatthewHerbst

Current Behavior:

When the MediaPlayer has not been made part of the viewport (such as when it is rendered below the "fold" of the page) it does not have a valid src attribute.

Expected Behavior:

The src attribute should always be valid.

Steps To Reproduce:

  1. See this CodeSandbox
  2. Without scrolling, inspect the page source and find the video element
  3. Notice that it does not have a src property
    Screenshot 2024-12-24 at 4 31 26 PM
  4. Scroll the page so that the video element comes into view
  5. Notice how the video element now has a valid src property

Reproduction Link:

CodeSandbox

Environment:

  • Framework: React v19.0.0
  • Device: MacBook Pro 16-inch, 2021
  • OS: MacOS Sonoma v14.7.1
  • Browser: Chrome v131

Anything Else?

This issue was originally reported as MatthewHerbst/react-to-print#772

I am the maintainer of react-to-print the library this issue was initially reported against.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions