[webkit-changes] [WebKit/WebKit] d03d3a: REGRESSION (275831 at main): Music video can't be pla...

Jean-Yves Avenard noreply at github.com
Wed Jun 12 20:15:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d03d3a51627299d0e4de746b80889edf43fe93a5
      https://github.com/WebKit/WebKit/commit/d03d3a51627299d0e4de746b80889edf43fe93a5
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2024-06-12 (Wed, 12 Jun 2024)

  Changed paths:
    A LayoutTests/media/picture-in-picture/video-playback-system-interruption-and-resume-expected.txt
    A LayoutTests/media/picture-in-picture/video-playback-system-interruption-and-resume.html
    M Source/WebCore/platform/audio/PlatformMediaSession.cpp
    M Source/WebCore/platform/audio/PlatformMediaSession.h
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp

  Log Message:
  -----------
  REGRESSION (275831 at main): Music video can't be played after tapping music video in Music app
https://bugs.webkit.org/show_bug.cgi?id=275391
rdar://128055030

Reviewed by Jer Noble.

Commit 275831 at main exposed two long-standing and existing issue:
1- When the video is paused following a system interruption, currentTime can continue to progress
despite the new video rate being 0.
2- The HTMLMediaElement can incorrectly resume playback of a paused video.

1) was due to MediaPlayerPrivateAVFObjC::paused() returning false as it only checks if the AVPlayer
status was AVPlayerTimeControlStatusPaused. This caused the default `timeIsProgressing()`
implementation to return true ; hence the time estimation in the content process to continue.

2) When the PlatformMediaSession was receiving an interruption notification, it would be ignored
on start, but not on end, which would resume playback.

Add test.

* LayoutTests/media/picture-in-picture/video-playback-system-interruption-and-resume-expected.txt: Added.
* LayoutTests/media/picture-in-picture/video-playback-system-interruption-and-resume.html: Added.
* Source/WebCore/platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::activeInterruptionCount const): We add a flag indicating if the
notification was ignored, in order to determine if playback needs to be resumed later.
(WebCore::PlatformMediaSession::interruptionType const):
(WebCore::PlatformMediaSession::beginInterruption):
(WebCore::PlatformMediaSession::endInterruption):
(WebCore::PlatformMediaSession::blockedBySystemInterruption const):
* Source/WebCore/platform/audio/PlatformMediaSession.h: Add method.
(WebCore::PlatformMediaSession::interruptionCount const): Deleted.
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::rateChanged): Add logging

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list