Repository navigation
Send request headers with each asset, and let apps adjust each WebView - #57
Merged
Merged
Conversation
GaplessAsset.requestHeaders are sent with every request for the asset: the video's manifest and segments, the image, and the web page's main document. Header names and values are checked when the playlist is set. GaplessWebConfig.configureWebView is called with each WebView once the library has set it up, including a WebView that replaces a crashed one. An app can change any setting, set its own WebChromeClient, or set its own WebViewClient: the library keeps its client on the WebView and passes every callback on to the app's, except onRenderProcessGone. JavaScript and the gapless interface are turned back on if the function removes them. The sample app gets an HLS sample and a network playlist that plays from a local server with a header.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GaplessAsset.requestHeadersare sent with every request for an asset:ResolvingDataSourcethat reads the slot's headers per requesthttpHeadersWebViewClient(below).Header names must be non-blank with no whitespace or
:, and values can't contain CR or LF. Both are checked when the playlist is set.GaplessWebConfig.configureWebViewis called with each WebView once the library has set it up and before it loads anything, including the WebView that replaces one whose renderer crashed. An app can change any setting, set its ownWebChromeClient, or add a JavaScript interface. AWebViewClientof its own works too: the library keeps its client on the WebView and passes every callback on to the app's, soshouldInterceptRequest(offline pages) andonReceivedHttpAuthRequest(basic auth) work.onRenderProcessGoneisn't passed on, since the library replaces the crashed WebView itself. If the function turns JavaScript off or removes thegaplessinterface, the library turns them back on and logs a warning. If it throws, the error is logged and the WebView is used as the library set it up.The sample app gets an HLS sample and a
networkplaylist. With--es serverand--es header, the sample assets are fetched from a local server with that header, which showed the header arriving on the HLS manifest and segments, the MP4, the image and the page on both TVs.