diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-05-30 05:00:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30 05:00:30 -0400 |
commit | f4131257ee2ea307d54797cf97501d2ce7d28a91 (patch) | |
tree | ed470cd446ed9884875d42e12d26b3d12de4bd68 | |
parent | 0a9a222356ae5b491885edd381fb5b821074ee1c (diff) | |
parent | 02dfee7b4746e5ef119b4be6599000c88eb9899d (diff) | |
download | servo-f4131257ee2ea307d54797cf97501d2ce7d28a91.tar.gz servo-f4131257ee2ea307d54797cf97501d2ce7d28a91.zip |
Auto merge of #23350 - ceyusa:audio-element, r=ferjm
Disable video if audio element
And register frame renderer only if video element
Requires the merge of https://github.com/servo/media/pull/257
<!-- Please describe your changes on the following line: -->
---
<!-- 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 #23336 (GitHub issue number if applicable)
<!-- 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/23350)
<!-- Reviewable:end -->
-rw-r--r-- | components/script/dom/htmlmediaelement.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index 322065ca8fd..5d65ede8df5 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -1224,10 +1224,14 @@ impl HTMLMediaElement { }; let (action_sender, action_receiver) = ipc::channel().unwrap(); + let renderer: Option<Arc<Mutex<FrameRenderer>>> = match self.media_type_id() { + HTMLMediaElementTypeId::HTMLAudioElement => None, + HTMLMediaElementTypeId::HTMLVideoElement => Some(self.frame_renderer.clone()), + }; let player = ServoMedia::get().unwrap().create_player( stream_type, action_sender, - Some(self.frame_renderer.clone()), + renderer, Box::new(PlayerContextDummy()), ); |