diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index 680f23520ac2..428e548f9b25 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4047,14 +4047,14 @@ HTMLMediaElement::UpdateHadAudibleAutoplayState()
OwnerDoc()->SetDocTreeHadAudibleMedia();
if (AutoplayPolicy::WouldBeAllowedToPlayIfAutoplayDisabled(*this)) {
ScalarAdd(Telemetry::ScalarID::MEDIA_AUTOPLAY_WOULD_BE_ALLOWED_COUNT, 1);
+ if (mReadyState >= HAVE_METADATA && !HasAudio()) {
+ ScalarAdd(Telemetry::ScalarID::MEDIA_ALLOWED_AUTOPLAY_NO_AUDIO_TRACK_COUNT, 1);
+ }
} else {
if (mReadyState < HAVE_METADATA) {
mBlockedAsWithoutMetadata = true;
ScalarAdd(Telemetry::ScalarID::MEDIA_BLOCKED_NO_METADATA, 1);
}
- if (mReadyState >= HAVE_METADATA && !HasAudio()) {
- ScalarAdd(Telemetry::ScalarID::MEDIA_BLOCKED_AUTOPLAY_NO_AUDIO_TRACK_COUNT, 1);
- }
ScalarAdd(Telemetry::ScalarID::MEDIA_AUTOPLAY_WOULD_NOT_BE_ALLOWED_COUNT, 1);
}
}
@@ -5573,13 +5573,6 @@ HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
mMediaInfo.mVideo.mDisplay.height > 0),
"Video resolution must be known on 'loadedmetadata'");
DispatchAsyncEvent(NS_LITERAL_STRING("loadedmetadata"));
- // The play invocation which was call by script had happened before media
- // element loaded metadata.
- if ((!mPaused && OwnerDoc() && !OwnerDoc()->HasBeenUserGestureActivated()) &&
- !HasAudio() &&
- (Volume() != 0 && !Muted())) {
- ScalarAdd(Telemetry::ScalarID::MEDIA_BLOCKED_AUTOPLAY_NO_AUDIO_TRACK_COUNT, 1);
- }
if (mBlockedAsWithoutMetadata && !HasAudio()) {
mBlockedAsWithoutMetadata = false;
diff --git a/toolkit/components/telemetry/Scalars.yaml b/toolkit/components/telemetry/Scalars.yaml
index aea070f4932e..69b061a21b88 100644
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -916,11 +916,11 @@ media:
- main
- content
- blocked_autoplay_no_audio_track_count:
+ allowed_autoplay_no_audio_track_count:
bug_numbers:
- 1480484
description: >
- The number of HTMLMediaElement autoplays on HTMLMediaElements without an audio track which would not be allowed to play if block autoplay was enabled; we'd either prompt for permission to play or block outright depending on user preferences.
+ The number of HTMLMediaElement autoplays on HTMLMediaElements without an audio track which would be allowed to play.
expires: "68"
kind: uint
notification_emails: