Changeset 272583 in webkit


Ignore:
Timestamp:
Feb 9, 2021 9:47:37 AM (18 months ago)
Author:
youenn@apple.com
Message:

MediaStream-backed video elements should not compute the mediaType based on track muted states
https://bugs.webkit.org/show_bug.cgi?id=221601

Reviewed by Eric Carlson.

Source/WebCore:

In case of entering background, two things happen:

  • video elements get paused
  • local video capture track gets muted

When entering foreground:

  • video element should resume but did not as the local video track was muted and video element was considered as an audio element.
  • local video capture track gets unmuted but this is too late.

To fix this, compute hasVideo/hasAudio based on available tracks, no matter their active state.

Test: fast/mediastream/MediaStream-video-element-enter-background.html

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:

(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo const):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio const):

LayoutTests:

  • fast/mediastream/MediaStream-video-element-enter-background-expected.txt: Added.
  • fast/mediastream/MediaStream-video-element-enter-background.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r272582 r272583  
     12021-02-09  Youenn Fablet  <youenn@apple.com>
     2
     3        MediaStream-backed video elements should not compute the mediaType based on track muted states
     4        https://bugs.webkit.org/show_bug.cgi?id=221601
     5
     6        Reviewed by Eric Carlson.
     7
     8        * fast/mediastream/MediaStream-video-element-enter-background-expected.txt: Added.
     9        * fast/mediastream/MediaStream-video-element-enter-background.html: Added.
     10
    1112021-02-09  Chris Gambrell  <cgambrell@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r272579 r272583  
     12021-02-09  Youenn Fablet  <youenn@apple.com>
     2
     3        MediaStream-backed video elements should not compute the mediaType based on track muted states
     4        https://bugs.webkit.org/show_bug.cgi?id=221601
     5
     6        Reviewed by Eric Carlson.
     7
     8        In case of entering background, two things happen:
     9        - video elements get paused
     10        - local video capture track gets muted
     11        When entering foreground:
     12        - video element should resume but did not as the local video track was muted and video element was considered as an audio element.
     13        - local video capture track gets unmuted but this is too late.
     14        To fix this, compute hasVideo/hasAudio based on available tracks, no matter their active state.
     15
     16        Test: fast/mediastream/MediaStream-video-element-enter-background.html
     17
     18        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
     19        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo const):
     20        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio const):
     21
    1222021-02-09  Zalan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm

    r270059 r272583  
    578578bool MediaPlayerPrivateMediaStreamAVFObjC::hasVideo() const
    579579{
    580     if (!metaDataAvailable())
    581         return false;
    582    
    583     return m_mediaStreamPrivate->hasVideo();
     580    return !m_videoTrackMap.isEmpty();
    584581}
    585582
    586583bool MediaPlayerPrivateMediaStreamAVFObjC::hasAudio() const
    587584{
    588     if (!metaDataAvailable())
    589         return false;
    590    
    591     return m_mediaStreamPrivate->hasAudio();
     585    return !m_audioTrackMap.isEmpty();
    592586}
    593587
Note: See TracChangeset for help on using the changeset viewer.