Chromium Code Reviews| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 348 , m_seeking(false) | 348 , m_seeking(false) |
| 349 , m_sentStalledEvent(false) | 349 , m_sentStalledEvent(false) |
| 350 , m_sentEndEvent(false) | 350 , m_sentEndEvent(false) |
| 351 , m_pausedInternal(false) | 351 , m_pausedInternal(false) |
| 352 , m_closedCaptionsVisible(false) | 352 , m_closedCaptionsVisible(false) |
| 353 , m_completelyLoaded(false) | 353 , m_completelyLoaded(false) |
| 354 , m_havePreparedToPlay(false) | 354 , m_havePreparedToPlay(false) |
| 355 , m_tracksAreReady(true) | 355 , m_tracksAreReady(true) |
| 356 , m_haveVisibleTextTrack(false) | 356 , m_haveVisibleTextTrack(false) |
| 357 , m_processingPreferenceChange(false) | 357 , m_processingPreferenceChange(false) |
| 358 , m_jumped(false) | |
| 358 #if ENABLE(OILPAN) | 359 #if ENABLE(OILPAN) |
| 359 , m_isFinalizing(false) | 360 , m_isFinalizing(false) |
| 360 , m_closeMediaSourceWhenFinalizing(false) | 361 , m_closeMediaSourceWhenFinalizing(false) |
| 361 #endif | 362 #endif |
| 362 , m_lastTextTrackUpdateTime(-1) | 363 , m_lastTextTrackUpdateTime(-1) |
| 363 , m_audioTracks(AudioTrackList::create(*this)) | 364 , m_audioTracks(AudioTrackList::create(*this)) |
| 364 , m_videoTracks(VideoTrackList::create(*this)) | 365 , m_videoTracks(VideoTrackList::create(*this)) |
| 365 , m_textTracks(nullptr) | 366 , m_textTracks(nullptr) |
| 366 , m_ignoreTrackDisplayUpdate(0) | 367 , m_ignoreTrackDisplayUpdate(0) |
| 367 #if ENABLE(WEB_AUDIO) | 368 #if ENABLE(WEB_AUDIO) |
| (...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1817 | 1818 |
| 1818 selectInitialTracksIfNecessary(); | 1819 selectInitialTracksIfNecessary(); |
| 1819 | 1820 |
| 1820 m_duration = duration(); | 1821 m_duration = duration(); |
| 1821 scheduleEvent(EventTypeNames::durationchange); | 1822 scheduleEvent(EventTypeNames::durationchange); |
| 1822 | 1823 |
| 1823 if (isHTMLVideoElement()) | 1824 if (isHTMLVideoElement()) |
| 1824 scheduleEvent(EventTypeNames::resize); | 1825 scheduleEvent(EventTypeNames::resize); |
| 1825 scheduleEvent(EventTypeNames::loadedmetadata); | 1826 scheduleEvent(EventTypeNames::loadedmetadata); |
| 1826 | 1827 |
| 1828 m_jumped = false; | |
| 1827 if (m_defaultPlaybackStartPosition > 0) { | 1829 if (m_defaultPlaybackStartPosition > 0) { |
| 1828 seek(m_defaultPlaybackStartPosition); | 1830 seek(m_defaultPlaybackStartPosition); |
| 1831 m_jumped = true; | |
| 1829 m_defaultPlaybackStartPosition = 0; | 1832 m_defaultPlaybackStartPosition = 0; |
| 1830 } | 1833 } |
| 1831 | 1834 |
| 1832 if (hasMediaControls()) | 1835 if (hasMediaControls()) |
| 1833 mediaControls()->reset(); | 1836 mediaControls()->reset(); |
| 1834 if (renderer()) | 1837 if (renderer()) |
| 1835 renderer()->updateFromElement(); | 1838 renderer()->updateFromElement(); |
| 1836 } | 1839 } |
| 1837 | 1840 |
| 1838 bool shouldUpdateDisplayState = false; | 1841 bool shouldUpdateDisplayState = false; |
| 1839 | 1842 |
| 1840 if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA && !m_ haveFiredLoadedData) { | 1843 if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA && !m_ haveFiredLoadedData) { |
| 1841 m_haveFiredLoadedData = true; | 1844 m_haveFiredLoadedData = true; |
| 1842 shouldUpdateDisplayState = true; | 1845 shouldUpdateDisplayState = true; |
| 1843 scheduleEvent(EventTypeNames::loadeddata); | 1846 scheduleEvent(EventTypeNames::loadeddata); |
| 1844 setShouldDelayLoadEvent(false); | 1847 setShouldDelayLoadEvent(false); |
| 1845 applyMediaFragmentURI(); | 1848 if (!m_jumped) |
| 1849 applyMediaFragmentURI(); | |
|
amogh.bihani
2014/09/04 13:44:18
Could you help me understand why this is here? I m
philipj_slow
2014/09/04 13:46:45
Sorry, I didn't see this comment at first. You're
| |
| 1846 } | 1850 } |
| 1847 | 1851 |
| 1848 bool isPotentiallyPlaying = potentiallyPlaying(); | 1852 bool isPotentiallyPlaying = potentiallyPlaying(); |
| 1849 if (m_readyState == HAVE_FUTURE_DATA && oldState <= HAVE_CURRENT_DATA && tra cksAreReady) { | 1853 if (m_readyState == HAVE_FUTURE_DATA && oldState <= HAVE_CURRENT_DATA && tra cksAreReady) { |
| 1850 scheduleEvent(EventTypeNames::canplay); | 1854 scheduleEvent(EventTypeNames::canplay); |
| 1851 if (isPotentiallyPlaying) | 1855 if (isPotentiallyPlaying) |
| 1852 scheduleEvent(EventTypeNames::playing); | 1856 scheduleEvent(EventTypeNames::playing); |
| 1853 shouldUpdateDisplayState = true; | 1857 shouldUpdateDisplayState = true; |
| 1854 } | 1858 } |
| 1855 | 1859 |
| (...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3891 m_fragmentEndTime = MediaPlayer::invalidTime(); | 3895 m_fragmentEndTime = MediaPlayer::invalidTime(); |
| 3892 | 3896 |
| 3893 // FIXME: Add support for selecting tracks by ID with the Media Fragments tr ack dimension. | 3897 // FIXME: Add support for selecting tracks by ID with the Media Fragments tr ack dimension. |
| 3894 | 3898 |
| 3895 if (m_fragmentStartTime != MediaPlayer::invalidTime() && m_readyState < HAVE _FUTURE_DATA) | 3899 if (m_fragmentStartTime != MediaPlayer::invalidTime() && m_readyState < HAVE _FUTURE_DATA) |
| 3896 prepareToPlay(); | 3900 prepareToPlay(); |
| 3897 } | 3901 } |
| 3898 | 3902 |
| 3899 void HTMLMediaElement::applyMediaFragmentURI() | 3903 void HTMLMediaElement::applyMediaFragmentURI() |
| 3900 { | 3904 { |
| 3905 ASSERT(!m_jumped); | |
| 3906 | |
| 3901 if (m_fragmentStartTime != MediaPlayer::invalidTime()) { | 3907 if (m_fragmentStartTime != MediaPlayer::invalidTime()) { |
| 3902 m_sentEndEvent = false; | 3908 m_sentEndEvent = false; |
| 3903 UseCounter::count(document(), UseCounter::HTMLMediaElementSeekToFragment Start); | 3909 UseCounter::count(document(), UseCounter::HTMLMediaElementSeekToFragment Start); |
| 3904 seek(m_fragmentStartTime); | 3910 seek(m_fragmentStartTime); |
| 3911 m_jumped = true; | |
| 3905 } | 3912 } |
| 3906 } | 3913 } |
| 3907 | 3914 |
| 3908 WebMediaPlayer::CORSMode HTMLMediaElement::corsMode() const | 3915 WebMediaPlayer::CORSMode HTMLMediaElement::corsMode() const |
| 3909 { | 3916 { |
| 3910 const AtomicString& crossOriginMode = fastGetAttribute(crossoriginAttr); | 3917 const AtomicString& crossOriginMode = fastGetAttribute(crossoriginAttr); |
| 3911 if (crossOriginMode.isNull()) | 3918 if (crossOriginMode.isNull()) |
| 3912 return WebMediaPlayer::CORSModeUnspecified; | 3919 return WebMediaPlayer::CORSModeUnspecified; |
| 3913 if (equalIgnoringCase(crossOriginMode, "use-credentials")) | 3920 if (equalIgnoringCase(crossOriginMode, "use-credentials")) |
| 3914 return WebMediaPlayer::CORSModeUseCredentials; | 3921 return WebMediaPlayer::CORSModeUseCredentials; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4001 | 4008 |
| 4002 #if ENABLE(WEB_AUDIO) | 4009 #if ENABLE(WEB_AUDIO) |
| 4003 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 4010 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
| 4004 { | 4011 { |
| 4005 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) | 4012 if (!visitor->isAlive(m_audioSourceNode) && audioSourceProvider()) |
| 4006 audioSourceProvider()->setClient(0); | 4013 audioSourceProvider()->setClient(0); |
| 4007 } | 4014 } |
| 4008 #endif | 4015 #endif |
| 4009 | 4016 |
| 4010 } | 4017 } |
| OLD | NEW |