Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2095053003: Merge M52: "When HLS redirects are encountered recreate WebMediaPlayer." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 497fc9d504d7e0d6b68336f15fcf68ef1a751b5f..cc1342973ea1105afb9faf392176c2a8e7afa79d 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -932,8 +932,7 @@ void HTMLMediaElement::loadSourceFromObject()
// No type is available when the resource comes from the 'srcObject'
// attribute.
- ContentType contentType((String()));
- loadResource(WebMediaPlayerSource(WebMediaStream(m_srcObject)), contentType);
+ loadResource(WebMediaPlayerSource(WebMediaStream(m_srcObject)), ContentType((String())));
}
void HTMLMediaElement::loadSourceFromAttribute()
@@ -956,8 +955,7 @@ void HTMLMediaElement::loadSourceFromAttribute()
// No type is available when the url comes from the 'src' attribute so
// MediaPlayer will have to pick a media engine based on the file extension.
- ContentType contentType((String()));
- loadResource(WebMediaPlayerSource(WebURL(mediaURL)), contentType);
+ loadResource(WebMediaPlayerSource(WebURL(mediaURL)), ContentType((String())));
}
void HTMLMediaElement::loadNextSourceChild()
@@ -976,7 +974,7 @@ void HTMLMediaElement::loadNextSourceChild()
loadResource(WebMediaPlayerSource(WebURL(mediaURL)), contentType);
}
-void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source, ContentType& contentType)
+void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source, const ContentType& contentType)
{
ASSERT(isMainThread());
KURL url;
@@ -1065,7 +1063,7 @@ void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source, ContentT
layoutObject()->updateFromElement();
}
-void HTMLMediaElement::startPlayerLoad()
+void HTMLMediaElement::startPlayerLoad(const KURL& playerProvidedUrl)
{
ASSERT(!m_webMediaPlayer);
@@ -1086,7 +1084,7 @@ void HTMLMediaElement::startPlayerLoad()
// 'authentication flag' to control how user:pass embedded in a
// media resource URL should be treated, then update the handling
// here to match.
- KURL requestURL = m_currentSrc;
+ KURL requestURL = playerProvidedUrl.isNull() ? KURL(m_currentSrc) : playerProvidedUrl;
if (!requestURL.user().isEmpty())
requestURL.setUser(String());
if (!requestURL.pass().isEmpty())
@@ -2970,6 +2968,16 @@ void HTMLMediaElement::cancelledRemotePlaybackRequest()
remotePlaybackClient()->connectCancelled();
}
+void HTMLMediaElement::requestReload(const WebURL& newUrl)
+{
+ DCHECK(webMediaPlayer());
+ DCHECK(!m_srcObject);
+ DCHECK(newUrl.isValid());
+ DCHECK(isSafeToLoadURL(newUrl, Complain));
+ resetMediaPlayerAndMediaSource();
+ startPlayerLoad(newUrl);
+}
+
// MediaPlayerPresentation methods
void HTMLMediaElement::repaint()
{
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.h ('k') | third_party/WebKit/public/platform/WebMediaPlayerClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698