Skip to content

Captions/Subtitles not visible in portrait fullscreen when using player.requestFullscreen() #1133

@petta

Description

@petta

Hi! 👋

There is a reproducible bug in Vimeo Player.js involving captions/subtitles when fullscreen is triggered programmatically with:

player.requestFullscreen();

When fullscreen is entered this way, captions/subtitles become invisible in portrait orientation.
This occurs originally on Android, but the issue is generic and reproducible in any browser where the viewport height is greater than its width.

If the user enters fullscreen manually via the Vimeo fullscreen button, captions render correctly.


Expected behavior

  • Captions/subtitles should be visible and correctly positioned when entering fullscreen, regardless of whether fullscreen was entered programmatically or manually.

Actual behavior

When fullscreen is triggered via player.requestFullscreen():

  • The iframe player forces incorrect inline styles on the internal #player element:
style="max-width: calc(177.778vh); height: calc(56.25vw);"
  • This causes the rendered video height to shrink or shift incorrectly.
  • The captions/subtitles renderer (vp-captions) is transformed outside the visible video area.
  • As a result, captions appear hidden or pushed above the video in portrait orientation.

When fullscreen is entered using the Vimeo UI fullscreen button:

  • No such inline styles are applied.
  • Captions behave normally and remain visible.

This clearly indicates an internal difference between API-triggered fullscreen and UI-triggered fullscreen.


Tested environments

Desktop

  • macOS (Tahoe 26.1)

    • Chrome
    • Firefox
    • Opera

Mobile

  • Samsung Galaxy A52s 5G — Android 14

    • Chrome
    • Opera
    • Android WebView

Issue is 100% reproducible across all of them.


Steps to reproduce

  1. Load a Vimeo player via Player.js
  2. Programmatically request fullscreen on "play":
player.on('play', () => player.requestFullscreen());
  1. Rotate device to portrait (or simulate using Chrome DevTools mobile mode)
  2. Start playback
  3. Captions/subtitles disappear or are positioned outside the visible frame

If fullscreen is activated manually via the built-in Vimeo button, captions display properly.


Thanks! 🙏 Let me know if you need more debugging information.


Minimal reproducible example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Vimeo Player JS Example</title>
  <script src="https://player.vimeo.com/api/player.js"></script>

  <style>
    body {
      margin: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }

    #vimeo-container {
      width: 100%;
      aspect-ratio: 16 / 9;
    }

    iframe {
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>

  <div id="vimeo-container"></div>

  <script>
    const videoId = 76979871; // Big Buck Bunny (public video)
    const options = {
      id: videoId,
      playsinline: true,
      controls: true,
      fullscreen: true,
      texttrack: 'en'
    };

    const container = document.getElementById('vimeo-container');
    const player = new Vimeo.Player(container, options);

    player.on('play', () => {
      // This triggers the bug: captions become hidden in portrait fullscreen
      player.requestFullscreen();
    });
  </script>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingverified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions