Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portrait HLS video loads in corner of video element on iOS 15.5 when switching from display: none #7803

Open
JoshuaCWebDeveloper opened this issue Jun 17, 2022 · 2 comments

Comments

@JoshuaCWebDeveloper
Copy link

Description

In our app, we hide videos using display: none and then show them at the time that we start playing them (linked to a user action). This worked fine with no issues until iOS 15.5 was released.

What currently happens
On iOS 15.5, when a portrait (taller than wide) HLS video is shown via switching off display: none at the same time it is played by videojs-http-streaming for the first time, the video content initially renders in the lower right corner of the video element before re-positioning to take up the full <video> element as expected:

image
image

What I would expect
When playing a video for the first time, even when showing it by switching off display: none, the content, when first rendered, should fill the <video> element as expected.

Additional details and example
A reproducible example with instructions may be found here: https://np4uki.csb.app/.

Even though this bug just started happening in iOS 15.5 (which points to a bug in Safari), I'm reporting it here since it only happens when I play an HLS video using VHS. If I instead use Safari's native HLS playback, this issue does not happen.

Regarding the usage of display: none, there are obviously many different ways to hide and show a video. I'll say two things: 1) we have a strong preference to use display: none due to the robust nature of it, and 2), when experimenting with different strategies (visibility, opacity, and width/height), other somewhat similar issues were encountered (many on iOS 15.5, but some with other versions of iOS as well). A couple of examples are the video at first rendering much larger or much smaller than the <video> element before resizing to fit as expected.

Reduced test case

https://np4uki.csb.app/

Steps to reproduce

See: https://np4uki.csb.app/.

Errors

None

What version of Video.js are you using?

7.19.2

Video.js plugins used.

Built-in videojs-http-streaming

What browser(s) including version(s) does this occur with?

Any browser on iOS 15.5. Tested mostly on Safari 15.5 on iOS 15.5.

What OS(es) and version(s) does this occur with?

iOS 15.5

@JoshuaCWebDeveloper JoshuaCWebDeveloper added bug needs: triage This issue needs to be reviewed labels Jun 17, 2022
@welcome
Copy link

welcome bot commented Jun 17, 2022

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@mister-ben
Copy link
Contributor

I'm reporting it here since it only happens when I play an HLS video using VHS. If I instead use Safari's native HLS playback, this issue does not happen.

VHS is never used on iPhone, as it doesn't support MSE, and not by default on iPad.

The same behaviour can be reproduced frequently on iPhone without Video.js here. Less often it's initially small but centred. Looks like a webkit issue. If you can't hide the video some other way, you might try covering it until the first playing event.

@mister-ben mister-ben added browser bug and removed bug needs: triage This issue needs to be reviewed labels Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants