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

expo-av video style requires workaround to scale correctly on web #21140

Open
SleeplessByte opened this issue Feb 9, 2023 · 1 comment
Open

Comments

@SleeplessByte
Copy link

Summary

Initially reported in #20199 with a "fix" given in #20199 (comment), which isn't really a fix but a workaround, but more importantly, it's undocumented.

In fact, the official example from the docs has this issue.

Workaround

One must use the videoStyle prop (yay, it was added, which is nice) and use it to:

  • set position to relative, but only on Web, because if you do this for Android/iOS, it will break the video and it won't display.
  • set exact width and heights (which isn't very responsive)

Resolution

At minimum the docs could be updated to clarify more and explain how to do this the right way. I use:

videoStyle={Platform.OS === 'web' ? { position: 'relative' } : undefined}

...because it retains all the properties of the container (responsiveness etc).

In the long term, a fix to standardize the implementation could be found?

What platform(s) does this occur on?

Web

Environment

  expo-env-info 1.0.5 environment info:
    System:
      OS: Windows 10 10.0.22621
    Binaries:
      Node: 16.19.0 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
      Yarn: 3.4.1 - ~\scoop\apps\nvm\current\nodejs\nodejs\yarn.CMD
      npm: 8.19.3 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD
    npmPackages:
      @expo/webpack-config: ^0.17.4 => 0.17.4
      expo: ^47.0.13 => 47.0.13
      react: 18.1.0 => 18.1.0
      react-dom: 18.1.0 => 18.1.0
      react-native: 0.70.5 => 0.70.5
      react-native-web: ~0.18.12 => 0.18.12
    Expo Workflow: managed

Minimal reproducible example

https://snack.expo.dev/@derk-jan/video

@SleeplessByte SleeplessByte added the needs validation Issue needs to be validated label Feb 9, 2023
@brentvatne brentvatne added Issue accepted and removed needs validation Issue needs to be validated labels Feb 10, 2023
@expo-bot
Copy link
Collaborator

Thank you for filing this issue!
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.

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

3 participants