Changeset 261839 in webkit


Ignore:
Timestamp:
May 18, 2020 4:40:06 PM (4 years ago)
Author:
Peng Liu
Message:

Add a quirk to allow an embedded Twitter video to play with one tapping
https://bugs.webkit.org/show_bug.cgi?id=211932

Reviewed by Maciej Stachowiak.

  • html/MediaElementSession.cpp:

(WebCore::MediaElementSession::playbackPermitted const):
Need to check the topDocument for the existence of user interactions.
(WebCore::MediaElementSession::updateMediaUsageIfChanged): Ditto.

  • page/Quirks.cpp:

(WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
Add the missing needsQuirks() checking.
(WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const):
Add a the quirk for twitter.com.

  • platform/audio/ios/MediaSessionManagerIOS.mm:

(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
Clarify the log message.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r261837 r261839  
     12020-05-18  Peng Liu  <peng.liu6@apple.com>
     2
     3        Add a quirk to allow an embedded Twitter video to play with one tapping
     4        https://bugs.webkit.org/show_bug.cgi?id=211932
     5
     6        Reviewed by Maciej Stachowiak.
     7
     8        * html/MediaElementSession.cpp:
     9        (WebCore::MediaElementSession::playbackPermitted const):
     10        Need to check the topDocument for the existence of user interactions.
     11        (WebCore::MediaElementSession::updateMediaUsageIfChanged): Ditto.
     12
     13        * page/Quirks.cpp:
     14        (WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
     15        Add the missing needsQuirks() checking.
     16        (WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const):
     17        Add a the quirk for twitter.com.
     18
     19        * platform/audio/ios/MediaSessionManagerIOS.mm:
     20        (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
     21        Clarify the log message.
     22
    1232020-05-18  Simon Fraser  <simon.fraser@apple.com>
    224
  • trunk/Source/WebCore/html/MediaElementSession.cpp

    r260951 r261839  
    317317        return { };
    318318
    319     if (document.hasHadUserInteraction() && document.quirks().shouldAutoplayForArbitraryUserGesture())
     319    if (topDocument.hasHadUserInteraction() && document.quirks().shouldAutoplayForArbitraryUserGesture())
    320320        return { };
    321321
     
    10661066        pageExplicitlyAllowsElementToAutoplayInline(m_element),
    10671067        requiresFullscreenForVideoPlayback() && !fullscreenPermitted(),
    1068         document.hasHadUserInteraction() && document.quirks().shouldAutoplayForArbitraryUserGesture(),
     1068        document.topDocument().hasHadUserInteraction() && document.quirks().shouldAutoplayForArbitraryUserGesture(),
    10691069        isVideo && hasBehaviorRestriction(RequireUserGestureForVideoRateChange) && !processingUserGesture,
    10701070        isAudio && hasBehaviorRestriction(RequireUserGestureForAudioRateChange) && !processingUserGesture && !m_element.muted() && m_element.volume(),
  • trunk/Source/WebCore/page/Quirks.cpp

    r261261 r261839  
    111111    return needsQuirks() && allowedAutoplayQuirks(*m_document).contains(AutoplayQuirk::PerDocumentAutoplayBehavior);
    112112#else
     113    if (!needsQuirks())
     114        return false;
     115
    113116    auto host = m_document->topDocument().url().host();
    114117    return equalLettersIgnoringASCIICase(host, "netflix.com") || host.endsWithIgnoringASCIICase(".netflix.com");
     
    121124    return needsQuirks() && allowedAutoplayQuirks(*m_document).contains(AutoplayQuirk::ArbitraryUserGestures);
    122125#else
    123     return false;
     126    if (!needsQuirks())
     127        return false;
     128
     129    auto host = m_document->url().host();
     130    return equalLettersIgnoringASCIICase(host, "twitter.com") || host.endsWithIgnoringASCIICase(".twitter.com");
    124131#endif
    125132}
  • trunk/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm

    r261093 r261839  
    132132    }
    133133
    134     ALWAYS_LOG(LOGIDENTIFIER, m_playbackTargetSupportsAirPlayVideo);
     134    ALWAYS_LOG(LOGIDENTIFIER, "Playback Target Supports AirPlay Video = ", m_playbackTargetSupportsAirPlayVideo);
    135135    if (m_playbackTargetSupportsAirPlayVideo)
    136136        session.setPlaybackTarget(*m_playbackTarget.copyRef());
Note: See TracChangeset for help on using the changeset viewer.