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

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

Issue 562493003: Allow seeks to zero on streaming sources. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | Source/core/html/TimeRanges.cpp » ('j') | Source/core/html/TimeRangesTest.cpp » ('J')
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 3210 matching lines...) Expand 10 before | Expand all | Expand 10 after
3221 3221
3222 return m_playedTimeRanges->copy(); 3222 return m_playedTimeRanges->copy();
3223 } 3223 }
3224 3224
3225 PassRefPtrWillBeRawPtr<TimeRanges> HTMLMediaElement::seekable() const 3225 PassRefPtrWillBeRawPtr<TimeRanges> HTMLMediaElement::seekable() const
3226 { 3226 {
3227 if (webMediaPlayer()) { 3227 if (webMediaPlayer()) {
3228 double maxTimeSeekable = webMediaPlayer()->maxTimeSeekable(); 3228 double maxTimeSeekable = webMediaPlayer()->maxTimeSeekable();
3229 if (maxTimeSeekable) 3229 if (maxTimeSeekable)
3230 return TimeRanges::create(0, maxTimeSeekable); 3230 return TimeRanges::create(0, maxTimeSeekable);
3231 }
philipj_slow 2014/09/10 12:51:18 Doesn't compile ;)
DaleCurtis 2014/09/10 17:45:18 Heh, whoops, must have hit CtrlZ once too many bef
3232
3233 // For non-streaming media, emulate a seekable range around zero so loop ing works.
philipj_slow 2014/09/10 12:51:18 I don't think this is fixing the problem at the ap
acolwell GONE FROM CHROMIUM 2014/09/10 17:38:43 But we don't want to advertise that we can actuall
philipj_slow 2014/09/10 18:42:10 Oh, is a streaming cache used for non-seekable HTT
DaleCurtis 2014/09/10 18:56:49 Some are cached, some may not be depending on flag
3234
3235 if (duration() != std::numeric_limits<double>::infinity()) {
3236 RefPtrWillBeRawPtr<TimeRanges> ranges = TimeRanges::create();
3237 double now = webMediaPlayer()->currentTime();
3238 ranges->add(0, std::numeric_limits<double>::epsilon());
3239 ranges->add(now, now + std::numeric_limits<double>::epsilon());
acolwell GONE FROM CHROMIUM 2014/09/10 17:38:43 Have you tested this with https://codereview.chrom
DaleCurtis 2014/09/10 17:45:18 I haven't, but that CL just removes the noSeekRequ
acolwell GONE FROM CHROMIUM 2014/09/10 18:33:19 You only need the [0,epsilon) range for loop to wo
acolwell GONE FROM CHROMIUM 2014/09/10 18:41:05 Oh right. I didn't happen to notice that the neare
DaleCurtis 2014/09/10 18:56:49 Ah I thought you were asking to remove all ranges,
3240 return ranges;
3241 }
3231 } 3242 }
3232 return TimeRanges::create(); 3243 return TimeRanges::create();
3233 } 3244 }
3234 3245
3235 bool HTMLMediaElement::potentiallyPlaying() const 3246 bool HTMLMediaElement::potentiallyPlaying() const
3236 { 3247 {
3237 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing 3248 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing
3238 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the 3249 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the
3239 // checks in couldPlayIfEnoughData(). 3250 // checks in couldPlayIfEnoughData().
3240 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA; 3251 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA;
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
3970 3981
3971 #if ENABLE(WEB_AUDIO) 3982 #if ENABLE(WEB_AUDIO)
3972 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) 3983 void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
3973 { 3984 {
3974 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) 3985 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider())
3975 audioSourceProvider()->setClient(0); 3986 audioSourceProvider()->setClient(0);
3976 } 3987 }
3977 #endif 3988 #endif
3978 3989
3979 } 3990 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/TimeRanges.cpp » ('j') | Source/core/html/TimeRangesTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698