Changeset 93878 in webkit
- Timestamp:
- Aug 26, 2011, 8:14:03 AM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
html/HTMLMediaElement.cpp (modified) (3 diffs)
-
html/HTMLMediaElement.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93873 r93878 1 2011-08-26 Eric Carlson <eric.carlson@apple.com> 2 3 <video> playlist can not advance when playing in background tab 4 https://bugs.webkit.org/show_bug.cgi?id=66978 5 6 Reviewed by Darin Adler. 7 8 No new tests added because it isn't possible to simulate a background tab in DRT. 9 10 * html/HTMLMediaElement.cpp: 11 (WebCore::HTMLMediaElement::HTMLMediaElement): Set RequirePageConsentToLoadMedia restriction. 12 (WebCore::HTMLMediaElement::loadInternal): Don't consider page->canStartMedia if it has ever 13 allowed a file to load. 14 * html/HTMLMediaElement.h: 15 (WebCore::HTMLMediaElement::requirePageConsentToLoadMedia): New. 16 (WebCore::HTMLMediaElement::removeBehaviorRestriction): New. 17 1 18 2011-08-26 Andreas Kling <kling@webkit.org> 2 19 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r93437 r93878 151 151 , m_proxyWidget(0) 152 152 #endif 153 , m_restrictions(RequireUserGestureForFullScreenRestriction )153 , m_restrictions(RequireUserGestureForFullScreenRestriction | RequirePageConsentToLoadMedia) 154 154 , m_preload(MediaPlayer::Auto) 155 155 , m_displayMode(Unknown) … … 585 585 // If we can't start a load right away, start it later. 586 586 Page* page = document()->page(); 587 if ( page && !page->canStartMedia()) {587 if (requirePageConsentToLoadMedia() && page && !page->canStartMedia()) { 588 588 if (m_isWaitingUntilMediaCanStart) 589 589 return; … … 592 592 return; 593 593 } 594 595 // Once the page has allowed an element to load media, it is free to load at will. This allows a 596 // playlist that starts in a foreground tab to continue automatically if the tab is subsequently 597 // put in the the background. 598 removeBehaviorRestriction(RequirePageConsentToLoadMedia); 594 599 595 600 selectMediaResource(); -
trunk/Source/WebCore/html/HTMLMediaElement.h
r93108 r93878 185 185 RequireUserGestureForLoadRestriction = 1 << 0, 186 186 RequireUserGestureForRateChangeRestriction = 1 << 1, 187 RequireUserGestureForFullScreenRestriction = 1 << 2 187 RequireUserGestureForFullScreenRestriction = 1 << 2, 188 RequirePageConsentToLoadMedia = 1 << 3, 188 189 }; 189 190 typedef unsigned BehaviorRestrictions; … … 192 193 bool requireUserGestureForRateChange() const { return m_restrictions & RequireUserGestureForRateChangeRestriction; } 193 194 bool requireUserGestureForFullScreen() const { return m_restrictions & RequireUserGestureForFullScreenRestriction; } 195 bool requirePageConsentToLoadMedia() const { return m_restrictions & RequirePageConsentToLoadMedia; } 194 196 195 197 void setBehaviorRestrictions(BehaviorRestrictions restrictions) { m_restrictions = restrictions; } … … 333 335 virtual void mediaCanStart(); 334 336 337 void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictions &= ~restriction; } 338 335 339 void setShouldDelayLoadEvent(bool); 336 340
Note:
See TracChangeset
for help on using the changeset viewer.