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

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

Issue 607493002: Introduce WebMediaPlayer::seekable() to replace maxTimeSeekable() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
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 3272 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 } 3283 }
3284 3284
3285 if (!m_playedTimeRanges) 3285 if (!m_playedTimeRanges)
3286 m_playedTimeRanges = TimeRanges::create(); 3286 m_playedTimeRanges = TimeRanges::create();
3287 3287
3288 return m_playedTimeRanges->copy(); 3288 return m_playedTimeRanges->copy();
3289 } 3289 }
3290 3290
3291 PassRefPtrWillBeRawPtr<TimeRanges> HTMLMediaElement::seekable() const 3291 PassRefPtrWillBeRawPtr<TimeRanges> HTMLMediaElement::seekable() const
3292 { 3292 {
3293 if (webMediaPlayer()) { 3293 if (!webMediaPlayer())
3294 double maxTimeSeekable = webMediaPlayer()->maxTimeSeekable(); 3294 return TimeRanges::create();
3295 if (maxTimeSeekable) 3295
3296 return TimeRanges::create(0, maxTimeSeekable); 3296 return TimeRanges::create(webMediaPlayer()->seekable());
3297 }
3298 return TimeRanges::create();
3299 } 3297 }
3300 3298
3301 bool HTMLMediaElement::potentiallyPlaying() const 3299 bool HTMLMediaElement::potentiallyPlaying() const
3302 { 3300 {
3303 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing 3301 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing
3304 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the 3302 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the
3305 // checks in couldPlayIfEnoughData(). 3303 // checks in couldPlayIfEnoughData().
3306 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA; 3304 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA;
3307 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController(); 3305 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController();
3308 } 3306 }
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
4031 4029
4032 #if ENABLE(WEB_AUDIO) 4030 #if ENABLE(WEB_AUDIO)
4033 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) 4031 void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
4034 { 4032 {
4035 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) 4033 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider())
4036 audioSourceProvider()->setClient(0); 4034 audioSourceProvider()->setClient(0);
4037 } 4035 }
4038 #endif 4036 #endif
4039 4037
4040 } 4038 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698