Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2010-03-08 Darin Adler <darin@apple.com>
Reviewed by Jon Honeycutt. Don't auto-play <audio> and <video> elements loaded in background tabs https://bugs.webkit.org/show_bug.cgi?id=35886 rdar://problem/7117745 * manual-tests/video-in-non-frontmost-tab.html: Added. * manual-tests/resources/video-tab.html: Added. * html/HTMLMediaElement.h: Added MediaCanStartListener as a base class, and added the mediaCanStart function as well as a boolean, m_isWaitingUntilMediaCanStart. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_isWaitingUntilMediaCanStart. (WebCore::HTMLMediaElement::~HTMLMediaElement): Call removeMediaCanStartListener if m_isWaitingUntilMediaCanStart is true. (WebCore::HTMLMediaElement::loadInternal): Set m_isWaitingUntilMediaCanStart and call addMediaCanStartListener if canStartMedia is false. (WebCore::HTMLMediaElement::mediaCanStart): Clear m_isWaitingUntilMediaCanStart and call loadInternal. Canonical link: https://commits.webkit.org/46996@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
6 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1 @@ | ||
<video src="http://movies.apple.com/movies/us/apple/ipoditunes/2007/touch/ads/apple_ipodtouch_touch_r640-9cie.mov" controls autoplay> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,4 @@ | ||
This tests that video does not play if it's not in the frontmost tab. | ||
Command-Click <a href="resources/video-tab.html">this link</a> to open it in a non-frontmost tab. | ||
If you hear music before switching tabs, then the test failed. | ||
If not, click on the tab and the video should then play. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters