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

Implementing HTMLMediaElement.volume attribute #22324

Conversation

lucasfantacuci
Copy link
Contributor

@lucasfantacuci lucasfantacuci commented Nov 30, 2018

This P.R. is going to implement the volume attribute to the HTMLMediaElement


  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webidls/HTMLMediaElement.webidl
  • @KiChjang: components/script/dom/webidls/HTMLMediaElement.webidl

@highfive
Copy link

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!

Copy link
Contributor

@KiChjang KiChjang left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this! I only have minor comments, once you address them, please squash your commits and we can land this!

components/script/dom/htmlmediaelement.rs Show resolved Hide resolved
components/script/dom/htmlmediaelement.rs Show resolved Hide resolved
components/script/dom/htmlmediaelement.rs Outdated Show resolved Hide resolved
@jdm
Copy link
Member

jdm commented Nov 30, 2018

Before we merge this, we'll want to pass the volume to the actual player.

@lucasfantacuci
Copy link
Contributor Author

Before we merge this, we'll want to pass the volume to the actual player.

Sorry, I didn't get it.

@jdm
Copy link
Member

jdm commented Dec 3, 2018

Right now all we do is store and retrieve a value from a local member. The volume of the media stream is not affected; we need to add get_volume and set_volume APIs to https://github.com/servo/media/blob/f90235b16d9eb956ad9dba2dbca53e8f25e8b451/player/src/lib.rs#L46 (using the inner_player_proxy macro to call the appropriate backend APIs, so that we can call those methods on self.player in this code. Does that make sense?

@lucasfantacuci
Copy link
Contributor Author

lucasfantacuci commented Dec 3, 2018

Right now all we do is store and retrieve a value from a local member. The volume of the media stream is not affected; we need to add get_volume and set_volume APIs to https://github.com/servo/media/blob/f90235b16d9eb956ad9dba2dbca53e8f25e8b451/player/src/lib.rs#L46 (using the inner_player_proxy macro to call the appropriate backend APIs, so that we can call those methods on self.player in this code. Does that make sense?

Sure, it makes sense, so, I've created this P.R. handling it.

As @ferjm said I don't think get_volume at player trait should be necessary.

@lucasfantacuci lucasfantacuci force-pushed the implement_html_media_element_volume_attribute branch from e00b016 to 207f95e Compare December 3, 2018 12:44
@lucasfantacuci lucasfantacuci changed the title WIP: Implementing HTMLMediaElement.volume attribute Implementing HTMLMediaElement.volume attribute Dec 3, 2018
@ferjm
Copy link
Contributor

ferjm commented Dec 3, 2018

As @ferjm said I didn't realize get_volume at player trait should be necessary.

Yeah, I don't think we need a getter in this case as we have the value already available on the DOM side.

@lucasfantacuci
Copy link
Contributor Author

lucasfantacuci commented Dec 5, 2018

Hi Sirs,
Do I have to do anything else?
Regards,

@ferjm
Copy link
Contributor

ferjm commented Dec 5, 2018

@lucasfantacuci
Copy link
Contributor Author

lucasfantacuci commented Dec 10, 2018

  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/audio_volume_check.html
  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/audio_volume_loudest-manual.html
  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/audio_volume_silent-manual.html
  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/event_volumechange.html
  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/video_volume_check.html
  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/video_volume_loudest-manual.html
  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/video_volume_silent-manual.html
  • tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/volume_nonfinite.html
  • tests/wpt/web-platform-tests/html/dom/interfaces.https.html

@KiChjang
Copy link
Contributor

@bors-servo try=wpt

bors-servo pushed a commit that referenced this pull request Dec 10, 2018
…lume_attribute, r=<try>

Implementing HTMLMediaElement.volume attribute

<!-- Please describe your changes on the following line: -->
Work In Progress. Do not Accept.
This P.R. is going to implement the volume attribute to the HTMLMediaElement

