Bug 879717: Part 3 - Update screen wake lock when metadata has loaded. r=roc,esawin
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -2928,16 +2928,21 @@ void HTMLMediaElement::MetadataLoaded(co
// delete the VideoFrameContainer. This happens when the src is changed to an
// audio only file.
if (!aInfo->HasVideo() && mVideoFrameContainer) {
// call ForgetElement() such that callbacks from |mVideoFrameContainer|
// won't reach us anymore.
mVideoFrameContainer->ForgetElement();
mVideoFrameContainer = nullptr;
}
+
+ if (IsVideo()) {
+ // Update the screen wakelock in case mHasVideo changed
+ NotifyOwnerDocumentActivityChanged();
+ }
}
void HTMLMediaElement::FirstFrameLoaded()
{
NS_ASSERTION(!mSuspendedAfterFirstFrame, "Should not have already suspended");
ChangeDelayLoadStatus(false);
UpdateReadyStateForData(NEXT_FRAME_UNAVAILABLE);