Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 314823003: Remove HTMLMediaElement::pausedForUserInteraction(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 2922 matching lines...) Expand 10 before | Expand all | Expand 10 after
2933 { 2933 {
2934 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing 2934 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing
2935 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the 2935 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the
2936 // checks in couldPlayIfEnoughData(). 2936 // checks in couldPlayIfEnoughData().
2937 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA; 2937 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA;
2938 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController(); 2938 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController();
2939 } 2939 }
2940 2940
2941 bool HTMLMediaElement::couldPlayIfEnoughData() const 2941 bool HTMLMediaElement::couldPlayIfEnoughData() const
2942 { 2942 {
2943 return !paused() && !endedPlayback() && !stoppedDueToErrors() && !pausedForU serInteraction(); 2943 return !paused() && !endedPlayback() && !stoppedDueToErrors();
2944 } 2944 }
2945 2945
2946 bool HTMLMediaElement::endedPlayback() const 2946 bool HTMLMediaElement::endedPlayback() const
2947 { 2947 {
2948 double dur = duration(); 2948 double dur = duration();
2949 if (!m_player || std::isnan(dur)) 2949 if (!m_player || std::isnan(dur))
2950 return false; 2950 return false;
2951 2951
2952 // 4.8.10.8 Playing the media resource 2952 // 4.8.10.8 Playing the media resource
2953 2953
(...skipping 21 matching lines...) Expand all
2975 { 2975 {
2976 if (m_readyState >= HAVE_METADATA && m_error) { 2976 if (m_readyState >= HAVE_METADATA && m_error) {
2977 RefPtr<TimeRanges> seekableRanges = seekable(); 2977 RefPtr<TimeRanges> seekableRanges = seekable();
2978 if (!seekableRanges->contain(currentTime())) 2978 if (!seekableRanges->contain(currentTime()))
2979 return true; 2979 return true;
2980 } 2980 }
2981 2981
2982 return false; 2982 return false;
2983 } 2983 }
2984 2984
2985 bool HTMLMediaElement::pausedForUserInteraction() const
2986 {
2987 // return !paused() && m_readyState >= HAVE_FUTURE_DATA && [UA requires a dec itions from the user]
2988 return false;
2989 }
2990
2991 void HTMLMediaElement::updateVolume() 2985 void HTMLMediaElement::updateVolume()
2992 { 2986 {
2993 if (webMediaPlayer()) 2987 if (webMediaPlayer())
2994 webMediaPlayer()->setVolume(playerVolume()); 2988 webMediaPlayer()->setVolume(playerVolume());
2995 2989
2996 if (hasMediaControls()) 2990 if (hasMediaControls())
2997 mediaControls()->updateVolume(); 2991 mediaControls()->updateVolume();
2998 } 2992 }
2999 2993
3000 double HTMLMediaElement::playerVolume() const 2994 double HTMLMediaElement::playerVolume() const
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
3544 void HTMLMediaElement::updateMediaController() 3538 void HTMLMediaElement::updateMediaController()
3545 { 3539 {
3546 if (m_mediaController) 3540 if (m_mediaController)
3547 m_mediaController->reportControllerState(); 3541 m_mediaController->reportControllerState();
3548 } 3542 }
3549 3543
3550 bool HTMLMediaElement::isBlocked() const 3544 bool HTMLMediaElement::isBlocked() const
3551 { 3545 {
3552 // A media element is a blocked media element if its readyState attribute is in the 3546 // A media element is a blocked media element if its readyState attribute is in the
3553 // HAVE_NOTHING state, the HAVE_METADATA state, or the HAVE_CURRENT_DATA sta te, 3547 // HAVE_NOTHING state, the HAVE_METADATA state, or the HAVE_CURRENT_DATA sta te,
3548 // or if the element has paused for user interaction or paused for in-band c ontent.
3554 if (m_readyState <= HAVE_CURRENT_DATA) 3549 if (m_readyState <= HAVE_CURRENT_DATA)
3555 return true; 3550 return true;
3556 3551
3557 // or if the element has paused for user interaction. 3552 return false;
3558 return pausedForUserInteraction();
3559 } 3553 }
3560 3554
3561 bool HTMLMediaElement::isBlockedOnMediaController() const 3555 bool HTMLMediaElement::isBlockedOnMediaController() const
3562 { 3556 {
3563 if (!m_mediaController) 3557 if (!m_mediaController)
3564 return false; 3558 return false;
3565 3559
3566 // A media element is blocked on its media controller if the MediaController is a blocked 3560 // A media element is blocked on its media controller if the MediaController is a blocked
3567 // media controller, 3561 // media controller,
3568 if (m_mediaController->isBlocked()) 3562 if (m_mediaController->isBlocked())
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
3663 visitor->trace(m_error); 3657 visitor->trace(m_error);
3664 visitor->trace(m_currentSourceNode); 3658 visitor->trace(m_currentSourceNode);
3665 visitor->trace(m_nextChildNodeToConsider); 3659 visitor->trace(m_nextChildNodeToConsider);
3666 visitor->trace(m_textTracks); 3660 visitor->trace(m_textTracks);
3667 visitor->trace(m_textTracksWhenResourceSelectionBegan); 3661 visitor->trace(m_textTracksWhenResourceSelectionBegan);
3668 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor); 3662 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor);
3669 HTMLElement::trace(visitor); 3663 HTMLElement::trace(visitor);
3670 } 3664 }
3671 3665
3672 } 3666 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698