Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
WebKit ought to be able to play videos without Content-Length HTTP he…
…ader fields and without range support https://bugs.webkit.org/show_bug.cgi?id=232174 Patch by Alex Christensen <achristensen@webkit.org> on 2021-10-25 Reviewed by Geoff Garen. LayoutTests/imported/w3c: * web-platform-tests/service-workers/service-worker/fetch-audio-tainting.https-expected.txt: Source/WebCore: AVFoundation doesn't like it when you give it a range like 0-1/* because it doesn't know the content length. To work around this, wait until the entire video is loaded then respond with a known length. This isn't great, but it's better than not playing the video at all. In order to fix this, I noticed that the setHTTPHeaderField and setHTTPStatusCode calls were not being reflected in the new NSURLResponse, so I added a call to initNSURLResponse to update the NSURLResponse. I'm concerned about what other videos were not having the synthesized response updated, and I'm surprised non-range-response-supporting videos played without this change. This makes it so we can play videos like https://trac.webkit.org/export/284633/webkit/trunk/Tools/TestWebKitAPI/Tests/WebKit/test.mp4 which can play in Chrome and Firefox. Covered by an API test. * platform/network/cf/ResourceResponse.h: * platform/network/cocoa/RangeResponseGenerator.mm: (WebCore::synthesizedResponseForRange): (WebCore::RangeResponseGenerator::giveResponseToTaskIfBytesInRangeReceived): * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]): Tools: * TestWebKitAPI/Tests/WebKitCocoa/MediaLoading.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/243508@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
2ae6062
commit 934a244a26ac0fa8cf13a007742d4a51ea6e9186
Showing
8 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
|
||
|
||
Harness Error (TIMEOUT), message = null | ||
|
||
TIMEOUT Verify CORS XHR of fetch() in a Service Worker Test timed out | ||
PASS Verify CORS XHR of fetch() in a Service Worker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters