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
Add <audio> and <video> player backends #21543
Conversation
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @mbrubeck (or someone else) soon. |
Heads up! This PR modifies the following files:
|
☔ The latest upstream changes (presumably #21509) made this pull request unmergeable. Please resolve the merge conflicts. |
9a4d088
to
3d3a86d
Compare
I'm unable to get this to render at all -- can you share the testcase you're using? I'm just using the one from W3schools since it's very simple. |
r? @nox could you take a look at the DOM changes, please? r? @Manishearth @mrobinson could you review the layout changes, please? Thanks! |
r? @Manishearth |
I already replied on IRC, but for reference, in case anyone else wants to try this, this example should work. |
Cargo.toml
Outdated
@@ -27,3 +27,5 @@ opt-level = 3 | |||
# | |||
# [patch."https://github.com/servo/<repository>"] | |||
# <crate> = { path = "/path/to/local/checkout" } | |||
[patch."https://github.com/servo/media"] | |||
servo-media = { git = "https://github.com/ferjm/media", branch = "framerenderer" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be gone once #21325 is merged
@@ -570,6 +570,9 @@ pub struct ScriptThread { | |||
|
|||
/// The Webrender Document ID associated with this thread. | |||
webrender_document: DocumentId, | |||
|
|||
/// FIXME(victor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ceyusa could you elaborate more on what needs to be fixed here exactly, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the wrong tag. It is not a fixme but a xxx, perhaps. What I mean is it would be nice to rethink this design. Perhaps it is better to create a proxy object to keep the RenderApiSender for the servo-media, rather than pass it all along from constellation to document to html element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think process isolation wise script should not have access to this, cc @asajeffrey
A proxy approach would be nice. Ideally the network task would directly talk to WR, maybe via constellation
@@ -559,6 +561,8 @@ pub struct InitialScriptState { | |||
pub webvr_chan: Option<IpcSender<WebVRMsg>>, | |||
/// The Webrender document ID associated with this thread. | |||
pub webrender_document: DocumentId, | |||
/// FIXME(victor): The Webrender API sender in this constellation's pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ceyusa what needs to be fixed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same I commented above, not a fixme but a request to rethink this approach,
@@ -602,6 +690,7 @@ impl HTMLMediaElement { | |||
.. RequestInit::default() | |||
}; | |||
|
|||
self.setup_media_player(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that this is not the best place to setup the media player. I need to properly read the spec, but I would say that we should be setting it up a bit earlier, and ideally handling any potential setup failure.
@@ -269,6 +352,9 @@ impl HTMLMediaElement { | |||
// Step 2.3.2. | |||
this.upcast::<EventTarget>().fire_event(atom!("pause")); | |||
|
|||
//FIXME(victor) | |||
//this.player.pause(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be uncommented once we update servo-media to its latest revision (after #21325 lands)
Hm, so it's not that they're stacked behind, it's that they seem to get laid out as 0x0 boxes at (0,0). Curious. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DOM side approach looks okay, though we might want to rethink the sender stuff.
Any progress on figuring out what's going on with layout? cc @mbrubeck @mrobinson
☔ The latest upstream changes (presumably #21723) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors-servo try |
Add <audio> and <video> player backends These patches enables audio and video playing inside Servo. It is bit hackish way to enable it, thus the purpose of this pull request is for an early request for comments. It is tested with the current servo-media GStreamer backend in Linux. ~~The produced layout is not correct, since the elements after the video seems to be stacked behind, and the same with the scrolling bars.~~ ~~There is no JavaScript interface yet~~, neither controls. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [X] These changes fix #6711 <!-- 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/21543) <!-- Reviewable:end -->
💔 Test failed - mac-rel-wpt3 |
The crash looks unrelated to this PR. |
@bors-servo r=Manishearth |
📌 Commit 7e6661d has been approved by |
⚡ Previous build results for android, android-x86, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt4, status-taskcluster, windows-msvc-dev are reusable. Rebuilding only mac-rel-wpt3... |
☀️ Test successful - android, android-x86, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, status-taskcluster, windows-msvc-dev |
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
Revert "Disable event_timeupdate_noautoplay test on mac" Hopefully the builders now have the right gstreamer things. From #21543 , needs servo/saltfs#898 <!-- 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/21895) <!-- Reviewable:end -->
These patches enables audio and video playing inside Servo.
It is bit hackish way to enable it, thus the purpose of this pull request is for an early request for comments.
It is tested with the current servo-media GStreamer backend in Linux.
The produced layout is not correct, since the elements after the video seems to be stacked behind, and the same with the scrolling bars.There is no JavaScript interface yet, neither controls../mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is