Chromium Code Reviews| Index: Source/core/html/HTMLMediaElement.cpp |
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
| index 9883ca15e071d770a2e497b891f9e0ff648b4a53..ee4c93c99f33be5c1f24f3f5fe25c92372174a04 100644 |
| --- a/Source/core/html/HTMLMediaElement.cpp |
| +++ b/Source/core/html/HTMLMediaElement.cpp |
| @@ -1866,7 +1866,7 @@ void HTMLMediaElement::addPlayedRange(double start, double end) |
| bool HTMLMediaElement::supportsSave() const |
| { |
| - return m_player ? m_player->supportsSave() : false; |
| + return webMediaPlayer() && webMediaPlayer()->supportsSave(); |
| } |
| void HTMLMediaElement::prepareToPlay() |
| @@ -1922,12 +1922,13 @@ void HTMLMediaElement::seek(double time, ExceptionState& exceptionState) |
| // time scale, we will ask the media engine to "seek" to the current movie time, which may be a noop and |
| // not generate a timechanged callback. This means m_seeking will never be cleared and we will never |
| // fire a 'seeked' event. |
| + double mediaTime = webMediaPlayer()->mediaTimeForTimeValue(time); |
| + if (time != mediaTime) { |
| #if !LOG_DISABLED |
| - double mediaTime = m_player->mediaTimeForTimeValue(time); |
| - if (time != mediaTime) |
| WTF_LOG(Media, "HTMLMediaElement::seek(%f) - media timeline equivalent is %f", time, mediaTime); |
| #endif |
| - time = m_player->mediaTimeForTimeValue(time); |
| + time = mediaTime; |
| + } |
| // 7 - If the (possibly now changed) new playback position is not in one of the ranges given in the |
| // seekable attribute, then let it be the position in one of the ranges given in the seekable attribute |
| @@ -3095,7 +3096,7 @@ void HTMLMediaElement::mediaPlayerPlaybackStateChanged() |
| if (!m_player || m_pausedInternal) |
| return; |
| - if (m_player->paused()) |
| + if (webMediaPlayer()->paused()) |
| pause(); |
| else |
| playInternal(); |
| @@ -3259,8 +3260,8 @@ void HTMLMediaElement::updatePlayState() |
| return; |
| if (m_pausedInternal) { |
| - if (!m_player->paused()) |
| - m_player->pause(); |
| + if (webMediaPlayer() && !webMediaPlayer()->paused()) |
|
acolwell GONE FROM CHROMIUM
2014/07/08 00:26:33
It seems like there are too many webMediaPlayer()
|
| + webMediaPlayer()->pause(); |
| refreshCachedTime(); |
| m_playbackProgressTimer.stop(); |
| if (hasMediaControls()) |
| @@ -3269,7 +3270,7 @@ void HTMLMediaElement::updatePlayState() |
| } |
| bool shouldBePlaying = potentiallyPlaying(); |
| - bool playerPaused = m_player->paused(); |
| + bool playerPaused = webMediaPlayer() && webMediaPlayer()->paused(); |
|
acolwell GONE FROM CHROMIUM
2014/07/08 00:26:33
remove this in favor of isPlaying mentioned above.
Srirama
2014/07/08 05:06:52
Done.
|
| WTF_LOG(Media, "HTMLMediaElement::updatePlayState - shouldBePlaying = %s, playerPaused = %s", |
| boolString(shouldBePlaying), boolString(playerPaused)); |
| @@ -3283,8 +3284,7 @@ void HTMLMediaElement::updatePlayState() |
| // The media engine should just stash the rate and muted values since it isn't already playing. |
| webMediaPlayer()->setRate(effectivePlaybackRate()); |
| updateVolume(); |
| - |
| - m_player->play(); |
| + webMediaPlayer()->play(); |
| } |
| if (hasMediaControls()) |
| @@ -3293,8 +3293,8 @@ void HTMLMediaElement::updatePlayState() |
| m_playing = true; |
| } else { // Should not be playing right now |
| - if (!playerPaused) |
| - m_player->pause(); |
| + if (!playerPaused && webMediaPlayer()) |
|
acolwell GONE FROM CHROMIUM
2014/07/08 00:26:33
I think this could become "if (isPlaying)".
Srirama
2014/07/08 05:06:52
Done.
|
| + webMediaPlayer()->pause(); |
| refreshCachedTime(); |
| m_playbackProgressTimer.stop(); |