diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index ce2b70d059c2..c3447c52a5f5 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -19,6 +19,7 @@ #include "DecoderTraits.h" #include "FrameStatistics.h" #include "GMPCrashHelper.h" +#include "GVAutoplayPermissionRequest.h" #ifdef MOZ_ANDROID_HLS_SUPPORT # include "HLSDecoder.h" #endif @@ -4051,6 +4052,11 @@ void HTMLMediaElement::Init() { // in JS) MediaShutdownManager::InitStatics(); +#if defined(MOZ_WIDGET_ANDROID) + GVAutoplayPermissionRequestor::AskForPermissionIfNeeded( + OwnerDoc()->GetInnerWindow()); +#endif + mShutdownObserver->Subscribe(this); mInitialized = true; }