| OLD | NEW |
| 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 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 { | 2074 { |
| 2075 if (m_mediaController) { | 2075 if (m_mediaController) { |
| 2076 exceptionState.throwDOMException(InvalidStateError, "The element is slav
ed to a MediaController."); | 2076 exceptionState.throwDOMException(InvalidStateError, "The element is slav
ed to a MediaController."); |
| 2077 return; | 2077 return; |
| 2078 } | 2078 } |
| 2079 seek(time, exceptionState); | 2079 seek(time, exceptionState); |
| 2080 } | 2080 } |
| 2081 | 2081 |
| 2082 double HTMLMediaElement::duration() const | 2082 double HTMLMediaElement::duration() const |
| 2083 { | 2083 { |
| 2084 if (m_readyState < HAVE_METADATA) | 2084 // FIXME: remove m_player check once we figure out how m_player is going |
| 2085 // out of sync with readystate. m_player is cleared but readystate is not se
t |
| 2086 // to HAVE_NOTHING |
| 2087 if (!m_player || m_readyState < HAVE_METADATA) |
| 2085 return std::numeric_limits<double>::quiet_NaN(); | 2088 return std::numeric_limits<double>::quiet_NaN(); |
| 2086 | 2089 |
| 2087 // FIXME: Refactor so m_duration is kept current (in both MSE and | 2090 // FIXME: Refactor so m_duration is kept current (in both MSE and |
| 2088 // non-MSE cases) once we have transitioned from HAVE_NOTHING -> | 2091 // non-MSE cases) once we have transitioned from HAVE_NOTHING -> |
| 2089 // HAVE_METADATA. Currently, m_duration may be out of date for at least MSE | 2092 // HAVE_METADATA. Currently, m_duration may be out of date for at least MSE |
| 2090 // case because MediaSource and SourceBuffer do not notify the element | 2093 // case because MediaSource and SourceBuffer do not notify the element |
| 2091 // directly upon duration changes caused by endOfStream, remove, or append | 2094 // directly upon duration changes caused by endOfStream, remove, or append |
| 2092 // operations; rather the notification is triggered by the WebMediaPlayer | 2095 // operations; rather the notification is triggered by the WebMediaPlayer |
| 2093 // implementation observing that the underlying engine has updated duration | 2096 // implementation observing that the underlying engine has updated duration |
| 2094 // and notifying the element to consult its MediaSource for current | 2097 // and notifying the element to consult its MediaSource for current |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3974 | 3977 |
| 3975 #if ENABLE(WEB_AUDIO) | 3978 #if ENABLE(WEB_AUDIO) |
| 3976 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 3979 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
| 3977 { | 3980 { |
| 3978 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) | 3981 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) |
| 3979 audioSourceProvider()->setClient(0); | 3982 audioSourceProvider()->setClient(0); |
| 3980 } | 3983 } |
| 3981 #endif | 3984 #endif |
| 3982 | 3985 |
| 3983 } | 3986 } |
| OLD | NEW |