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

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

Issue 2046253002: When HLS redirects are encountered recreate WebMediaPlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failures. 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 59ec313479d5ee3100f21ca36dafafa2cc016bcf..bff62e7bfdb250473405fbd5bc2215a8d99b8bf2 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -944,8 +944,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()
@@ -968,8 +967,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()
@@ -988,7 +986,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)
{
DCHECK(isMainThread());
KURL url;
@@ -1077,7 +1075,7 @@ void HTMLMediaElement::loadResource(const WebMediaPlayerSource& source, ContentT
layoutObject()->updateFromElement();
}
-void HTMLMediaElement::startPlayerLoad()
+void HTMLMediaElement::startPlayerLoad(const KURL& playerProvidedUrl)
{
DCHECK(!m_webMediaPlayer);
@@ -1098,7 +1096,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())
@@ -2999,6 +2997,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