Open Bug 1807968 Opened 2 years ago Updated 2 years ago

Changing playbackRate on local videos near the end makes them pause

Categories

(Core :: Audio/Video: Playback, defect, P3)

Firefox 110
x86_64
Windows 10
defect

Tracking

()

People

(Reporter: wofwca, Unassigned)

Details

Attachments

(4 files)

Attached video demo.mp4

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Steps to reproduce:

  1. Open a local video file in the browser. (this one, for example https://user-images.githubusercontent.com/39462442/131825020-5308b879-0509-41a3-95c9-bb4ad8938dc0.mp4)
  2. When about 4 seconds or closer until the end of the video, change playbackRate to a high value, like 4.

The same, with JS:

v = document.querySelector('video')
v.playbackRate = 1;
v.currentTime = v.duration - 2;
v.play().then(() => {
    setTimeout(() => {
        v.playbackRate = 4;
    }, 1000);
});

Actual results:

Sometimes (90% of the time) it pauses as soon as you change the playback rate.
The controls show the "pause" button, indicating that it's not really "paused". v.paused is true though, but no 'pause' event gets fired.

Expected results:

Playback continues as usual, at the new playbackRate.

Context: it's quite bad for extensions like https://github.com/WofWca/jumpcutter, which switch playbackRate very often.

Extra info: yes, it appears to not affect non-local videos. And it does affect media loaded with

objectURL = URL.createObjectURL(file);
videoEl.src = objectURL;
Component: Untriaged → Audio/Video: Playback
OS: Unspecified → Windows 10
Product: Firefox → Core
Hardware: Unspecified → x86_64
Version: Firefox 108 → Firefox 110

I could not reproduce the issue on Win10x64 and Firefox 110.0a1(20221230044034). Once I put the JS text on console the video just stopped playing and the playing button is being displayed. Is there something that I am missing?
Also does the issue reproduce with a new and empty profile? See https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems#w_6-create-a-new-firefox-profile
Thank you.

Flags: needinfo?(wofwca)

I'm testing on 110.0a1 as well (Nightly). I could reproduce it with a new profile too.

Once I put the JS text on console the video just stopped playing and the playing button is being displayed

What do you mean? Did it play back through the end? Maybe try higher playback rate or change it closer to the end of the video.

Flags: needinfo?(wofwca)

Another thing I forgot to mention: it actually does get "unpaused" after like a minute (legit) since the playbackRate change.

(In reply to wofwca from comment #4)

I'm testing on 110.0a1 as well (Nightly). I could reproduce it with a new profile too.

Once I put the JS text on console the video just stopped playing and the playing button is being displayed

What do you mean? Did it play back through the end? Maybe try higher playback rate or change it closer to the end of the video.

What I meant was that after I changed the playback rate to 4 or 8 the video ended instantly, and I did not see a pause button on the video but a play button. Thank you.

Marking issue as new for developers input, based on comment #4.

Status: UNCONFIRMED → NEW
Ever confirmed: true

I tried it around 20 times in a row, and I couldn't reproduce this issue on 110.0a1 Nightly on Windows 10.

Could you help me do following steps in order to capture a profiled result?


  1. Go to about:logging
  2. Click "Logging preset" drop down menu and select "Media playback"
  3. Then you should see those modules’ name displaying below “Current Log Modules”
  4. Go to https://profiler.firefox.com/
  5. Select “media” preset in the profiler's drop down menu
  6. Click “start recording” in the profiler's drop down menu
  7. Go to the site where you can reproduce the issue
  8. After issue happens, click “Capture” to end recording
  9. In the profiled result page, click “Upload Local Profile” which is on the top left0
  10. Ensure all clicked boxes are clicked, and click “Upload”
  11. Paste the permanent link to bugzilla

I also created a video which you can follow. Thanks!

Flags: needinfo?(wofwca)

The profile. https://share.firefox.dev/3ZhDzcE
I've also attached the screen capture.

Flags: needinfo?(wofwca)

From the profiled result, it seems that we stuck on the buffering state and never left that state. MDSM stopped requesting data, and it seems we also didn't set mCanPlayThrough to true before. But it's still unclear to me why this would happen, need more investigation.

Severity: -- → N/A
Priority: -- → P3

I wonder if this file works for you? Or the playback would also get stuck after seeking? In addition, if you set the playback to 4 in the beginning, and let the file playing without seeking, would playback also get stuck? or it can play to the end?

Thank you.

Flags: needinfo?(wofwca)
Attached video profile-test-page.mp4

Yeah, it still gets stuck most of the time. What's more interesting (to me) is that it does get stuck on the page you've composed, but up to this point I had not managed to reproduce it for non-local videos.

And yes, if I set playback rate earlier, it plays it through the end normally. And let me reiterate - it gets stuck not when I seek, but when I change the playbackRate.

Here's the profile: https://share.firefox.dev/3CveuB5
And I've attached screen recording again.

Flags: needinfo?(wofwca)

I tried it in:

Firefox 108.0.2 (64-bit)
Tor Browser 12.0.1 (based on Mozilla Firefox 102.6.0esr) (64-bit)
Firefox Nightly 110.0a1 (2023-01-06) (64-bit)

Same stuff.

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)
Severity: N/A → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: