Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSuspend media after navigation #24223
Conversation
highfive
commented
Sep 16, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Sep 16, 2019
|
r? @jdm |
|
Have you checked if this works with going forwards and backwards in session history as well? |
|
Unfortunately, it only works with navigations :\ I'm trying to fix session history browsing as well. |
|
r? @jdm It now works with session history browsing as well. It suspends/resume the media action based on the document activity, so browsing to a different context while playing some audio or video pauses playback and it resumes it where you left it if you browse back to that context. |
|
This looks nice and clean! |
|
|
|
Have you considered that this might suffer from a similar issue as noted at #24211, in the sense that, in multiprocess mode, the operations performed in the constellation might not affect the media instance used in script since The proposed changes could make the current workflow more robust to an eventual refactoring required to make media fully support multiprocess. |
| let child_activity = if activity == DocumentActivity::Inactive { | ||
| media.suspend(&client_context_id); |
This comment has been minimized.
This comment has been minimized.
gterzian
Sep 19, 2019
•
Member
The problem with doing those operations in the constellation is that the media instance will differ from the one in script, if Servo is running in multiprocess mode.
Have you considered doing the suspend and resume operations in script when the document activity changes?
You could move those operations to
servo/components/script/dom/document.rs
Line 496 in 7b653ca
This comment has been minimized.
This comment has been minimized.
| servo-media-gstreamer = { git = "https://github.com/ferjm/media", branch = "suspend" } | ||
| servo-media-audio = { git = "https://github.com/ferjm/media", branch = "suspend" } | ||
| servo-media-player = { git = "https://github.com/ferjm/media", branch = "suspend" } | ||
| servo-media-streams = { git = "https://github.com/ferjm/media", branch = "suspend" } |
This comment has been minimized.
This comment has been minimized.
ceyusa
Sep 19, 2019
Collaborator
this is temporal, right?
suspend branch is behind current media master
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=jdm,gterzian |
|
|
Suspend media after navigation - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #21989 and fix #22763 - [ ] I am not sure how to test this This depends on servo/media#310 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24223) <!-- Reviewable:end -->
|
|
|
@bors-servo retry
|
|
|
Suspend media after navigation - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #21989 and fix #22763 - [ ] I am not sure how to test this This depends on servo/media#310 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24223) <!-- Reviewable:end -->
|
|
ferjm commentedSep 16, 2019
•
edited by atouchet
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis depends on servo/media#310
This change is