⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 201841 in webkit


Ignore:
Timestamp:
Jun 8, 2016, 4:09:44 PM (10 years ago)
Author:
jer.noble@apple.com
Message:

With audio user gesture restriction in place, video.src = 'file', video.play() succeeds where it should fail.
https://bugs.webkit.org/show_bug.cgi?id=158546

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-playback-restriction-play-before-load.html

Don't check that the media element isPlaying(); that will only return true if playback has begun.
Instead, check !paused(), as that will be true as soon as the play() method returns.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
(WebCore::HTMLMediaElement::updateShouldPlay):

  • rendering/RenderLayer.h:

LayoutTests:

  • media/video-playback-restriction-play-before-load-expected.txt: Added.
  • media/video-playback-restriction-play-before-load.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201835 r201841  
     12016-06-08  Jer Noble  <jer.noble@apple.com>
     2
     3        With audio user gesture restriction in place, video.src = 'file', video.play() succeeds where it should fail.
     4        https://bugs.webkit.org/show_bug.cgi?id=158546
     5
     6        Reviewed by Eric Carlson.
     7
     8        * media/video-playback-restriction-play-before-load-expected.txt: Added.
     9        * media/video-playback-restriction-play-before-load.html: Added.
     10
    1112016-06-08  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r201837 r201841  
     12016-06-08  Jer Noble  <jer.noble@apple.com>
     2
     3        With audio user gesture restriction in place, video.src = 'file', video.play() succeeds where it should fail.
     4        https://bugs.webkit.org/show_bug.cgi?id=158546
     5
     6        Reviewed by Eric Carlson.
     7
     8        Test: media/video-playback-restriction-play-before-load.html
     9
     10        Don't check that the media element isPlaying(); that will only return true if playback has begun.
     11        Instead, check !paused(), as that will be true as soon as the play() method returns.
     12
     13        * html/HTMLMediaElement.cpp:
     14        (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
     15        (WebCore::HTMLMediaElement::updateShouldPlay):
     16        * rendering/RenderLayer.h:
     17
    1182016-06-08  Alex Christensen  <achristensen@webkit.org>
    219
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r201757 r201841  
    46434643    updateRenderer();
    46444644
    4645     if (isPlaying() && !m_mediaSession->playbackPermitted(*this))
     4645    if (!paused() && !m_mediaSession->playbackPermitted(*this))
    46464646        pauseInternal();
    46474647
     
    70557055void HTMLMediaElement::updateShouldPlay()
    70567056{
    7057     if (isPlaying() && !m_mediaSession->playbackPermitted(*this))
     7057    if (!paused() && !m_mediaSession->playbackPermitted(*this))
    70587058        pauseInternal();
    70597059    else if (canTransitionFromAutoplayToPlay())
Note: See TracChangeset for help on using the changeset viewer.