| Index: trunk/Source/core/html/HTMLMediaElement.cpp
|
| ===================================================================
|
| --- trunk/Source/core/html/HTMLMediaElement.cpp (revision 169469)
|
| +++ trunk/Source/core/html/HTMLMediaElement.cpp (working copy)
|
| @@ -84,7 +84,6 @@
|
|
|
| using namespace std;
|
| using blink::WebInbandTextTrack;
|
| -using blink::WebMediaPlayer;
|
| using blink::WebMimeRegistry;
|
|
|
| namespace WebCore {
|
| @@ -274,7 +273,6 @@
|
| , m_closedCaptionsVisible(false)
|
| , m_completelyLoaded(false)
|
| , m_havePreparedToPlay(false)
|
| - , m_delayingLoadForPreloadNone(false)
|
| , m_tracksAreReady(true)
|
| , m_haveVisibleTextTrack(false)
|
| , m_processingPreferenceChange(false)
|
| @@ -415,7 +413,7 @@
|
|
|
| // The attribute must be ignored if the autoplay attribute is present
|
| if (!autoplay() && m_player)
|
| - setPlayerPreload();
|
| + m_player->setPreload(m_preload);
|
|
|
| } else if (name == mediagroupAttr)
|
| setMediaGroup(value);
|
| @@ -831,13 +829,15 @@
|
|
|
| WTF_LOG(Media, "HTMLMediaElement::loadResource - m_currentSrc -> %s", urlForLoggingMedia(m_currentSrc).utf8().data());
|
|
|
| + blink::WebMediaPlayer::LoadType loadType = blink::WebMediaPlayer::LoadTypeURL;
|
| +
|
| startProgressEventTimer();
|
|
|
| // Reset display mode to force a recalculation of what to show because we are resetting the player.
|
| setDisplayMode(Unknown);
|
|
|
| if (!autoplay())
|
| - setPlayerPreload();
|
| + m_player->setPreload(m_preload);
|
|
|
| if (fastHasAttribute(mutedAttr))
|
| m_muted = true;
|
| @@ -849,11 +849,14 @@
|
|
|
| if (url.protocolIs(mediaSourceBlobProtocol)) {
|
| if (isMediaStreamURL(url.string())) {
|
| + loadType = blink::WebMediaPlayer::LoadTypeMediaStream;
|
| m_userGestureRequiredForPlay = false;
|
| } else {
|
| m_mediaSource = HTMLMediaSource::lookup(url.string());
|
|
|
| if (m_mediaSource) {
|
| + loadType = blink::WebMediaPlayer::LoadTypeMediaSource;
|
| +
|
| if (!m_mediaSource->attachToElement(this)) {
|
| // Forget our reference to the MediaSource, so we leave it alone
|
| // while processing remainder of load failure.
|
| @@ -865,13 +868,7 @@
|
| }
|
|
|
| if (attemptLoad && canLoadURL(url, contentType, keySystem)) {
|
| - ASSERT(!webMediaPlayer());
|
| -
|
| - if (m_preload == MediaPlayer::None) {
|
| - m_delayingLoadForPreloadNone = true;
|
| - } else {
|
| - m_player->load(loadType(), m_currentSrc, corsMode());
|
| - }
|
| + m_player->load(loadType, url);
|
| } else {
|
| mediaLoadingFailed(MediaPlayer::FormatError);
|
| }
|
| @@ -884,34 +881,6 @@
|
| renderer()->updateFromElement();
|
| }
|
|
|
| -void HTMLMediaElement::setPlayerPreload()
|
| -{
|
| - m_player->setPreload(m_preload);
|
| -
|
| - if (m_delayingLoadForPreloadNone && m_preload != MediaPlayer::None)
|
| - startDelayedLoad();
|
| -}
|
| -
|
| -void HTMLMediaElement::startDelayedLoad()
|
| -{
|
| - ASSERT(m_delayingLoadForPreloadNone);
|
| -
|
| - m_delayingLoadForPreloadNone = false;
|
| -
|
| - m_player->load(loadType(), m_currentSrc, corsMode());
|
| -}
|
| -
|
| -WebMediaPlayer::LoadType HTMLMediaElement::loadType() const
|
| -{
|
| - if (m_mediaSource)
|
| - return WebMediaPlayer::LoadTypeMediaSource;
|
| -
|
| - if (isMediaStreamURL(m_currentSrc.string()))
|
| - return WebMediaPlayer::LoadTypeMediaStream;
|
| -
|
| - return WebMediaPlayer::LoadTypeURL;
|
| -}
|
| -
|
| static bool trackIndexCompare(TextTrack* a,
|
| TextTrack* b)
|
| {
|
| @@ -1698,9 +1667,7 @@
|
| if (m_havePreparedToPlay)
|
| return;
|
| m_havePreparedToPlay = true;
|
| -
|
| - if (m_delayingLoadForPreloadNone)
|
| - startDelayedLoad();
|
| + m_player->prepareToPlay();
|
| }
|
|
|
| void HTMLMediaElement::seek(double time, ExceptionState& exceptionState)
|
| @@ -3152,8 +3119,6 @@
|
|
|
| closeMediaSource();
|
|
|
| - m_delayingLoadForPreloadNone = false;
|
| -
|
| clearMediaPlayerAndAudioSourceProviderClient();
|
|
|
| stopPeriodicTimers();
|
| @@ -3614,14 +3579,14 @@
|
| }
|
| }
|
|
|
| -WebMediaPlayer::CORSMode HTMLMediaElement::corsMode() const
|
| +MediaPlayerClient::CORSMode HTMLMediaElement::mediaPlayerCORSMode() const
|
| {
|
| const AtomicString& crossOriginMode = fastGetAttribute(crossoriginAttr);
|
| if (crossOriginMode.isNull())
|
| - return WebMediaPlayer::CORSModeUnspecified;
|
| + return Unspecified;
|
| if (equalIgnoringCase(crossOriginMode, "use-credentials"))
|
| - return WebMediaPlayer::CORSModeUseCredentials;
|
| - return WebMediaPlayer::CORSModeAnonymous;
|
| + return UseCredentials;
|
| + return Anonymous;
|
| }
|
|
|
| void HTMLMediaElement::mediaPlayerSetWebLayer(blink::WebLayer* webLayer)
|
|
|