---
<!-- 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 #22292.
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/22324)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

⌛ Trying commit 98d4eab with merge c0e46db...

@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Dec 11, 2018

That failure is #22062.

@ferjm
Copy link
Contributor

ferjm commented Dec 11, 2018

tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/event_volumechange.html

We are missing the volumechange event part. Check the "Whenever either of the values ..." paragraph of the spec. We need to fire that event if volume changes.

tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/audio_volume_loudest-manual.html

Did you try the *-manual ones locally? These are not run automatically and are not listed on the test expectations.

@bors-servo
Copy link
Contributor

⌛ Trying commit 46c4fc7 with merge 0649710...

bors-servo pushed a commit that referenced this pull request Dec 11, 2018
…lume_attribute, r=<try>

Implementing HTMLMediaElement.volume attribute

<!-- Please describe your changes on the following line: -->
Work In Progress. Do not Accept.
This P.R. is going to implement the volume attribute to the HTMLMediaElement

---
<!-- 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 #22292.
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/22324)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-css

@ferjm
Copy link
Contributor

ferjm commented Dec 11, 2018

It seems that this patch makes an extra test pass :). Update the test expectations for /html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document.html and squash the commits please.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #22392) made this pull request unmergeable. Please resolve the merge conflicts.

@lucasfantacuci lucasfantacuci force-pushed the implement_html_media_element_volume_attribute branch from 46c4fc7 to 211f358 Compare December 12, 2018 11:46
@lucasfantacuci lucasfantacuci force-pushed the implement_html_media_element_volume_attribute branch from d43265e to a2020fc Compare December 12, 2018 13:18
@lucasfantacuci
Copy link
Contributor Author

lucasfantacuci commented Dec 12, 2018

It seems that this patch makes an extra test pass :). Update the test expectations for /html/semantics/embedded-content/media-elements/playing-the-media-resource/pause-remove-from-document.html and squash the commits please.

Done sir, And how about this conflict, I don't know what's going on.

@ferjm
Copy link
Contributor

ferjm commented Dec 12, 2018

The merge conflict means that your patch does not apply cleanly on the current master. You need to rebase your patch on top of the current master.

@lucasfantacuci lucasfantacuci force-pushed the implement_html_media_element_volume_attribute branch from a2020fc to e7be09d Compare December 12, 2018 13:42
@lucasfantacuci lucasfantacuci force-pushed the implement_html_media_element_volume_attribute branch from e7be09d to ad3ec61 Compare December 12, 2018 13:51
@ferjm
Copy link
Contributor

ferjm commented Dec 12, 2018

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit ad3ec61 has been approved by ferjm

@highfive highfive assigned ferjm and unassigned Manishearth Dec 12, 2018
bors-servo pushed a commit that referenced this pull request Dec 12, 2018
…lume_attribute, r=ferjm

Implementing HTMLMediaElement.volume attribute

<!-- Please describe your changes on the following line: -->
This P.R. is going to implement the volume attribute to the HTMLMediaElement

---
<!-- 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 #22292.
<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/22324)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

⌛ Testing commit ad3ec61 with merge 0c506ef...

@jdm
Copy link
Member

jdm commented Dec 12, 2018

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit ad3ec61 with merge d5c1690...

bors-servo pushed a commit that referenced this pull request Dec 12, 2018
…lume_attribute, r=ferjm

Implementing HTMLMediaElement.volume attribute

<!-- Please describe your changes on the following line: -->
This P.R. is going to implement the volume attribute to the HTMLMediaElement

---
<!-- 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 #22292.
<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/22324)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android-mac, arm32, arm64, linux-rel-css, linux-rel-wpt, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, magicleap, status-taskcluster
Approved by: ferjm
Pushing d5c1690 to master...

@bors-servo bors-servo merged commit ad3ec61 into servo:master Dec 12, 2018
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.

Implement HTMLMediaElement.volume attribute
9 participants