Changeset 272829 in webkit


Ignore:
Timestamp:
Feb 12, 2021 8:36:29 PM (17 months ago)
Author:
jer.noble@apple.com
Message:

[Mac] Sound does not play on YouTube after switching back to foreground
https://bugs.webkit.org/show_bug.cgi?id=221858
<rdar://70602677>

Reviewed by Eric Carlson.

Source/WebCore:

Test: platform/mac/media/unmute-after-loading.html

Remove a stray, unnecessary reset of a cached muted state which kept mute
state from being changed the first time after loading.

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

(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):

  • testing/Internals.cpp:

(WebCore::Internals::privatePlayerMuted):

  • testing/Internals.h:
  • testing/Internals.idl:
  • testing/Internals.mm:

(WebCore::Internals::privatePlayerMuted):

LayoutTests:

  • platform/mac/media/unmute-after-loading-expected.txt: Added.
  • platform/mac/media/unmute-after-loading.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r272827 r272829  
     12021-02-12  Jer Noble  <jer.noble@apple.com>
     2
     3        [Mac] Sound does not play on YouTube after switching back to foreground
     4        https://bugs.webkit.org/show_bug.cgi?id=221858
     5        <rdar://70602677>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * platform/mac/media/unmute-after-loading-expected.txt: Added.
     10        * platform/mac/media/unmute-after-loading.html: Added.
     11
    1122021-02-12  Chris Gambrell  <cgambrell@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r272828 r272829  
     12021-02-12  Jer Noble  <jer.noble@apple.com>
     2
     3        [Mac] Sound does not play on YouTube after switching back to foreground
     4        https://bugs.webkit.org/show_bug.cgi?id=221858
     5        <rdar://70602677>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Test: platform/mac/media/unmute-after-loading.html
     10
     11        Remove a stray, unnecessary reset of a cached muted state which kept mute
     12        state from being changed the first time after loading.
     13
     14        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     15        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
     16        * testing/Internals.cpp:
     17        (WebCore::Internals::privatePlayerMuted):
     18        * testing/Internals.h:
     19        * testing/Internals.idl:
     20        * testing/Internals.mm:
     21        (WebCore::Internals::privatePlayerMuted):
     22
    1232021-02-12  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r272224 r272829  
    10081008
    10091009    if (m_muted) {
    1010         // Clear m_muted so setMuted doesn't return without doing anything.
    1011         m_muted = false;
    10121010        [m_avPlayer.get() setMuted:m_muted];
    10131011
  • trunk/Source/WebCore/testing/Internals.cpp

    r272748 r272829  
    48904890    return 0;
    48914891}
     4892
     4893bool Internals::privatePlayerMuted(const HTMLMediaElement&)
     4894{
     4895    return false;
     4896}
    48924897#endif
    48934898
  • trunk/Source/WebCore/testing/Internals.h

    r272206 r272829  
    632632    String elementBufferingPolicy(HTMLMediaElement&);
    633633    double privatePlayerVolume(const HTMLMediaElement&);
     634    bool privatePlayerMuted(const HTMLMediaElement&);
    634635    ExceptionOr<void> setOverridePreferredDynamicRangeMode(HTMLMediaElement&, const String&);
    635636#endif
  • trunk/Source/WebCore/testing/Internals.idl

    r272206 r272829  
    653653    [Conditional=VIDEO] DOMString elementBufferingPolicy(HTMLMediaElement media);
    654654    [Conditional=VIDEO] double privatePlayerVolume(HTMLMediaElement media);
     655    [Conditional=VIDEO] boolean privatePlayerMuted(HTMLMediaElement media);
    655656    [Conditional=VIDEO, MayThrowException] undefined setOverridePreferredDynamicRangeMode(HTMLMediaElement media, DOMString mode);
    656657
  • trunk/Source/WebCore/testing/Internals.mm

    r272760 r272829  
    104104    return [player volume];
    105105}
     106
     107bool Internals::privatePlayerMuted(const HTMLMediaElement& element)
     108{
     109    auto corePlayer = element.player();
     110    if (!corePlayer)
     111        return false;
     112    auto player = corePlayer->objCAVFoundationAVPlayer();
     113    if (!player)
     114        return false;
     115    return [player isMuted];
     116}
    106117#endif
    107118
Note: See TracChangeset for help on using the changeset viewer.