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

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

Issue 710173004: Implement seekable() according to the MediaSource specification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix some small review nits Created 6 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
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 3334 matching lines...) Expand 10 before | Expand all | Expand 10 after
3345 m_playedTimeRanges = TimeRanges::create(); 3345 m_playedTimeRanges = TimeRanges::create();
3346 3346
3347 return m_playedTimeRanges->copy(); 3347 return m_playedTimeRanges->copy();
3348 } 3348 }
3349 3349
3350 PassRefPtrWillBeRawPtr<TimeRanges> HTMLMediaElement::seekable() const 3350 PassRefPtrWillBeRawPtr<TimeRanges> HTMLMediaElement::seekable() const
3351 { 3351 {
3352 if (!webMediaPlayer()) 3352 if (!webMediaPlayer())
3353 return TimeRanges::create(); 3353 return TimeRanges::create();
3354 3354
3355 if (m_mediaSource)
3356 return m_mediaSource->seekable();
3357
3355 return TimeRanges::create(webMediaPlayer()->seekable()); 3358 return TimeRanges::create(webMediaPlayer()->seekable());
3356 } 3359 }
3357 3360
3358 bool HTMLMediaElement::potentiallyPlaying() const 3361 bool HTMLMediaElement::potentiallyPlaying() const
3359 { 3362 {
3360 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing 3363 // "pausedToBuffer" means the media engine's rate is 0, but only because it had to stop playing
3361 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the 3364 // when it ran out of buffered data. A movie is this state is "potentially p laying", modulo the
3362 // checks in couldPlayIfEnoughData(). 3365 // checks in couldPlayIfEnoughData().
3363 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA; 3366 bool pausedToBuffer = m_readyStateMaximum >= HAVE_FUTURE_DATA && m_readyStat e < HAVE_FUTURE_DATA;
3364 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController(); 3367 return (pausedToBuffer || m_readyState >= HAVE_FUTURE_DATA) && couldPlayIfEn oughData() && !isBlockedOnMediaController();
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
4094 4097
4095 #if ENABLE(WEB_AUDIO) 4098 #if ENABLE(WEB_AUDIO)
4096 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) 4099 void HTMLMediaElement::clearWeakMembers(Visitor* visitor)
4097 { 4100 {
4098 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) 4101 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider())
4099 audioSourceProvider()->setClient(nullptr); 4102 audioSourceProvider()->setClient(nullptr);
4100 } 4103 }
4101 #endif 4104 #endif
4102 4105
4103 } 4106 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/media/media-source/mediasource-util.js ('k') | Source/core/html/HTMLMediaSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698