Bug 1483703 - part4 : modify current telemtry scalar because we won't block media without audio track anymore. r=cpearce,francois

Since we don't block media without audio track anymore, the original telemetry scalar becomes useless.

We need to change its meaning in order to know the number of allowed autoplay without audio track.

Differential Revision: https://phabricator.services.mozilla.com/D3673

--HG--
extra : moz-landing-system : lando
This commit is contained in:
alwu 2018-08-22 22:54:05 +00:00
parent b26e3f253f
commit 4239949481
2 changed files with 5 additions and 12 deletions

View File

@ -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;

View File

@ -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: