haikuwebkit/LayoutTests/media/audio-playback-restriction-...

13 lines
408 B
Plaintext
Raw Permalink Normal View History

[iOS] Make HTMLMediaElement.muted mutable https://bugs.webkit.org/show_bug.cgi?id=158787 <rdar://problem/24452567> Reviewed by Dean Jackson. Source/WebCore: Tests: media/audio-playback-restriction-removed-muted.html media/audio-playback-restriction-removed-track-enabled.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Remove most behavior restrictions if the track state was changed as a result of a user gesture. (WebCore::HTMLMediaElement::setMuted): Ditto. (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Add mask parameter so caller can choose which restrictions are removed. * html/HTMLMediaElement.h: * html/MediaElementSession.cpp: (WebCore::restrictionName): Drive-by fix: remove duplicate label. * html/MediaElementSession.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Set muted on AVPlayer if setMuted was called before the player was created. (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Drive-by fix: return early if there is no AVPlayer, not if we won't have metadata yet. (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): New. LayoutTests: * media/audio-playback-restriction-removed-muted-expected.txt: Added. * media/audio-playback-restriction-removed-muted.html: Added. * media/audio-playback-restriction-removed-track-enabled-expected.txt: Added. * media/audio-playback-restriction-removed-track-enabled.html: Added. Canonical link: https://commits.webkit.org/176879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-15 19:32:50 +00:00
Test that when RequireUserGestureForAudioRateChange is set, enabling an audio track with a user gesture clears the restriction.
RUN(internals.setMediaElementRestrictions(video, 'RequireUserGestureForAudioRateChange'))
RUN(video.src = findMediaFile('video', 'content/audio-tracks'))
EVENT(canplaythrough)
RUN(video.play())
EVENT(playing)
RUN(audioTrack.enabled = true)
RUN(video.muted = false)
END OF TEST