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

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

Issue 68183003: Remove HTMLMediaElement::minTimeSeekable()/maxTimeSeekable() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
« 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 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 } 3167 }
3168 3168
3169 if (!m_playedTimeRanges) 3169 if (!m_playedTimeRanges)
3170 m_playedTimeRanges = TimeRanges::create(); 3170 m_playedTimeRanges = TimeRanges::create();
3171 3171
3172 return m_playedTimeRanges->copy(); 3172 return m_playedTimeRanges->copy();
3173 } 3173 }
3174 3174
3175 PassRefPtr<TimeRanges> HTMLMediaElement::seekable() const 3175 PassRefPtr<TimeRanges> HTMLMediaElement::seekable() const
3176 { 3176 {
3177 double maxSeekable = maxTimeSeekable(); 3177 if (m_player) {
3178 return maxSeekable ? TimeRanges::create(0, maxSeekable) : TimeRanges::create (); 3178 double maxTimeSeekable = m_player->maxTimeSeekable();
3179 if (maxTimeSeekable)
3180 return TimeRanges::create(0, maxTimeSeekable);
3181 }
3182 return TimeRanges::create();
3179 } 3183 }
3180 3184
3181 bool HTMLMediaElement::potentiallyPlaying() const 3185 bool HTMLMediaElement::potentiallyPlaying() const
3182 { 3186 {
3183 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing 3187 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing
3184 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the 3188 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the
3185 // checks in couldPlayIfEnoughData(). 3189 // checks in couldPlayIfEnoughData().
3186 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA; 3190 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA;
3187 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController(); 3191 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController();
3188 } 3192 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
3230 3234
3231 return false; 3235 return false;
3232 } 3236 }
3233 3237
3234 bool HTMLMediaElement::pausedForUserInteraction() const 3238 bool HTMLMediaElement::pausedForUserInteraction() const
3235 { 3239 {
3236 // return !paused() && m_readyState >= HAVE_FUTURE_DATA && [UA requires a dec itions from the user] 3240 // return !paused() && m_readyState >= HAVE_FUTURE_DATA && [UA requires a dec itions from the user]
3237 return false; 3241 return false;
3238 } 3242 }
3239 3243
3240 double HTMLMediaElement::minTimeSeekable() const
3241 {
3242 return 0;
3243 }
3244
3245 double HTMLMediaElement::maxTimeSeekable() const
3246 {
3247 return m_player ? m_player->maxTimeSeekable() : 0;
3248 }
3249
3250 void HTMLMediaElement::updateVolume() 3244 void HTMLMediaElement::updateVolume()
3251 { 3245 {
3252 if (!m_player) 3246 if (!m_player)
3253 return; 3247 return;
3254 3248
3255 double volumeMultiplier = 1; 3249 double volumeMultiplier = 1;
3256 bool shouldMute = m_muted; 3250 bool shouldMute = m_muted;
3257 3251
3258 if (m_mediaController) { 3252 if (m_mediaController) {
3259 volumeMultiplier *= m_mediaController->volume(); 3253 volumeMultiplier *= m_mediaController->volume();
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
3870 { 3864 {
3871 scheduleLayerUpdate(); 3865 scheduleLayerUpdate();
3872 } 3866 }
3873 3867
3874 bool HTMLMediaElement::isInteractiveContent() const 3868 bool HTMLMediaElement::isInteractiveContent() const
3875 { 3869 {
3876 return fastHasAttribute(controlsAttr); 3870 return fastHasAttribute(controlsAttr);
3877 } 3871 }
3878 3872
3879 } 3873 }
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