-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Sort video sources by tuples of (codec, bitrate) and append codec i…
…nformation to the video's type attribute (#36224) * Sort the video sources first by descending codec priority, and then by descending bitrate value * Update sorting test and fix the returned negative/positive sorting values in the comparator function * Replace the .foreach with a for loop because values returned within the .foreach were being ignored, and fixing it would result in less readable code than a simple for loop * Remove unnecessary code * Add codec information recieved from video cache to type attribute on video sources; split added test into 2 (validation of bitrate sort and validation of codec sort); update test video json to include codec information * Rewrite sort using indexof() instead of a for loop, for increased clarity * Slight sort() return code & comment update * Remove unnecessary 'type' key when creating video elements * Add a third test that ensures that sources are sorted by both codec and bitrate * Add a 4th source to the 3rd video cache test * Fix comments within the sort() and forEach(), and use constants to describe the sorting behavior
- Loading branch information
1 parent
1032c4d
commit 4d1be4e
Showing
2 changed files
with
246 additions
and
19 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