mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 560806 - No duration or seeking on Ogg video URL's that redirect - r=roc (CLOSED TREE)
This commit is contained in:
parent
bc56aab89c
commit
7d3964aa08
@ -441,6 +441,25 @@ nsHTMLMediaElement::OnChannelRedirect(nsIChannel *aChannel,
|
||||
{
|
||||
NS_ASSERTION(aChannel == mChannel, "Channels should match!");
|
||||
mChannel = aNewChannel;
|
||||
|
||||
// Handle forwarding of Range header so that the intial detection
|
||||
// of seeking support (via result code 206) works across redirects.
|
||||
nsCOMPtr<nsIHttpChannel> http = do_QueryInterface(aChannel);
|
||||
NS_ENSURE_STATE(http);
|
||||
|
||||
NS_NAMED_LITERAL_CSTRING(rangeHdr, "Range");
|
||||
|
||||
nsCAutoString rangeVal;
|
||||
if (NS_SUCCEEDED(http->GetRequestHeader(rangeHdr, rangeVal))) {
|
||||
NS_ENSURE_STATE(!rangeVal.IsEmpty());
|
||||
|
||||
http = do_QueryInterface(aNewChannel);
|
||||
NS_ENSURE_STATE(http);
|
||||
|
||||
nsresult rv = http->SetRequestHeader(rangeHdr, rangeVal, PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -75,6 +75,10 @@ var gPlayTests = [
|
||||
{ name:"audio-overhang.ogg", type:"audio/ogg", duration:2.3 },
|
||||
{ name:"video-overhang.ogg", type:"audio/ogg", duration:3.966 },
|
||||
|
||||
// Test playback/metadata work after a redirect
|
||||
{ name:"redirect.sjs?http://mochi.test:8888/tests/content/media/test/320x240.ogv",
|
||||
type:"video/ogg", duration:0.233 },
|
||||
|
||||
{ name:"bogus.duh", type:"bogus/duh" }
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user