Index: Source/core/html/HTMLMediaElement.cpp |
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
index ed492e581334d7b474003da397eae42f9782ab7c..c4f798079a48bc2b655b7e4da715b9a10e8483bc 100644 |
--- a/Source/core/html/HTMLMediaElement.cpp |
+++ b/Source/core/html/HTMLMediaElement.cpp |
@@ -1706,7 +1706,7 @@ void HTMLMediaElement::changeNetworkStateFromLoadingToIdle() |
// Schedule one last progress event so we guarantee that at least one is fired |
// for files that load very quickly. |
- if (m_player->didLoadingProgress()) |
+ if (webMediaPlayer() && webMediaPlayer()->didLoadingProgress()) |
scheduleEvent(EventTypeNames::progress); |
scheduleEvent(EventTypeNames::suspend); |
m_networkState = NETWORK_IDLE; |
@@ -1845,7 +1845,7 @@ void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*) |
double time = WTF::currentTime(); |
double timedelta = time - m_previousProgressTime; |
- if (m_player->didLoadingProgress()) { |
+ if (webMediaPlayer() && webMediaPlayer()->didLoadingProgress()) { |
scheduleEvent(EventTypeNames::progress); |
m_previousProgressTime = time; |
m_sentStalledEvent = false; |
@@ -2134,8 +2134,8 @@ HTMLMediaElement::DirectionOfPlayback HTMLMediaElement::directionOfPlayback() co |
void HTMLMediaElement::updatePlaybackRate() |
{ |
double effectiveRate = effectivePlaybackRate(); |
- if (m_player && potentiallyPlaying() && m_player->rate() != effectiveRate) |
- m_player->setRate(effectiveRate); |
+ if (m_player && potentiallyPlaying()) |
+ webMediaPlayer()->setRate(effectiveRate); |
} |
bool HTMLMediaElement::ended() const |
@@ -3152,13 +3152,13 @@ void HTMLMediaElement::mediaPlayerSizeChanged() |
PassRefPtr<TimeRanges> HTMLMediaElement::buffered() const |
{ |
- if (!m_player) |
- return TimeRanges::create(); |
- |
if (m_mediaSource) |
return m_mediaSource->buffered(); |
- return m_player->buffered(); |
+ if (!webMediaPlayer()) |
+ return TimeRanges::create(); |
+ |
+ return TimeRanges::create(webMediaPlayer()->buffered()); |
} |
PassRefPtr<TimeRanges> HTMLMediaElement::played() |
@@ -3177,8 +3177,8 @@ PassRefPtr<TimeRanges> HTMLMediaElement::played() |
PassRefPtr<TimeRanges> HTMLMediaElement::seekable() const |
{ |
- if (m_player) { |
- double maxTimeSeekable = m_player->maxTimeSeekable(); |
+ if (webMediaPlayer()) { |
+ double maxTimeSeekable = webMediaPlayer()->maxTimeSeekable(); |
if (maxTimeSeekable) |
return TimeRanges::create(0, maxTimeSeekable); |
} |
@@ -3286,7 +3286,7 @@ void HTMLMediaElement::updatePlayState() |
if (playerPaused) { |
// Set rate, muted before calling play in case they were set before the media engine was setup. |
// The media engine should just stash the rate and muted values since it isn't already playing. |
- m_player->setRate(effectivePlaybackRate()); |
+ webMediaPlayer()->setRate(effectivePlaybackRate()); |
updateVolume(); |
m_player->play(); |