Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename 'blacklist' to 'exclude' #1274

Merged
merged 8 commits into from
Jun 23, 2022

Conversation

harisha-swaminathan
Copy link
Contributor

No description provided.

@harisha-swaminathan harisha-swaminathan changed the base branch from main to next April 22, 2022 19:26
@harisha-swaminathan harisha-swaminathan changed the base branch from next to main April 22, 2022 19:27
@codecov
Copy link

codecov bot commented Apr 22, 2022

Codecov Report

Merging #1274 (3c688bc) into next (43fce26) will decrease coverage by 0.01%.
The diff coverage is 97.05%.

@@            Coverage Diff             @@
##             next    #1274      +/-   ##
==========================================
- Coverage   86.24%   86.22%   -0.02%     
==========================================
  Files          39       39              
  Lines        9769     9757      -12     
  Branches     2281     2276       -5     
==========================================
- Hits         8425     8413      -12     
  Misses       1344     1344              
Impacted Files Coverage Δ
src/dash-playlist-loader.js 90.05% <ø> (ø)
src/media-segment-request.js 95.40% <ø> (ø)
src/playback-watcher.js 98.33% <ø> (-0.45%) ⬇️
src/playlist-selectors.js 87.05% <ø> (ø)
src/segment-loader.js 96.36% <ø> (ø)
src/master-playlist-controller.js 94.95% <96.42%> (-0.02%) ⬇️
src/media-groups.js 98.66% <100.00%> (ø)
src/playlist.js 94.56% <100.00%> (ø)
src/videojs-http-streaming.js 90.41% <100.00%> (+0.17%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43fce26...3c688bc. Read the comment docs.

Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're modifying the public pieces, it may be worth renaming all instance of blacklist throughout the repo as well as the properties (e.g., ABORT_EARLY_BLACKLIST_SECONDS and blacklistReasons in MasterPlaylistController, various comments talking about blacklisting, and test messages).

We also should start a migration guide for updating to the next major version.

Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are only a few more references.

There are other modules, and other functions of the code (e.g., blacklisting logic, ABR, etc.), but this is the most critical path of VHS, the one that allows video to play in the browser.

// because we can only blacklist a playlist and abort requests

and then we trigger blacklistplaylist in src/master-playlist-controller.js:

this.tech_.trigger('blacklistplaylist');

(and test for it in test/videojs-http-streaming.text.js):

this.player.tech_.on('blacklistplaylist', () => excludedplaylist++);

test/playlist.test.js Outdated Show resolved Hide resolved
test/videojs-http-streaming.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thank you for doing the extra rename!

src/master-playlist-controller.js Outdated Show resolved Hide resolved
@@ -1143,20 +1143,20 @@ export class MasterPlaylistController extends videojs.EventTarget {
* @param {number=} playlistExclusionDuration an optional number of seconds to exclude the
* playlist
*/
excludeCurrentPlaylist(error = {}, playlistExclusionDuration) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be a bit more work, but it might be worth us having to functions: excludeCurrentPlaylist and excludePlaylist

excludeCurrentPlaylist can call excludePlaylist with an explicit playlist (this.masterPlaylistLoader_.media()), and excludePlaylist accepts a playlistToExclude param.

This would let the code read clearer for callers of the function.

Co-authored-by: Garrett Singer <[email protected]>
@gesinger gesinger merged commit d79d783 into videojs:next Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants