| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 // pauseInternal) may still request currentPlaybackPosition at any time. | 2055 // pauseInternal) may still request currentPlaybackPosition at any time. |
| 2056 // From spec: "Media elements have a current playback position, which must | 2056 // From spec: "Media elements have a current playback position, which must |
| 2057 // initially (i.e., in the absence of media data) be zero seconds." | 2057 // initially (i.e., in the absence of media data) be zero seconds." |
| 2058 if (ready_state_ == kHaveNothing) | 2058 if (ready_state_ == kHaveNothing) |
| 2059 return 0; | 2059 return 0; |
| 2060 | 2060 |
| 2061 if (GetWebMediaPlayer()) | 2061 if (GetWebMediaPlayer()) |
| 2062 return GetWebMediaPlayer()->CurrentTime(); | 2062 return GetWebMediaPlayer()->CurrentTime(); |
| 2063 | 2063 |
| 2064 if (ready_state_ >= kHaveMetadata) { | 2064 if (ready_state_ >= kHaveMetadata) { |
| 2065 LOG(WARNING) << __func__ << " readyState = " << ready_state_ | 2065 BLINK_MEDIA_LOG |
| 2066 << " but no webMeidaPlayer to provide currentPlaybackPosition"; | 2066 << __func__ << " readyState = " << ready_state_ |
| 2067 << " but no webMediaPlayer to provide currentPlaybackPosition"; |
| 2067 } | 2068 } |
| 2068 | 2069 |
| 2069 return 0; | 2070 return 0; |
| 2070 } | 2071 } |
| 2071 | 2072 |
| 2072 double HTMLMediaElement::OfficialPlaybackPosition() const { | 2073 double HTMLMediaElement::OfficialPlaybackPosition() const { |
| 2073 // Hold updates to official playback position while paused or waiting for more | 2074 // Hold updates to official playback position while paused or waiting for more |
| 2074 // data. The underlying media player may continue to make small advances in | 2075 // data. The underlying media player may continue to make small advances in |
| 2075 // currentTime (e.g. as samples in the last rendered audio buffer are played | 2076 // currentTime (e.g. as samples in the last rendered audio buffer are played |
| 2076 // played out), but advancing currentTime while paused/waiting sends a mixed | 2077 // played out), but advancing currentTime while paused/waiting sends a mixed |
| (...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4268 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4269 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4269 } | 4270 } |
| 4270 | 4271 |
| 4271 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) { | 4272 void HTMLMediaElement::ViewportFillDebouncerTimerFired(TimerBase*) { |
| 4272 mostly_filling_viewport_ = true; | 4273 mostly_filling_viewport_ = true; |
| 4273 if (web_media_player_) | 4274 if (web_media_player_) |
| 4274 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_); | 4275 web_media_player_->BecameDominantVisibleContent(mostly_filling_viewport_); |
| 4275 } | 4276 } |
| 4276 | 4277 |
| 4277 } // namespace blink | 4278 } // namespace blink |
| OLD | NEW |