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

A second loadSource call autoplays primary content immediately. #6839

Closed
5 tasks done
matvp91 opened this issue Nov 12, 2024 · 2 comments · Fixed by #6852 or #6879
Closed
5 tasks done

A second loadSource call autoplays primary content immediately. #6839

matvp91 opened this issue Nov 12, 2024 · 2 comments · Fixed by #6852 or #6879
Labels
Bug Confirmed Interstitials Verify Fixed An unreleased bug fix has been merged and should be verified before closing.
Milestone

Comments

@matvp91
Copy link
Contributor

matvp91 commented Nov 12, 2024

What version of Hls.js are you using?

v1.6.0-beta

What browser (including version) are you using?

Chrome

What OS (including version) are you using?

macOS

Test stream

No response

Configuration

{}

Additional player setup steps

This is a regression compared to v1.5.

A sample with v1.5: https://stackblitz.com/edit/vitejs-vite-fkf2xf
A sample with v1.6-beta: https://stackblitz.com/edit/vitejs-vite-tohum2

The same steps to reproduce result in different behavior, with v1.5 not starting the asset (as it requires a user gesture), but v1.6 does.

Checklist

Steps to reproduce

  1. Click "loadSource".
  2. Click "play".
  3. Click "loadSource" again, and you'll notice that playback starts immediately.

Expected behaviour

A subsequent loadSource call should not start playback when no autoplay attribute is present.

What actually happened?

A subsequent loadSource call starts playback immediately, with autoplay not present on the video element.

Console output

N/A

Chrome media internals output

No response

@matvp91 matvp91 added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Nov 12, 2024
@robwalch robwalch added this to the 1.6.0 milestone Nov 12, 2024
@robwalch robwalch added Confirmed Interstitials and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Nov 12, 2024
@robwalch
Copy link
Collaborator

robwalch commented Nov 16, 2024

Adding Interstitials label even though this is reproducible without Interstitials in the HLS asset. The running theory is that the play() calls in the Interstitial controller are responsible:

      this.resumePrimary(scheduledItem, index);
      if (this.shouldPlay) {
        this.hls.media?.play();
      }

Setting this.shouldPlay = false; on onManifestLoading may fix this.

matvp91 added a commit to matvp91/hls.js that referenced this issue Nov 18, 2024
@robwalch robwalch linked a pull request Nov 18, 2024 that will close this issue
3 tasks
@robwalch robwalch added the Verify Fixed An unreleased bug fix has been merged and should be verified before closing. label Nov 18, 2024
@robwalch robwalch removed the Verify Fixed An unreleased bug fix has been merged and should be verified before closing. label Nov 29, 2024
robwalch added a commit that referenced this issue Nov 30, 2024
- Improve blocking requests with parts and low-latency mode disabled
- Defer autostart until after manifest loasded and level loaded when media playlist is source
Fixes #6858

Interstitial startup fixes
- Added `hls.loadingEnabled` getter
- Do not call startLoad when stopped and do not resume primary on first item
Fixes #6839

(cherry picked from commit 5f2cde23288d70297ac97f85620b11f346755d4c)
robwalch added a commit that referenced this issue Nov 30, 2024
- Improve blocking requests with parts and low-latency mode disabled
- Defer autostart until after manifest loasded and level loaded when media playlist is source
Fixes #6858

Interstitial startup fixes
- Added `hls.loadingEnabled` getter
- Do not call startLoad when stopped and do not resume primary on first item
Fixes #6839
@github-project-automation github-project-automation bot moved this from In Progress to Done in HLS.js Interstitials Dec 3, 2024
@robwalch robwalch added the Verify Fixed An unreleased bug fix has been merged and should be verified before closing. label Dec 3, 2024
@robwalch
Copy link
Collaborator

robwalch commented Dec 3, 2024

Just merged #6879 into dev: https://hlsjs-dev.video-dev.org/demo/

Two changes relative to this issue:

  1. The interstitial-controller only emits INTERSTITIALS_PRIMARY_RESUMED when returning from an Interstitial (no longer emitted on start)
  2. hls.startLoad() will not be called on the primary player if loading is stopped (or hasn't autostarted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed Interstitials Verify Fixed An unreleased bug fix has been merged and should be verified before closing.
Projects
2 participants