Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9b976665c9d449751eb0f39607dacfa82e3d7e02
      
https://github.com/WebKit/WebKit/commit/9b976665c9d449751eb0f39607dacfa82e3d7e02
  Author: Jer Noble <[email protected]>
  Date:   2025-09-25 (Thu, 25 Sep 2025)

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h

  Log Message:
  -----------
  Watchtime Presentation Type metrics are inaccurate
rdar://161267622
https://bugs.webkit.org/show_bug.cgi?id=299468

Reviewed by Eric Carlson.

A suspiciously large number of watchtime logs show a presentation type of 
"none", which indicates
the playing video element has no RenderVideo attached and is therefore playing 
outside of the DOM.
The suspicion is that by the time the watchtime timer is invalidated (during 
page navigation, e.g.)
that the video's renderer has already been torn down, making it appear that the 
previous watchtime
interval was spent without a renderer.

Account for this behavior by prematurely firing the watchtime timer when a 
video is about to lose
or gain a renderer, and re-use this mechanism for when the video is about to 
become or leave fullscreen
mode. This should make the watchtime logs more accurate.

Separately, it was noticed that a lot of watchtime logs on Mac reported that 
AirPlay was active.
It appears that on the Mac, the MediaPlayer will report that the current 
playback target is AirPlay
in situations where AirPlay is not actually occurring. Add a conditional that 
checks that the current
external playback is active and additionally that the target is AirPlay.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::willAttachRenderers):
(WebCore::HTMLMediaElement::willDetachRenderers):
(WebCore::HTMLMediaElement::setWirelessPlaybackTarget):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::willBecomeFullscreenElement):
(WebCore::HTMLMediaElement::willStopBeingFullscreenElement):
(WebCore::HTMLMediaElement::isWatchtimeTimerActive const):
(WebCore::HTMLMediaElement::fireAndRestartWatchtimeTimer):
(WebCore::HTMLMediaElement::watchtimeTimerFired):
* Source/WebCore/html/HTMLMediaElement.h:

Canonical link: https://commits.webkit.org/300516@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to