Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 [Story video] Use the inlined video response instead of issuing an …
…XHR request, for the 1st video of the 1st web story page (#37499) * For the first video of the first web story page, use the inlined video response instead of issuing an XHR request. * Refactor to prevent unnecessary XHR-related function calls * Fix promise * Syntax fix * Allow the XHR request to be sent if the inline video is unexpectedly absent * Lint * Remove unnecessary variable from shouldUseInlineVideoResponse and update comment * Wrap JSON.parse() in a try/catch * Pull out a new requestCachedVideoSources() method from the fetchCachedSources() method * Clean up preexisting lengthy if-statement * Simplify JSON parsing logic in requestCachedVideoSources * Add a check for the 'sources' key * Lint fix * Add initial, untested version of tests for inline video response logic * Add a describe grouping for the set of inline video response tests * Update logic for determining whether the inline response should be used * Get tests passing * Lint fixes
- Loading branch information
1 parent
795f3d5
commit c8ea23b
Showing
2 changed files
with
191 additions
and
25 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