Skip to content

🐛 BUG: YouTube player restarts from beginning if you resize window while playing #1991

@zshall

Description

@zshall

What went wrong? 🤔

This can easily be reproduced on Windows with a maximized browser window being restored or dragged out of a tab to a new tab.

Embedded YouTube videos will stop playing when you resize the browser because the modal dialog they're in is hidden when the browser goes below a certain size. You then need to restart the video from the beginning.

Image

Expected Behavior

The embedded YouTube player will continue playing if it started playing, regardless of the size of the browser.

Steps to Reproduce Issue

- Open Daily.dev in a browser window over 1000px wide.
- Open a post in a modal dialog with an embedded YouTube video.
- Play the video.
- While video is playing, resize the browser window to a smaller size (less than 1000px)

The video will stop playing since the modal is now hidden.

Resize the window to a larger size and the modal will recreate itself but the video will be stopped.

Solution Proposed

Would it be possible to hide the YouTube player without destroying the instance?

Screenshots

No response

Environment

No response

Browsers

Brave

OS

Windows

Version of daily.dev

No response

Additional Context

Code of Conduct

  • I follow the conditions of this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions