Bug 1384247 - Check if an HTMLMediaElement can be capture before doing it. r=dminor

MozReview-Commit-ID: EWpf2qA2Yce
This commit is contained in:
Paul Adenot
2017-07-27 16:02:28 +02:00
parent 031a6f535a
commit e68762886b
3 changed files with 16 additions and 0 deletions

View File

@@ -3535,6 +3535,11 @@ HTMLMediaElement::CaptureAudio(ErrorResult& aRv,
{
MOZ_RELEASE_ASSERT(aGraph);
if (!CanBeCaptured(true)) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
RefPtr<DOMMediaStream> stream =
CaptureStreamInternal(false, true, aGraph);
if (!stream) {