Skip to content
  • dalecurtis's avatar
    Add watch time metrics for HTML5 media playback. · 04bdb589
    dalecurtis authored
    Watch time for our purposes is defined as the amount of elapsed media time
    for audio+video media. A minimum of 7 seconds of unmuted, foreground media
    must be watched to start watch time monitoring. Watch time is checked every
    5 seconds from then on and reported to multiple buckets: All, MSE, SRC, EME,
    AC, and battery.
    
    Any one of paused, hidden, or muted is sufficient to stop watch time metric
    reports. Each of these has a hysteresis where if the state change is undone
    within 5 seconds, the watch time will be counted as uninterrupted.
    
    Power events (on/off battery power) have a similar hysteresis, but unlike
    the aforementioned properties, will not stop metric collection.
    
    Each seek event will result in a new watch time metric being started and the
    old metric finalized as accurately as possible.
    
    BUG=633743
    TEST=new unittest.
    
    Review-Url: https://codereview.chromium.org/2160963002
    Cr-Commit-Position: refs/heads/master@{#412664}
    04bdb589