Bug 261512 - Changing the currentTime at loadedmetadata breaks the player
Summary: Changing the currentTime at loadedmetadata breaks the player
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad All
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-13 07:59 PDT by André M.
Modified: 2023-09-20 08:00 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description André M. 2023-09-13 07:59:51 PDT
When a value is assigned to the currentTime property during loadedmetadata, this has the following consequences:

- Playback starts at position 0
- It is no longer possible to change the playback position either via the user interface or via javascript.
- timeupdate events are no longer emitted correctly.

This problem has been observed on iOS 17, 16, 15, 14, 13.

Code sample:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      html,
      body {
        height: 100vh;
        margin: 0;
        padding: 0;
      }
      .player {
        width: 100%;
        height: 50vh;
        height: 50dvh;
      }
    </style>
  </head>
  <body>
    <video
      class="player"
      controls
      playsinline
    ></video>
    <script>
      const player = document.querySelector('.player');

      player.addEventListener('loadstart', () => {
        console.log('loadstart');
      });
      player.addEventListener('loadedmetadata', () => {
        console.log('loadedmetadata', player.duration);
        player.currentTime = 600;
      });
      player.addEventListener('loadeddata', () => {
        console.log('loadeddata');
      });
      player.addEventListener('timeupdate', () => {
        console.log('timeupdate', player.currentTime);
      });

      player.src = 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8';
    </script>
  </body>
</html>
Comment 1 Radar WebKit Bug Importer 2023-09-20 08:00:13 PDT
<rdar://problem/115784490>