Bug 1636515 - Handle cycle in media element when it is fed with the captured stream. r=padenot
Feeding a media element with the captured stream from the same media element does not make sense. Currently the spec does not mention anything about it. I'll clarify the case in the spec. In the meantime, when a cycle is detected, the setting of the `srcObject` is ignored and a warning is produced in the console. Differential Revision: https://phabricator.services.mozilla.com/D76821
This commit is contained in:
@@ -2089,6 +2089,13 @@ void HTMLMediaElement::SetSrcObject(DOMMediaStream& aValue) {
|
||||
}
|
||||
|
||||
void HTMLMediaElement::SetSrcObject(DOMMediaStream* aValue) {
|
||||
for (auto& outputStream : mOutputStreams) {
|
||||
if (aValue == outputStream.mStream) {
|
||||
ReportToConsole(nsIScriptError::warningFlag,
|
||||
"MediaElementStreamCaptureCycle");
|
||||
return;
|
||||
}
|
||||
}
|
||||
mSrcAttrStream = aValue;
|
||||
UpdateAudioChannelPlayingState();
|
||||
DoLoad();
|
||||
|
||||
Reference in New Issue
Block a user