Backed out 3 changesets (bug 1415478) for frequently asserting in own test test_autoplay_policy.html at MediaDecoderStateMachine.cpp:989. r=backout
Backed out changeset 6ba103fe1caf (bug 1415478) Backed out changeset df6721a3584f (bug 1415478) Backed out changeset 8a802839959b (bug 1415478)
This commit is contained in:
@@ -670,6 +670,11 @@ void HTMLMediaElement::ReportLoadError(const char* aMsg,
|
||||
aParamCount);
|
||||
}
|
||||
|
||||
static bool IsAutoplayEnabled()
|
||||
{
|
||||
return Preferences::GetBool("media.autoplay.enabled");
|
||||
}
|
||||
|
||||
class HTMLMediaElement::AudioChannelAgentCallback final :
|
||||
public nsIAudioChannelAgentCallback
|
||||
{
|
||||
@@ -2434,8 +2439,7 @@ void HTMLMediaElement::UpdatePreloadAction()
|
||||
PreloadAction nextAction = PRELOAD_UNDEFINED;
|
||||
// If autoplay is set, or we're playing, we should always preload data,
|
||||
// as we'll need it to play.
|
||||
if ((AutoplayPolicy::IsMediaElementAllowedToPlay(WrapNotNull(this)) &&
|
||||
HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay)) ||
|
||||
if ((IsAutoplayEnabled() && HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay)) ||
|
||||
!mPaused)
|
||||
{
|
||||
nextAction = HTMLMediaElement::PRELOAD_ENOUGH;
|
||||
@@ -6186,7 +6190,7 @@ bool HTMLMediaElement::CanActivateAutoplay()
|
||||
// download is controlled by the script and there is no way to evaluate
|
||||
// MediaDecoder::CanPlayThrough().
|
||||
|
||||
if (!AutoplayPolicy::IsMediaElementAllowedToPlay(WrapNotNull(this))) {
|
||||
if (!IsAutoplayEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user