Skip to content

Conversation

@yerke
Copy link
Contributor

@yerke yerke commented Dec 18, 2025

GStreamerPlayer should resume playback only if it was playing on suspend

Fixes #480 and servo/servo#41281.

Testing:

Test case 1: does not resume if it was not playing on suspend

<!doctype html>
<audio preload="auto" networkstate="0"><source src="https://fairysvoice.net/games/Fire_Triss/html5game/an1.mp3" type="audio/mp3"></audio>
<a href="https://example.org">CLICK THIS THEN GO BACK</a>

Steps:

  • Music should not be playing when the page loads.
  • Click the link, then hit the back button.
  • Music should not be playing.

Test case 2: resumes if it was playing on suspend

<!doctype html>
<audio preload="auto" autoplay="true"><source src="https://fairysvoice.net/games/Fire_Triss/html5game/an1.mp3" type="audio/mp3"></audio>
<a href="https://example.org">CLICK THIS THEN GO BACK</a>

Steps:

  • Music should be playing when the page loads.
  • Click the link, then hit the back button.
  • Music should resume playing.

Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
@yerke
Copy link
Contributor Author

yerke commented Dec 18, 2025

@jdm Do you mind taking a look since you are familiar with servo/servo#41281? Thanks.

Copy link
Contributor

@ceyusa ceyusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jdm jdm enabled auto-merge December 19, 2025 14:28
@jdm jdm added this pull request to the merge queue Dec 19, 2025
Merged via the queue into servo:main with commit 0c7edc7 Dec 19, 2025
3 checks passed
@yerke yerke deleted the add-can-resume-playback-state branch December 19, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GStreamerPlayer resumes playback on resume even if it wasn't playing on suspend

3 participants