diff --git a/README.md b/README.md index 5cb49bdf0..f8f5a47d2 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Video.js Compatibility: 6.0, 7.0 - [useCueTags](#usecuetags) - [parse708captions](#parse708captions) - [overrideNative](#overridenative) - - [blacklistDuration](#blacklistduration) + - [playlistExclusionDuration](#playlistexclusionduration) - [maxPlaylistRetries](#maxplaylistretries) - [bandwidth](#bandwidth) - [useBandwidthFromLocalStorage](#usebandwidthfromlocalstorage) @@ -346,13 +346,13 @@ var player = videojs('playerId', { Since MSE playback may be desirable on all browsers with some native support other than Safari, `overrideNative: !videojs.browser.IS_SAFARI` could be used. -##### blacklistDuration +##### playlistExclusionDuration * Type: `number` * can be used as an initialization option -When the `blacklistDuration` property is set to a time duration in seconds, -if a playlist is blacklisted, it will be blacklisted for a period of that -customized duration. This enables the blacklist duration to be configured +When the `playlistExclusionDuration` property is set to a time duration in seconds, +if a playlist is excluded, it will be excluded for a period of that +customized duration. This enables the exclusion duration to be configured by the user. ##### maxPlaylistRetries @@ -761,7 +761,7 @@ Each of the following usage events are fired per use: | vhs-audio-change | a user selected an alternate audio stream | | vhs-rendition-disabled | a rendition was disabled | | vhs-rendition-enabled | a rendition was enabled | -| vhs-rendition-blacklisted | a rendition was blacklisted | +| vhs-rendition-excluded| a rendition was excluded | | vhs-timestamp-offset | a timestamp offset was set in HLS (can identify discontinuities) | | vhs-unknown-waiting | the player stopped for an unknown reason and we seeked to current time try to address it | | vhs-live-resync | playback fell off the back of a live playlist and we resynced to the live point | diff --git a/docs/a-walk-through-vhs.md b/docs/a-walk-through-vhs.md index ac7b3ec81..0a1c4e941 100644 --- a/docs/a-walk-through-vhs.md +++ b/docs/a-walk-through-vhs.md @@ -247,4 +247,4 @@ The video can start playing as soon as there's enough audio and video (for muxed But once `SegmentLoader` does finish, it starts the process again, looking for new content. -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. +There are other modules, and other functions of the code (e.g., excluding logic, ABR, etc.), but this is the most critical path of VHS, the one that allows video to play in the browser. diff --git a/src/dash-playlist-loader.js b/src/dash-playlist-loader.js index 6829b52d8..9b9440191 100644 --- a/src/dash-playlist-loader.js +++ b/src/dash-playlist-loader.js @@ -388,7 +388,7 @@ export default class DashPlaylistLoader extends EventTarget { response: '', playlist, internal: true, - blacklistDuration: Infinity, + playlistExclusionDuration: Infinity, // MEDIA_ERR_NETWORK code: 2 }, request); diff --git a/src/master-playlist-controller.js b/src/master-playlist-controller.js index 579dbd7c4..b8a5fe2a9 100644 --- a/src/master-playlist-controller.js +++ b/src/master-playlist-controller.js @@ -26,7 +26,7 @@ import { codecsForPlaylist, unwrapCodecList, codecCount } from './util/codecs.js import { createMediaTypes, setupMediaGroups } from './media-groups'; import logger from './util/logger'; -const ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2; +const ABORT_EARLY_EXCLUSION_SECONDS = 60 * 2; let Vhs; @@ -155,7 +155,7 @@ export class MasterPlaylistController extends videojs.EventTarget { bandwidth, externVhs, useCueTags, - blacklistDuration, + playlistExclusionDuration, enableLowInitialPlaylist, sourceType, cacheEncryptionKeys, @@ -183,7 +183,7 @@ export class MasterPlaylistController extends videojs.EventTarget { this.vhs_ = tech.vhs; this.sourceType_ = sourceType; this.useCueTags_ = useCueTags; - this.blacklistDuration = blacklistDuration; + this.playlistExclusionDuration = playlistExclusionDuration; this.maxPlaylistRetries = maxPlaylistRetries; this.enableLowInitialPlaylist = enableLowInitialPlaylist; @@ -525,7 +525,7 @@ export class MasterPlaylistController extends videojs.EventTarget { vhs: this.vhs_, master: this.master(), mediaTypes: this.mediaTypes_, - blacklistCurrentPlaylist: this.blacklistCurrentPlaylist.bind(this) + excludePlaylist: this.excludePlaylist.bind(this) }); this.triggerPresenceUsage_(this.master(), media); @@ -592,7 +592,7 @@ export class MasterPlaylistController extends videojs.EventTarget { }); this.masterPlaylistLoader_.on('error', () => { - this.blacklistCurrentPlaylist(this.masterPlaylistLoader_.error); + this.excludePlaylist(this.masterPlaylistLoader_.error); }); this.masterPlaylistLoader_.on('mediachanging', () => { @@ -640,10 +640,10 @@ export class MasterPlaylistController extends videojs.EventTarget { if (playlistOutdated) { // Playlist has stopped updating and we're stuck at its end. Try to - // blacklist it and switch to another playlist in the hope that that + // exclude it and switch to another playlist in the hope that that // one is updating (and give the player a chance to re-adjust to the // safe live point). - this.blacklistCurrentPlaylist({ + this.excludePlaylist({ message: 'Playlist no longer updating.', reason: 'playlist-unchanged' }); @@ -778,7 +778,7 @@ export class MasterPlaylistController extends videojs.EventTarget { } this.mainSegmentLoader_.on('error', () => { - this.blacklistCurrentPlaylist(this.mainSegmentLoader_.error()); + this.excludePlaylist(this.mainSegmentLoader_.error()); }); this.mainSegmentLoader_.on('appenderror', () => { @@ -815,10 +815,10 @@ export class MasterPlaylistController extends videojs.EventTarget { this.delegateLoaders_('all', ['abort']); - this.blacklistCurrentPlaylist({ + this.excludePlaylist({ message: 'Aborted early because there isn\'t enough bandwidth to complete the ' + 'request without rebuffering.' - }, ABORT_EARLY_BLACKLIST_SECONDS); + }, ABORT_EARLY_EXCLUSION_SECONDS); }); const updateCodecs = () => { @@ -1122,29 +1122,29 @@ export class MasterPlaylistController extends videojs.EventTarget { } /** - * Blacklists a playlist when an error occurs for a set amount of time + * Exclude a playlist when an error occurs for a set amount of time * making it unavailable for selection by the rendition selection algorithm * and then forces a new playlist (rendition) selection. * * @param {Object=} error an optional error that may include the playlist - * to blacklist - * @param {number=} blacklistDuration an optional number of seconds to blacklist the + * to exclude + * @param {number=} playlistExclusionDuration an optional number of seconds to exclude the * playlist */ - blacklistCurrentPlaylist(error = {}, blacklistDuration) { + excludePlaylist(error = {}, playlistExclusionDuration) { // If the `error` was generated by the playlist loader, it will contain // the playlist we were trying to load (but failed) and that should be - // blacklisted instead of the currently selected playlist which is likely + // excluded instead of the currently selected playlist which is likely // out-of-date in this scenario - const currentPlaylist = error.playlist || this.masterPlaylistLoader_.media(); + const playlistToExclude = error.playlist || this.masterPlaylistLoader_.media(); - blacklistDuration = blacklistDuration || - error.blacklistDuration || - this.blacklistDuration; + playlistExclusionDuration = playlistExclusionDuration || + error.playlistExclusionDuration || + this.playlistExclusionDuration; // If there is no current playlist, then an error occurred while we were // trying to load the master OR while we were disposing of the tech - if (!currentPlaylist) { + if (!playlistToExclude) { this.error = error; if (this.mediaSource.readyState !== 'open') { @@ -1156,16 +1156,16 @@ export class MasterPlaylistController extends videojs.EventTarget { return; } - currentPlaylist.playlistErrors_++; + playlistToExclude.playlistErrors_++; const playlists = this.masterPlaylistLoader_.master.playlists; const enabledPlaylists = playlists.filter(isEnabled); - const isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === currentPlaylist; + const isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === playlistToExclude; - // Don't blacklist the only playlist unless it was blacklisted + // Don't exclude the only playlist unless it was excluded // forever - if (playlists.length === 1 && blacklistDuration !== Infinity) { - videojs.log.warn(`Problem encountered with playlist ${currentPlaylist.id}. ` + + if (playlists.length === 1 && playlistExclusionDuration !== Infinity) { + videojs.log.warn(`Problem encountered with playlist ${playlistToExclude.id}. ` + 'Trying again since it is the only playlist.'); this.tech_.trigger('retryplaylist'); @@ -1174,15 +1174,15 @@ export class MasterPlaylistController extends videojs.EventTarget { } if (isFinalRendition) { - // Since we're on the final non-blacklisted playlist, and we're about to blacklist + // Since we're on the final non-excluded playlist, and we're about to exclude // it, instead of erring the player or retrying this playlist, clear out the current - // blacklist. This allows other playlists to be attempted in case any have been + // exclusion list. This allows other playlists to be attempted in case any have been // fixed. let reincluded = false; playlists.forEach((playlist) => { - // skip current playlist which is about to be blacklisted - if (playlist === currentPlaylist) { + // skip current playlist which is about to be excluded + if (playlist === playlistToExclude) { return; } const excludeUntil = playlist.excludeUntil; @@ -1204,28 +1204,27 @@ export class MasterPlaylistController extends videojs.EventTarget { } } - // Blacklist this playlist + // Exclude this playlist let excludeUntil; - if (currentPlaylist.playlistErrors_ > this.maxPlaylistRetries) { + if (playlistToExclude.playlistErrors_ > this.maxPlaylistRetries) { excludeUntil = Infinity; } else { - excludeUntil = Date.now() + (blacklistDuration * 1000); + excludeUntil = Date.now() + (playlistExclusionDuration * 1000); } - currentPlaylist.excludeUntil = excludeUntil; + playlistToExclude.excludeUntil = excludeUntil; if (error.reason) { - currentPlaylist.lastExcludeReason_ = error.reason; + playlistToExclude.lastExcludeReason_ = error.reason; } - this.tech_.trigger('blacklistplaylist'); - this.tech_.trigger({type: 'usage', name: 'vhs-rendition-blacklisted'}); + this.tech_.trigger('excludeplaylist'); + this.tech_.trigger({type: 'usage', name: 'vhs-rendition-excluded'}); - // TODO: should we select a new playlist if this blacklist wasn't for the currentPlaylist? - // Would be something like media().id !=== currentPlaylist.id and we would need something - // like `pendingMedia` in playlist loaders to check against that too. This will prevent us - // from loading a new playlist on any blacklist. - // Select a new playlist + // TODO: only load a new playlist if we're excluding the current playlist + // If this function was called with a playlist that's not the current active playlist + // (e.g., media().id !== playlistToExclude.id), + // then a new playlist should not be selected and loaded, as there's nothing wrong with the current playlist. const nextPlaylist = this.selectPlaylist(); if (!nextPlaylist) { @@ -1237,16 +1236,16 @@ export class MasterPlaylistController extends videojs.EventTarget { const logFn = error.internal ? this.logger_ : videojs.log.warn; const errorMessage = error.message ? (' ' + error.message) : ''; - logFn(`${(error.internal ? 'Internal problem' : 'Problem')} encountered with playlist ${currentPlaylist.id}.` + + logFn(`${(error.internal ? 'Internal problem' : 'Problem')} encountered with playlist ${playlistToExclude.id}.` + `${errorMessage} Switching to playlist ${nextPlaylist.id}.`); // if audio group changed reset audio loaders - if (nextPlaylist.attributes.AUDIO !== currentPlaylist.attributes.AUDIO) { + if (nextPlaylist.attributes.AUDIO !== playlistToExclude.attributes.AUDIO) { this.delegateLoaders_('audio', ['abort', 'pause']); } // if subtitle group changed reset subtitle loaders - if (nextPlaylist.attributes.SUBTITLES !== currentPlaylist.attributes.SUBTITLES) { + if (nextPlaylist.attributes.SUBTITLES !== playlistToExclude.attributes.SUBTITLES) { this.delegateLoaders_('subtitle', ['abort', 'pause']); } @@ -1694,10 +1693,10 @@ export class MasterPlaylistController extends videojs.EventTarget { // no codecs, no playback. if (!codecs.audio && !codecs.video) { - this.blacklistCurrentPlaylist({ + this.excludePlaylist({ playlist: this.media(), message: 'Could not determine codecs for playlist.', - blacklistDuration: Infinity + playlistExclusionDuration: Infinity }); return; } @@ -1733,7 +1732,7 @@ export class MasterPlaylistController extends videojs.EventTarget { this.logger_(`excluding audio group ${audioGroup} as ${unsupportedAudio} does not support codec(s): "${codecs.audio}"`); } - // if we have any unsupported codecs blacklist this playlist. + // if we have any unsupported codecs exclude this playlist. if (Object.keys(unsupportedCodecs).length) { const message = Object.keys(unsupportedCodecs).reduce((acc, supporter) => { @@ -1746,11 +1745,11 @@ export class MasterPlaylistController extends videojs.EventTarget { return acc; }, '') + '.'; - this.blacklistCurrentPlaylist({ + this.excludePlaylist({ playlist: this.media(), internal: true, message, - blacklistDuration: Infinity + playlistExclusionDuration: Infinity }); return; } @@ -1771,10 +1770,10 @@ export class MasterPlaylistController extends videojs.EventTarget { }); if (switchMessages.length) { - this.blacklistCurrentPlaylist({ + this.excludePlaylist({ playlist: this.media(), message: `Codec switching not supported: ${switchMessages.join(', ')}.`, - blacklistDuration: Infinity, + playlistExclusionDuration: Infinity, internal: true }); return; @@ -1861,7 +1860,7 @@ export class MasterPlaylistController extends videojs.EventTarget { } /** - * Blacklist playlists that are known to be codec or + * Exclude playlists that are known to be codec or * stream-incompatible with the SourceBuffer configuration. For * instance, Media Source Extensions would cause the video element to * stall waiting for video data if you switched from a variant with @@ -1892,7 +1891,7 @@ export class MasterPlaylistController extends videojs.EventTarget { } ids.push(variant.id); - const blacklistReasons = []; + const exclusionReasons = []; // get codecs from the playlist for this variant const variantCodecs = codecsForPlaylist(this.masterPlaylistLoader_.master, variant); @@ -1908,7 +1907,7 @@ export class MasterPlaylistController extends videojs.EventTarget { // old media source and creating a new one, but it will take some work. // The number of streams cannot change if (variantCodecCount !== codecCount_) { - blacklistReasons.push(`codec count "${variantCodecCount}" !== "${codecCount_}"`); + exclusionReasons.push(`codec count "${variantCodecCount}" !== "${codecCount_}"`); } // only exclude playlists by codec change, if codecs cannot switch @@ -1919,18 +1918,18 @@ export class MasterPlaylistController extends videojs.EventTarget { // the video codec cannot change if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) { - blacklistReasons.push(`video codec "${variantVideoDetails.type}" !== "${videoDetails.type}"`); + exclusionReasons.push(`video codec "${variantVideoDetails.type}" !== "${videoDetails.type}"`); } // the audio codec cannot change if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) { - blacklistReasons.push(`audio codec "${variantAudioDetails.type}" !== "${audioDetails.type}"`); + exclusionReasons.push(`audio codec "${variantAudioDetails.type}" !== "${audioDetails.type}"`); } } - if (blacklistReasons.length) { + if (exclusionReasons.length) { variant.excludeUntil = Infinity; - this.logger_(`blacklisting ${variant.id}: ${blacklistReasons.join(' && ')}`); + this.logger_(`excluding ${variant.id}: ${exclusionReasons.join(' && ')}`); } }); } diff --git a/src/media-groups.js b/src/media-groups.js index 7b0ccd17a..d3c415270 100644 --- a/src/media-groups.js +++ b/src/media-groups.js @@ -243,7 +243,7 @@ export const onError = { * @param {Object} settings * Object containing required information for media groups * @return {Function} - * Error handler. Logs warning (or error if the playlist is blacklisted) to + * Error handler. Logs warning (or error if the playlist is excluded) to * console and switches back to default audio track. * @function onError.AUDIO */ @@ -251,7 +251,7 @@ export const onError = { const { segmentLoaders: { [type]: segmentLoader}, mediaTypes: { [type]: mediaType }, - blacklistCurrentPlaylist + excludePlaylist } = settings; stopLoaders(segmentLoader, mediaType); @@ -263,9 +263,9 @@ export const onError = { const defaultTrack = mediaType.tracks[id]; if (activeTrack === defaultTrack) { - // Default track encountered an error. All we can do now is blacklist the current + // Default track encountered an error. All we can do now is exclude the current // rendition and hope another will switch audio groups - blacklistCurrentPlaylist({ + excludePlaylist({ message: 'Problem encountered loading the default audio track.' }); return; @@ -844,8 +844,8 @@ export const getActiveGroup = (type, {mediaTypes}) => () => { * The parsed master manifest * @param {Object} settings.mediaTypes * Object to store the loaders, tracks, and utility methods for each media type - * @param {Function} settings.blacklistCurrentPlaylist - * Blacklists the current rendition and forces a rendition switch. + * @param {Function} settings.excludePlaylist + * Excludes the current rendition and forces a rendition switch. * @function setupMediaGroups */ export const setupMediaGroups = (settings) => { diff --git a/src/media-segment-request.js b/src/media-segment-request.js index d6c91051e..effd10093 100644 --- a/src/media-segment-request.js +++ b/src/media-segment-request.js @@ -425,7 +425,7 @@ const handleSegmentBytes = ({ // TODO: // We should have a handler that fetches the number of bytes required // to check if something is fmp4. This will allow us to save bandwidth - // because we can only blacklist a playlist and abort requests + // because we can only exclude a playlist and abort requests // by codec after trackinfo triggers. if (isLikelyFmp4MediaSegment(bytesAsUint8Array)) { segment.isFmp4 = true; diff --git a/src/playback-watcher.js b/src/playback-watcher.js index c0aa63b62..e49c5695d 100644 --- a/src/playback-watcher.js +++ b/src/playback-watcher.js @@ -186,7 +186,7 @@ export default class PlaybackWatcher { /** * Checks on every segment `appendsdone` to see * if segment appends are making progress. If they are not - * and we are still downloading bytes. We blacklist the playlist. + * and we are still downloading bytes. We exclude the playlist. * * @param {string} type * The segment loader type to check. @@ -232,7 +232,7 @@ export default class PlaybackWatcher { // TODO: should we exclude audio tracks rather than main tracks // when type is audio? - mpc.blacklistCurrentPlaylist({ + mpc.excludePlaylist({ message: `Excessive ${type} segment downloading detected.` }, Infinity); } diff --git a/src/playlist-selectors.js b/src/playlist-selectors.js index 2d5309a3d..9bb4ac6d2 100644 --- a/src/playlist-selectors.js +++ b/src/playlist-selectors.js @@ -204,12 +204,12 @@ export let simpleSelector = function( sortedPlaylistReps = sortedPlaylistReps.filter((rep) => !Playlist.isIncompatible(rep.playlist)); // filter out any playlists that have been disabled manually through the representations - // api or blacklisted temporarily due to playback errors. + // api or excluded temporarily due to playback errors. let enabledPlaylistReps = sortedPlaylistReps.filter((rep) => Playlist.isEnabled(rep.playlist)); if (!enabledPlaylistReps.length) { - // if there are no enabled playlists, then they have all been blacklisted or disabled - // by the user through the representations api. In this case, ignore blacklisting and + // if there are no enabled playlists, then they have all been excluded or disabled + // by the user through the representations api. In this case, ignore exclusion and // fallback to what the user wants by using playlists the user has not disabled. enabledPlaylistReps = sortedPlaylistReps.filter((rep) => !Playlist.isDisabled(rep.playlist)); } @@ -473,12 +473,12 @@ export const minRebufferMaxBandwidthSelector = function(settings) { const compatiblePlaylists = master.playlists.filter(playlist => !Playlist.isIncompatible(playlist)); // filter out any playlists that have been disabled manually through the representations - // api or blacklisted temporarily due to playback errors. + // api or excluded temporarily due to playback errors. let enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled); if (!enabledPlaylists.length) { - // if there are no enabled playlists, then they have all been blacklisted or disabled - // by the user through the representations api. In this case, ignore blacklisting and + // if there are no enabled playlists, then they have all been excluded or disabled + // by the user through the representations api. In this case, ignore exclusion and // fallback to what the user wants by using playlists the user has not disabled. enabledPlaylists = compatiblePlaylists.filter(playlist => !Playlist.isDisabled(playlist)); } diff --git a/src/playlist.js b/src/playlist.js index 8aaed8f3b..bce050bc3 100644 --- a/src/playlist.js +++ b/src/playlist.js @@ -536,19 +536,19 @@ export const getMediaInfoForTime = function({ }; /** - * Check whether the playlist is blacklisted or not. + * Check whether the playlist is excluded or not. * * @param {Object} playlist the media playlist object - * @return {boolean} whether the playlist is blacklisted or not - * @function isBlacklisted + * @return {boolean} whether the playlist is excluded or not + * @function isExcluded */ -export const isBlacklisted = function(playlist) { +export const isExcluded = function(playlist) { return playlist.excludeUntil && playlist.excludeUntil > Date.now(); }; /** * Check whether the playlist is compatible with current playback configuration or has - * been blacklisted permanently for being incompatible. + * been excluded permanently for being incompatible. * * @param {Object} playlist the media playlist object * @return {boolean} whether the playlist is incompatible or not @@ -566,9 +566,9 @@ export const isIncompatible = function(playlist) { * @function isEnabled */ export const isEnabled = function(playlist) { - const blacklisted = isBlacklisted(playlist); + const excluded = isExcluded(playlist); - return (!playlist.disabled && !blacklisted); + return (!playlist.disabled && !excluded); }; /** @@ -766,7 +766,7 @@ export default { getMediaInfoForTime, isEnabled, isDisabled, - isBlacklisted, + isExcluded, isIncompatible, playlistEnd, isAes, diff --git a/src/segment-loader.js b/src/segment-loader.js index a609c6196..fc55fc871 100644 --- a/src/segment-loader.js +++ b/src/segment-loader.js @@ -2689,7 +2689,7 @@ export default class SegmentLoader extends videojs.EventTarget { } // if control-flow has arrived here, then the error is real - // emit an error event to blacklist the current playlist + // emit an error event to exclude the current playlist this.mediaRequestsErrored += 1; this.error(error); this.trigger('error'); @@ -2798,7 +2798,7 @@ export default class SegmentLoader extends videojs.EventTarget { if (!trackInfo) { this.error({ message: 'No starting media returned, likely due to an unsupported media format.', - blacklistDuration: Infinity + playlistExclusionDuration: Infinity }); this.trigger('error'); return; @@ -2879,7 +2879,7 @@ export default class SegmentLoader extends videojs.EventTarget { if (illegalMediaSwitchError) { this.error({ message: illegalMediaSwitchError, - blacklistDuration: Infinity + playlistExclusionDuration: Infinity }); this.trigger('error'); return true; diff --git a/src/videojs-http-streaming.js b/src/videojs-http-streaming.js index fe538050b..de90d6fc8 100644 --- a/src/videojs-http-streaming.js +++ b/src/videojs-http-streaming.js @@ -598,8 +598,8 @@ class VhsHandler extends Component { this.options_.customTagMappers = this.options_.customTagMappers || []; this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false; - if (typeof this.options_.blacklistDuration !== 'number') { - this.options_.blacklistDuration = 5 * 60; + if (typeof this.options_.playlistExclusionDuration !== 'number') { + this.options_.playlistExclusionDuration = 5 * 60; } if (typeof this.options_.bandwidth !== 'number') { @@ -1016,10 +1016,10 @@ class VhsHandler extends Component { this.player_.tech_.on('keystatuschange', (e) => { if (e.status === 'output-restricted') { - this.masterPlaylistController_.blacklistCurrentPlaylist({ + this.masterPlaylistController_.excludePlaylist({ playlist: this.masterPlaylistController_.media(), message: `DRM keystatus changed to ${e.status}. Playlist will fail to play. Check for HDCP content.`, - blacklistDuration: Infinity + playlistExclusionDuration: Infinity }); } }); diff --git a/test/dash-playlist-loader.test.js b/test/dash-playlist-loader.test.js index c7b82be3f..ee444bce7 100644 --- a/test/dash-playlist-loader.test.js +++ b/test/dash-playlist-loader.test.js @@ -693,7 +693,7 @@ QUnit.test('addSidxSegments_: adds/triggers error on invalid container', functio assert.ok(triggeredError, 'triggered an error'); assert.deepEqual(loader.error, { - blacklistDuration: Infinity, + playlistExclusionDuration: Infinity, code: 2, internal: true, message: 'Unsupported unknown container type for sidx segment at URL: sidx.mp4', diff --git a/test/master-playlist-controller.test.js b/test/master-playlist-controller.test.js index f5cb49033..987e4bf07 100644 --- a/test/master-playlist-controller.test.js +++ b/test/master-playlist-controller.test.js @@ -1429,7 +1429,7 @@ QUnit.test('detects if the player is stuck at the playlist end', function(assert Vhs.Playlist.playlistEnd = playlistCopy; }); -QUnit.test('blacklists switching from video+audio playlists to audio only', function(assert) { +QUnit.test('excludes switching from video+audio playlists to audio only', function(assert) { openMediaSource(this.player, this.clock); this.player.tech_.vhs.bandwidth = 1e10; @@ -1452,7 +1452,7 @@ QUnit.test('blacklists switching from video+audio playlists to audio only', func mpc.logger_ = (...logs) => { debugLogs = debugLogs.concat(logs); }; - // segment must be appended before the blacklist logic runs + // segment must be appended before the exclusion logic runs return requestAndAppendSegment({ request: this.requests.shift(), segmentLoader: mpc.mainSegmentLoader_, @@ -1468,14 +1468,14 @@ QUnit.test('blacklists switching from video+audio playlists to audio only', func assert.equal(audioPlaylist.excludeUntil, Infinity, 'excluded incompatible playlist'); assert.notEqual( - debugLogs.indexOf('blacklisting 0-media.m3u8: codec count "1" !== "2"'), + debugLogs.indexOf('excluding 0-media.m3u8: codec count "1" !== "2"'), -1, 'debug logs about codec count' ); }); }); -QUnit.test('blacklists switching from audio-only playlists to video+audio', function(assert) { +QUnit.test('excludes switching from audio-only playlists to video+audio', function(assert) { openMediaSource(this.player, this.clock); this.player.tech_.vhs.bandwidth = 1; @@ -1499,7 +1499,7 @@ QUnit.test('blacklists switching from audio-only playlists to video+audio', func mpc.logger_ = (...logs) => { debugLogs = debugLogs.concat(logs); }; - // segment must be appended before the blacklist logic runs + // segment must be appended before the exclusion logic runs return requestAndAppendSegment({ request: this.requests.shift(), segmentLoader: mpc.mainSegmentLoader_, @@ -1522,14 +1522,14 @@ QUnit.test('blacklists switching from audio-only playlists to video+audio', func ); assert.notEqual( - debugLogs.indexOf('blacklisting 1-media1.m3u8: codec count "2" !== "1"'), + debugLogs.indexOf('excluding 1-media1.m3u8: codec count "2" !== "1"'), -1, 'debug logs about codec count' ); }); }); -QUnit.test('blacklists switching from video-only playlists to video+audio', function(assert) { +QUnit.test('excludes switching from video-only playlists to video+audio', function(assert) { openMediaSource(this.player, this.clock); this.player.tech_.vhs.bandwidth = 1; @@ -1555,7 +1555,7 @@ QUnit.test('blacklists switching from video-only playlists to video+audio', func debugLogs = debugLogs.concat(logs); }; - // segment must be appended before the blacklist logic runs + // segment must be appended before the exclusion logic runs return requestAndAppendSegment({ request: this.requests.shift(), segmentLoader: mpc.mainSegmentLoader_, @@ -1577,14 +1577,14 @@ QUnit.test('blacklists switching from video-only playlists to video+audio', func 'excluded incompatible playlist' ); assert.notEqual( - debugLogs.indexOf('blacklisting 1-media1.m3u8: codec count "2" !== "1"'), + debugLogs.indexOf('excluding 1-media1.m3u8: codec count "2" !== "1"'), -1, 'debug logs about codec count' ); }); }); -QUnit.test('blacklists switching between playlists with different codecs', function(assert) { +QUnit.test('excludes switching between playlists with different codecs', function(assert) { openMediaSource(this.player, this.clock); this.player.tech_.vhs.bandwidth = 1; @@ -1631,7 +1631,7 @@ QUnit.test('blacklists switching between playlists with different codecs', funct debugLogs = debugLogs.concat(logs); }; - // segment must be appended before the blacklist logic runs + // segment must be appended before the exclusion logic runs return requestAndAppendSegment({ request: this.requests.shift(), segmentLoader: mpc.mainSegmentLoader_, @@ -1639,20 +1639,20 @@ QUnit.test('blacklists switching between playlists with different codecs', funct }).then(() => { const playlists = mpc.masterPlaylistLoader_.master.playlists; - assert.equal(typeof playlists[0].excludeUntil, 'undefined', 'did not blacklist first playlist'); - assert.equal(playlists[1].excludeUntil, Infinity, 'blacklistlisted second playlist'); - assert.equal(playlists[2].excludeUntil, Infinity, 'blacklistlisted third playlist'); - assert.equal(playlists[3].excludeUntil, Infinity, 'blacklistlisted forth playlist'); - assert.equal(typeof playlists[4].excludeUntil, 'undefined', 'did not blacklist fifth playlist'); - assert.equal(playlists[5].excludeUntil, Infinity, 'blacklistlisted sixth playlist'); - assert.equal(playlists[6].excludeUntil, Infinity, 'blacklistlisted seventh playlist'); + assert.equal(typeof playlists[0].excludeUntil, 'undefined', 'did not exclude first playlist'); + assert.equal(playlists[1].excludeUntil, Infinity, 'excluded second playlist'); + assert.equal(playlists[2].excludeUntil, Infinity, 'excluded third playlist'); + assert.equal(playlists[3].excludeUntil, Infinity, 'excluded forth playlist'); + assert.equal(typeof playlists[4].excludeUntil, 'undefined', 'did not exclude fifth playlist'); + assert.equal(playlists[5].excludeUntil, Infinity, 'excluded sixth playlist'); + assert.equal(playlists[6].excludeUntil, Infinity, 'excluded seventh playlist'); [ - 'blacklisting 1-media1.m3u8: video codec "hvc1" !== "avc1"', - 'blacklisting 2-media2.m3u8: audio codec "ac-3" !== "mp4a"', - 'blacklisting 3-media3.m3u8: video codec "hvc1" !== "avc1" && audio codec "ac-3" !== "mp4a"', - 'blacklisting 5-media5.m3u8: codec count "1" !== "2" && audio codec "ac-3" !== "mp4a"', - 'blacklisting 6-media6.m3u8: codec count "1" !== "2" && video codec "hvc1" !== "avc1"' + 'excluding 1-media1.m3u8: video codec "hvc1" !== "avc1"', + 'excluding 2-media2.m3u8: audio codec "ac-3" !== "mp4a"', + 'excluding 3-media3.m3u8: video codec "hvc1" !== "avc1" && audio codec "ac-3" !== "mp4a"', + 'excluding 5-media5.m3u8: codec count "1" !== "2" && audio codec "ac-3" !== "mp4a"', + 'excluding 6-media6.m3u8: codec count "1" !== "2" && video codec "hvc1" !== "avc1"' ].forEach(function(message) { assert.notEqual( debugLogs.indexOf(message), @@ -1663,7 +1663,7 @@ QUnit.test('blacklists switching between playlists with different codecs', funct }); }); -QUnit.test('does not blacklist switching between playlists with different audio profiles', function(assert) { +QUnit.test('does not exclude switching between playlists with different audio profiles', function(assert) { openMediaSource(this.player, this.clock); this.player.tech_.vhs.bandwidth = 1; @@ -1689,7 +1689,7 @@ QUnit.test('does not blacklist switching between playlists with different audio const mpc = this.masterPlaylistController; - // segment must be appended before the blacklist logic runs + // segment must be appended before the exclusion logic runs return requestAndAppendSegment({ request: this.requests.shift(), segmentLoader: mpc.mainSegmentLoader_, @@ -2056,7 +2056,7 @@ QUnit.test( } ); -QUnit.test('blacklists playlist on earlyabort', function(assert) { +QUnit.test('excludes playlist on earlyabort', function(assert) { this.masterPlaylistController.mediaSource.trigger('sourceopen'); // master this.standardXHRResponse(this.requests.shift()); @@ -2079,12 +2079,12 @@ QUnit.test('blacklists playlist on earlyabort', function(assert) { videojs.log.warn = (text) => warnings.push(text); - assert.notOk(currentMedia.excludeUntil > 0, 'playlist not blacklisted'); + assert.notOk(currentMedia.excludeUntil > 0, 'playlist not excluded'); assert.equal(mediaChanges.length, 0, 'no media change'); this.masterPlaylistController.mainSegmentLoader_.trigger('earlyabort'); - assert.ok(currentMedia.excludeUntil > 0, 'playlist blacklisted'); + assert.ok(currentMedia.excludeUntil > 0, 'playlist excluded'); assert.equal(mediaChanges.length, 1, 'one media change'); assert.equal(warnings.length, 1, 'one warning logged'); assert.equal( @@ -2219,7 +2219,7 @@ QUnit.test('does not get stuck in a loop due to inconsistent network/caching', f const media1ResolvedPlaylist = segmentLoader.playlist_; - assert.notOk(media1ResolvedPlaylist.excludeUntil, 'media1 not blacklisted'); + assert.notOk(media1ResolvedPlaylist.excludeUntil, 'media1 not excluded'); assert.equal( segmentRequest.uri.substring(segmentRequest.uri.length - 4), '0.ts', @@ -2244,7 +2244,7 @@ QUnit.test('does not get stuck in a loop due to inconsistent network/caching', f ); assert.equal(mediaChanges.length, 2, 'changed media'); assert.equal(mediaChanges[1].uri, 'media.m3u8', 'changed to media'); - assert.ok(media1ResolvedPlaylist.excludeUntil, 'blacklisted media1'); + assert.ok(media1ResolvedPlaylist.excludeUntil, 'excluded media1'); assert.equal( segmentRequest.uri.substring(segmentRequest.uri.length - 4), '0.ts', @@ -4752,8 +4752,8 @@ QUnit.module('MasterPlaylistController codecs', { sharedHooks.beforeEach.call(this, assert); this.mpc = this.masterPlaylistController; - this.blacklists = []; - this.mpc.blacklistCurrentPlaylist = (blacklist) => this.blacklists.push(blacklist); + this.exclusionList = []; + this.mpc.excludePlaylist = (playlist) => this.exclusionList.push(playlist); this.contentSetup = (options) => { const { @@ -4811,7 +4811,7 @@ QUnit.test('can get demuxed codecs from the video/main', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {audio: 'mp4a.40.5', video: 'avc1.4c400d'}, 'codecs returned'); }); @@ -4825,7 +4825,7 @@ QUnit.test('can get demuxed codecs from the video/main playlist and audio playli const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {audio: 'mp4a.40.5', video: 'avc1.4c400d'}, 'codecs returned'); }); @@ -4839,7 +4839,7 @@ QUnit.test('can get demuxed codecs from the main and audio loaders', function(as const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {audio: 'mp4a.40.5', video: 'avc1.4c400d'}, 'codecs returned'); }); @@ -4853,7 +4853,7 @@ QUnit.test('can get demuxed codecs from the main loader', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {audio: 'mp4a.40.5', video: 'avc1.4c400d'}, 'codecs returned'); }); @@ -4865,7 +4865,7 @@ QUnit.test('can get muxed codecs from video/main playlist', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {video: 'avc1.4c400d,mp4a.40.5'}, 'codecs returned'); }); @@ -4883,7 +4883,7 @@ QUnit.test('can get muxed codecs from video/main loader', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {video: 'avc1.4c400d,mp4a.40.5'}, 'codecs returned'); }); @@ -4895,7 +4895,7 @@ QUnit.test('can get audio only codecs from main playlist ', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {audio: 'mp4a.40.5'}, 'codecs returned'); }); @@ -4907,7 +4907,7 @@ QUnit.test('can get audio only codecs from main loader ', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {audio: 'mp4a.40.5'}, 'codecs returned'); }); @@ -4919,7 +4919,7 @@ QUnit.test('can get video only codecs from main playlist', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {video: 'avc1.4c400d'}, 'codecs returned'); }); @@ -4931,7 +4931,7 @@ QUnit.test('can get video only codecs from main loader', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {video: 'avc1.4c400d'}, 'codecs returned'); }); @@ -4945,7 +4945,7 @@ QUnit.test('can get codecs from startingMedia', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {video: 'avc1.4c400d', audio: 'mp4a.40.5'}, 'codecs returned'); }); @@ -4959,7 +4959,7 @@ QUnit.test('playlist codecs take priority over others', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {video: 'avc1.4b400d', audio: 'mp4a.40.20'}, 'codecs returned'); }); @@ -4973,7 +4973,7 @@ QUnit.test('uses default codecs if no codecs are found', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [], 'did not blacklist anything'); + assert.deepEqual(this.exclusionList, [], 'did not exclude anything'); assert.deepEqual(codecs, {video: 'avc1.4d400d', audio: 'mp4a.40.2'}, 'codecs returned'); }); @@ -4986,11 +4986,11 @@ QUnit.test('excludes playlist without detected audio/video', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, message: 'Could not determine codecs for playlist.', playlist: {attributes: {}} - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'no codecs returned'); }); @@ -5007,12 +5007,12 @@ QUnit.test('excludes unsupported muxer codecs for ts', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {}}, internal: true, message: 'muxer does not support codec(s): "hvc1.2.4.L123.B0,ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); }); @@ -5033,12 +5033,12 @@ QUnit.test('excludes unsupported browser codecs for muxed fmp4', function(assert const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {}}, internal: true, message: 'browser does not support codec(s): "hvc1.2.4.L123.B0,ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); }); @@ -5056,12 +5056,12 @@ QUnit.test('excludes unsupported muxer codecs for muxed ts', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {}}, internal: true, message: 'muxer does not support codec(s): "hvc1.2.4.L123.B0,ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); }); @@ -5081,12 +5081,12 @@ QUnit.test('excludes unsupported browser codecs for fmp4', function(assert) { const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {}}, internal: true, message: 'browser does not support codec(s): "hvc1.2.4.L123.B0,ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); }); @@ -5111,12 +5111,12 @@ QUnit.test('excludes unsupported codecs video ts, audio fmp4', function(assert) const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {AUDIO: 'low-quality'}}, internal: true, message: 'muxer does not support codec(s): "hvc1.2.4.L123.B0", browser does not support codec(s): "ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); }); @@ -5141,12 +5141,12 @@ QUnit.test('excludes unsupported codecs video fmp4, audio ts', function(assert) const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {AUDIO: 'low-quality'}}, internal: true, message: 'browser does not support codec(s): "hvc1.2.4.L123.B0", muxer does not support codec(s): "ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); }); @@ -5171,12 +5171,12 @@ QUnit.test('excludes all of audio group on unsupported audio', function(assert) const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {AUDIO: 'low-quality'}, id: 'bar'}, internal: true, message: 'muxer does not support codec(s): "hvc1.2.4.L123.B0,ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); assert.equal(this.master.playlists[2].id, 'foo', 'playlist 3 is the one we added'); assert.equal(this.master.playlists[2].excludeUntil, Infinity, 'playlist 3 with same audio group excluded'); @@ -5216,12 +5216,12 @@ QUnit.test('excludes on codec switch if codec switching not supported', function const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, [{ - blacklistDuration: Infinity, + assert.deepEqual(this.exclusionList, [{ + playlistExclusionDuration: Infinity, playlist: {attributes: {AUDIO: 'low-quality'}}, internal: true, message: 'Codec switching not supported: "avc1.4c400d" -> "hvc1.2.4.L123.B0", "mp4a.40.2" -> "ac-3".' - }], 'blacklisted playlist'); + }], 'excluded playlist'); assert.deepEqual(codecs, void 0, 'codecs returned'); }); @@ -5257,7 +5257,7 @@ QUnit.test('does not exclude on codec switch between the same base codec', funct const codecs = this.mpc.getCodecsOrExclude_(); - assert.deepEqual(this.blacklists, []); + assert.deepEqual(this.exclusionList, []); assert.deepEqual(codecs, {video: 'avc1.4d400e', audio: 'mp4a.40.5'}, 'codecs returned'); }); @@ -5428,10 +5428,10 @@ QUnit.module('MasterPlaylistController - exclusion behavior', { assert.equal(this.mpc.media(), this.mpc.master().playlists[0], 'selected first playlist'); - this.mpc.blacklistCurrentPlaylist({ + this.mpc.excludePlaylist({ internal: true, playlist: this.mpc.master().playlists[0], - blacklistDuration: Infinity + playlistExclusionDuration: Infinity }); assert.equal(this.mpc.master().playlists[0].excludeUntil, Infinity, 'exclusion happened'); @@ -5982,7 +5982,7 @@ QUnit.test('true if llhls playlist and we have buffered', function(assert) { assert.ok(mpc.shouldSwitchToMedia_(nextPlaylist), 'should switch if buffered'); }); -QUnit.module('MasterPlaylistController blacklistCurrentPlaylist', sharedHooks); +QUnit.module('MasterPlaylistController excludePlaylist', sharedHooks); QUnit.test("don't exclude only playlist unless it was excluded forever", function(assert) { // expect 9 because we have a failing assertion that shouldn't run unless something is broken @@ -6012,7 +6012,7 @@ QUnit.test("don't exclude only playlist unless it was excluded forever", functio mpl.load = (delay) => (shouldDelay = delay); - mpc.blacklistCurrentPlaylist(); + mpc.excludePlaylist(); assert.notOk('excludeUntil' in playlist, 'playlist was not excluded since excludeDuration was finite'); assert.ok(shouldDelay, 'we delay retry since it is the final rendition'); @@ -6048,7 +6048,7 @@ QUnit.test("don't exclude only playlist unless it was excluded forever", functio }); // exclude forever - mpc.blacklistCurrentPlaylist({}, Infinity); + mpc.excludePlaylist({}, Infinity); assert.ok('excludeUntil' in playlist, 'playlist was excluded'); assert.notOk(shouldDelay, 'value was not changed'); @@ -6084,7 +6084,7 @@ QUnit.test('switch playlists if current playlist gets excluded and re-include if mpl.load = (delay) => (shouldDelay = delay); - mpc.blacklistCurrentPlaylist(); + mpc.excludePlaylist(); assert.ok('excludeUntil' in playlist, 'playlist was excluded since there is another playlist'); assert.notOk(shouldDelay, 'we do not delay retry since it is not the final rendition'); @@ -6096,7 +6096,7 @@ QUnit.test('switch playlists if current playlist gets excluded and re-include if this.standardXHRResponse(this.requests.shift()); playlist2 = mpl.master.playlists[1]; - mpc.blacklistCurrentPlaylist(); + mpc.excludePlaylist(); assert.ok('excludeUntil' in playlist2, 'playlist2 was excluded'); assert.notOk('excludeUntil' in playlist, 'playlist was re-included'); @@ -6133,13 +6133,13 @@ QUnit.test('Playlist is excluded indefinitely if number of playlistErrors_ excee assert.equal(playlist.playlistErrors_, 0, 'playlistErrors_ starts at zero'); - mpc.blacklistCurrentPlaylist(); + mpc.excludePlaylist(); assert.ok('excludeUntil' in playlist, 'playlist was excluded'); assert.equal(playlist.playlistErrors_, 1, 'we incremented playlistErrors_'); assert.notEqual(playlist.excludeUntil, Infinity, 'The playlist was not excluded indefinitely'); - mpc.blacklistCurrentPlaylist(); + mpc.excludePlaylist(); assert.equal(playlist.playlistErrors_, 2, 'we incremented playlistErrors_'); assert.equal(playlist.excludeUntil, Infinity, 'The playlist was excluded indefinitely'); @@ -6179,7 +6179,7 @@ QUnit.test('should delay loading of new playlist if lastRequest was less than ha }; playlist2.lastRequest = Date.now() - 1000; - mpc.blacklistCurrentPlaylist(); + mpc.excludePlaylist(); assert.ok('excludeUntil' in playlist, 'playlist was excluded since there is another playlist'); assert.ok(shouldDelay, 'we delay retry since second rendition was loaded less than half target duration ago'); diff --git a/test/media-groups.test.js b/test/media-groups.test.js index bacbfd1a2..bc2da6b5f 100644 --- a/test/media-groups.test.js +++ b/test/media-groups.test.js @@ -926,7 +926,7 @@ QUnit.module('MediaGroups', function() { QUnit.test( 'switches to default audio track when an error is encountered', function(assert) { - let blacklistCurrentPlaylistCalls = 0; + let excludePlaylistCalls = 0; let onTrackChangedCalls = 0; const type = 'AUDIO'; @@ -939,7 +939,7 @@ QUnit.module('MediaGroups', function() { const settings = { segmentLoaders: { AUDIO: segmentLoader }, mediaTypes: MediaGroups.createMediaTypes(), - blacklistCurrentPlaylist: () => blacklistCurrentPlaylistCalls++, + excludePlaylist: () => excludePlaylistCalls++, masterPlaylistLoader }; const mediaType = settings.mediaTypes[type]; @@ -959,7 +959,7 @@ QUnit.module('MediaGroups', function() { onError(); - assert.equal(blacklistCurrentPlaylistCalls, 0, 'did not blacklist current playlist'); + assert.equal(excludePlaylistCalls, 0, 'did not exclude current playlist'); assert.equal(onTrackChangedCalls, 1, 'called onTrackChanged after changing to default'); assert.equal(tracks.en.enabled, true, 'enabled default track'); assert.equal(tracks.fr.enabled, false, 'disabled active track'); @@ -969,8 +969,8 @@ QUnit.module('MediaGroups', function() { onError(); - assert.equal(blacklistCurrentPlaylistCalls, 1, 'blacklist current playlist'); - assert.equal(onTrackChangedCalls, 1, 'did not call onTrackChanged after blacklist'); + assert.equal(excludePlaylistCalls, 1, 'excluded current playlist'); + assert.equal(onTrackChangedCalls, 1, 'did not call onTrackChanged after exclusion'); assert.equal(tracks.en.enabled, true, 'default track still enabled'); assert.equal(tracks.fr.enabled, false, 'disabled track still disabled'); assert.equal(tracks.es.enabled, false, 'disabled track still disabled'); @@ -1091,7 +1091,7 @@ QUnit.module('MediaGroups', function() { requestOptions: { withCredentials: false, timeout: 10 }, master: this.master, mediaTypes: this.mediaTypes, - blacklistCurrentPlaylist() {}, + excludePlaylist() {}, sourceType: 'hls' }; } @@ -1609,7 +1609,7 @@ QUnit.module('MediaGroups', function() { requestOptions: { withCredentials: false, timeout: 10 }, master: this.master, mediaTypes: this.mediaTypes, - blacklistCurrentPlaylist() {}, + excludePlaylist() {}, sourceType: 'hls' }; } diff --git a/test/playback-watcher.test.js b/test/playback-watcher.test.js index c69f1da46..7d165cf82 100644 --- a/test/playback-watcher.test.js +++ b/test/playback-watcher.test.js @@ -1344,7 +1344,7 @@ loaderTypes.forEach(function(type) { expectedUsage[`vhs-${type}-download-exclusion`] = 1; - expectedUsage['vhs-rendition-blacklisted'] = 1; + expectedUsage['vhs-rendition-excluded'] = 1; // expectedUsage['vhs-rendition-change-exclude'] = 1; assert.deepEqual(this.usageEvents, expectedUsage, 'usage as expected'); @@ -1382,7 +1382,7 @@ loaderTypes.forEach(function(type) { const expectedUsage = {}; expectedUsage[`vhs-${type}-download-exclusion`] = 1; - expectedUsage['vhs-rendition-blacklisted'] = 1; + expectedUsage['vhs-rendition-excluded'] = 1; if (!last) { expectedUsage['vhs-rendition-change-exclude'] = 1; } diff --git a/test/playlist.test.js b/test/playlist.test.js index b38261734..086a74be0 100644 --- a/test/playlist.test.js +++ b/test/playlist.test.js @@ -872,9 +872,9 @@ QUnit.module('Playlist', function() { }); QUnit.test('determines if a playlist is incompatible', function(assert) { - // incompatible means that the playlist was blacklisted due to incompatible + // incompatible means that the playlist was excluded due to incompatible // configuration e.g. audio only stream when trying to playback audio and video. - // incompaatibility is denoted by a blacklist of Infinity. + // incompatibility is denoted by an excludeUntil of Infinity. assert.notOk( Playlist.isIncompatible({}), 'playlist not incompatible if no excludeUntil' @@ -882,12 +882,12 @@ QUnit.module('Playlist', function() { assert.notOk( Playlist.isIncompatible({ excludeUntil: 1 }), - 'playlist not incompatible if expired blacklist' + 'playlist not incompatible if excludeUntil has expired' ); assert.notOk( Playlist.isIncompatible({ excludeUntil: Date.now() + 9999 }), - 'playlist not incompatible if temporarily blacklisted' + 'playlist not incompatible if temporarily excluded' ); assert.ok( @@ -896,25 +896,25 @@ QUnit.module('Playlist', function() { ); }); - QUnit.test('determines if a playlist is blacklisted', function(assert) { + QUnit.test('determines if a playlist is excluded', function(assert) { assert.notOk( - Playlist.isBlacklisted({}), - 'playlist not blacklisted if no excludeUntil' + Playlist.isExcluded({}), + 'playlist not excluded if no excludeUntil' ); assert.notOk( - Playlist.isBlacklisted({ excludeUntil: Date.now() - 1 }), - 'playlist not blacklisted if expired excludeUntil' + Playlist.isExcluded({ excludeUntil: Date.now() - 1 }), + 'playlist not excluded if expired excludeUntil' ); assert.ok( - Playlist.isBlacklisted({ excludeUntil: Date.now() + 9999 }), - 'playlist is blacklisted' + Playlist.isExcluded({ excludeUntil: Date.now() + 9999 }), + 'playlist is excluded' ); assert.ok( - Playlist.isBlacklisted({ excludeUntil: Infinity }), - 'playlist is blacklisted if excludeUntil is Infinity' + Playlist.isExcluded({ excludeUntil: Infinity }), + 'playlist is excluded if excludeUntil is Infinity' ); }); @@ -924,20 +924,20 @@ QUnit.module('Playlist', function() { assert.ok(Playlist.isDisabled({ disabled: true }), 'playlist is disabled'); }); - QUnit.test('playlists with no or expired blacklist are enabled', function(assert) { - // enabled means not blacklisted and not disabled - assert.ok(Playlist.isEnabled({}), 'playlist with no blacklist is enabled'); + QUnit.test('playlists with no or expired excludeUntil are enabled', function(assert) { + // enabled means not excluded and not disabled + assert.ok(Playlist.isEnabled({}), 'playlist with no excludeUntil is enabled'); assert.ok( Playlist.isEnabled({ excludeUntil: Date.now() - 1 }), - 'playlist with expired blacklist is enabled' + 'playlist with expired excludeUntil is enabled' ); }); - QUnit.test('blacklisted playlists are not enabled', function(assert) { - // enabled means not blacklisted and not disabled + QUnit.test('excluded playlists are not enabled', function(assert) { + // enabled means not excluded and not disabled assert.notOk( Playlist.isEnabled({ excludeUntil: Date.now() + 9999 }), - 'playlist with temporary blacklist is not enabled' + 'playlist with temporary excludeUntil is not enabled' ); assert.notOk( Playlist.isEnabled({ excludeUntil: Infinity }), @@ -946,24 +946,24 @@ QUnit.module('Playlist', function() { }); QUnit.test( - 'manually disabled playlists are not enabled regardless of blacklist state', + 'manually disabled playlists are not enabled regardless of exclusion state', function(assert) { - // enabled means not blacklisted and not disabled + // enabled means not excluded and not disabled assert.notOk( Playlist.isEnabled({ disabled: true }), - 'disabled playlist with no blacklist is not enabled' + 'disabled playlist with no excludeUntil is not enabled' ); assert.notOk( Playlist.isEnabled({ disabled: true, excludeUntil: Date.now() - 1 }), - 'disabled playlist with expired blacklist is not enabled' + 'disabled playlist with expired excludeUntil is not enabled' ); assert.notOk( Playlist.isEnabled({ disabled: true, excludeUntil: Date.now() + 9999 }), - 'disabled playlist with temporary blacklist is not enabled' + 'disabled playlist with temporary excludeUntil is not enabled' ); assert.notOk( Playlist.isEnabled({ disabled: true, excludeUntil: Infinity }), - 'disabled playlist with permanent blacklist is not enabled' + 'disabled playlist with permanent excludeUntil is not enabled' ); } ); diff --git a/test/videojs-http-streaming.test.js b/test/videojs-http-streaming.test.js index cc9f9dcef..adbb67e41 100644 --- a/test/videojs-http-streaming.test.js +++ b/test/videojs-http-streaming.test.js @@ -1543,7 +1543,7 @@ QUnit.test('filters playlists that are currently excluded', function(assert) { assert.equal(this.player.tech_.vhs.stats.bandwidth, 1e10, 'bandwidth set above'); }); -QUnit.test('does not blacklist compatible H.264 codec strings', function(assert) { +QUnit.test('does not exclude compatible H.264 codec strings', function(assert) { this.player.src({ src: 'manifest/master.m3u8', type: 'application/vnd.apple.mpegurl' @@ -1576,19 +1576,19 @@ QUnit.test('does not blacklist compatible H.264 codec strings', function(assert) assert.strictEqual( typeof master.playlists[0].excludeUntil, 'undefined', - 'did not blacklist' + 'did not exclude' ); assert.strictEqual( typeof master.playlists[1].excludeUntil, 'undefined', - 'did not blacklist' + 'did not exclude' ); // verify stats assert.equal(this.player.tech_.vhs.stats.bandwidth, 1, 'bandwidth set above'); }); -QUnit.test('does not blacklist compatible AAC codec strings', function(assert) { +QUnit.test('does not exclude compatible AAC codec strings', function(assert) { this.player.src({ src: 'manifest/master.m3u8', type: 'application/vnd.apple.mpegurl' @@ -1621,16 +1621,16 @@ QUnit.test('does not blacklist compatible AAC codec strings', function(assert) { assert.strictEqual( typeof master.playlists[0].excludeUntil, 'undefined', - 'did not blacklist mp4a.40.2' + 'did not exclude mp4a.40.2' ); assert.strictEqual( master.playlists[1].excludeUntil, Infinity, - 'blacklisted invalid audio codec' + 'excluded invalid audio codec' ); }); -QUnit.test('blacklists incompatible playlists by codec, without codec switching', function(assert) { +QUnit.test('excludes incompatible playlists by codec, without codec switching', function(assert) { this.player.src({ src: 'manifest/master.m3u8', type: 'application/vnd.apple.mpegurl' @@ -1681,16 +1681,16 @@ QUnit.test('blacklists incompatible playlists by codec, without codec switching' const playlists = master.playlists; assert.strictEqual(playlists.length, 7, 'six playlists total'); - assert.strictEqual(typeof playlists[0].excludeUntil, 'undefined', 'did not blacklist first playlist'); - assert.strictEqual(typeof playlists[1].excludeUntil, 'undefined', 'did not blacklist second playlist'); - assert.strictEqual(playlists[2].excludeUntil, Infinity, 'blacklisted incompatible audio playlist'); - assert.strictEqual(playlists[3].excludeUntil, Infinity, 'blacklisted incompatible video playlist'); - assert.strictEqual(playlists[4].excludeUntil, Infinity, 'blacklisted audio only playlist'); - assert.strictEqual(playlists[5].excludeUntil, Infinity, 'blacklisted video only playlist'); - assert.strictEqual(typeof playlists[6].excludeUntil, 'undefined', 'did not blacklist seventh playlist'); + assert.strictEqual(typeof playlists[0].excludeUntil, 'undefined', 'did not exclude first playlist'); + assert.strictEqual(typeof playlists[1].excludeUntil, 'undefined', 'did not exclude second playlist'); + assert.strictEqual(playlists[2].excludeUntil, Infinity, 'excluded incompatible audio playlist'); + assert.strictEqual(playlists[3].excludeUntil, Infinity, 'excluded incompatible video playlist'); + assert.strictEqual(playlists[4].excludeUntil, Infinity, 'excluded audio only playlist'); + assert.strictEqual(playlists[5].excludeUntil, Infinity, 'excluded video only playlist'); + assert.strictEqual(typeof playlists[6].excludeUntil, 'undefined', 'did not exclude seventh playlist'); }); -QUnit.test('does not blacklist incompatible codecs with codec switching', function(assert) { +QUnit.test('does not exclude incompatible codecs with codec switching', function(assert) { const oldIsTypeSupported = window.MediaSource.isTypeSupported; window.MediaSource.isTypeSupported = (t) => (/avc1|mp4a/).test(t); @@ -1744,17 +1744,17 @@ QUnit.test('does not blacklist incompatible codecs with codec switching', functi const playlists = master.playlists; assert.strictEqual(playlists.length, 7, 'six playlists total'); - assert.strictEqual(typeof playlists[0].excludeUntil, 'undefined', 'did not blacklist first playlist'); - assert.strictEqual(typeof playlists[1].excludeUntil, 'undefined', 'did not blacklist second playlist'); - assert.strictEqual(playlists[2].excludeUntil, Infinity, 'blacklisted incompatible audio playlist'); - assert.strictEqual(playlists[3].excludeUntil, Infinity, 'blacklisted incompatible video playlist'); - assert.strictEqual(playlists[4].excludeUntil, Infinity, 'blacklisted audio only playlist'); - assert.strictEqual(playlists[5].excludeUntil, Infinity, 'blacklisted video only playlist'); - assert.strictEqual(typeof playlists[6].excludeUntil, 'undefined', 'did not blacklist seventh playlist'); + assert.strictEqual(typeof playlists[0].excludeUntil, 'undefined', 'did not exclude first playlist'); + assert.strictEqual(typeof playlists[1].excludeUntil, 'undefined', 'did not exclude second playlist'); + assert.strictEqual(playlists[2].excludeUntil, Infinity, 'exclude incompatible audio playlist'); + assert.strictEqual(playlists[3].excludeUntil, Infinity, 'exclude incompatible video playlist'); + assert.strictEqual(playlists[4].excludeUntil, Infinity, 'exclude audio only playlist'); + assert.strictEqual(playlists[5].excludeUntil, Infinity, 'exclude video only playlist'); + assert.strictEqual(typeof playlists[6].excludeUntil, 'undefined', 'did not exclude seventh playlist'); window.MediaSource.isTypeSupported = oldIsTypeSupported; }); -QUnit.test('blacklists fmp4 playlists by browser support', function(assert) { +QUnit.test('excludes fmp4 playlists by browser support', function(assert) { const oldIsTypeSupported = window.MediaSource.isTypeSupported; window.MediaSource.isTypeSupported = (t) => (/avc1|mp4a/).test(t); @@ -1818,9 +1818,9 @@ QUnit.test('blacklists fmp4 playlists by browser support', function(assert) { loader.trigger('trackinfo'); assert.strictEqual(playlists.length, 3, 'three playlists total'); - assert.strictEqual(playlists[0].excludeUntil, Infinity, 'blacklisted first playlist'); - assert.strictEqual(playlists[1].excludeUntil, Infinity, 'blacklisted second playlist'); - assert.strictEqual(typeof playlists[2].excludeUntil, 'undefined', 'did not blacklist second playlist'); + assert.strictEqual(playlists[0].excludeUntil, Infinity, 'excluded first playlist'); + assert.strictEqual(playlists[1].excludeUntil, Infinity, 'excluded second playlist'); + assert.strictEqual(typeof playlists[2].excludeUntil, 'undefined', 'did not exclude second playlist'); assert.deepEqual(debugLogs, [ `Internal problem encountered with playlist ${playlists[0].id}. browser does not support codec(s): "hvc1". Switching to playlist ${playlists[1].id}.`, `switch media ${playlists[0].id} -> ${playlists[1].id} from exclude`, @@ -1831,7 +1831,7 @@ QUnit.test('blacklists fmp4 playlists by browser support', function(assert) { window.MediaSource.isTypeSupported = oldIsTypeSupported; }); -QUnit.test('blacklists ts playlists by muxer support', function(assert) { +QUnit.test('excludes ts playlists by muxer support', function(assert) { const oldIsTypeSupported = window.MediaSource.isTypeSupported; window.MediaSource.isTypeSupported = (t) => true; @@ -1891,9 +1891,9 @@ QUnit.test('blacklists ts playlists by muxer support', function(assert) { loader.trigger('trackinfo'); assert.strictEqual(playlists.length, 3, 'three playlists total'); - assert.strictEqual(playlists[0].excludeUntil, Infinity, 'blacklisted first playlist'); - assert.strictEqual(playlists[1].excludeUntil, Infinity, 'blacklisted second playlist'); - assert.strictEqual(typeof playlists[2].excludeUntil, 'undefined', 'did not blacklist third playlist'); + assert.strictEqual(playlists[0].excludeUntil, Infinity, 'excluded first playlist'); + assert.strictEqual(playlists[1].excludeUntil, Infinity, 'excluded second playlist'); + assert.strictEqual(typeof playlists[2].excludeUntil, 'undefined', 'did not exclude third playlist'); assert.deepEqual(debugLogs, [ `Internal problem encountered with playlist ${playlists[0].id}. muxer does not support codec(s): "hvc1". Switching to playlist ${playlists[1].id}.`, `switch media ${playlists[0].id} -> ${playlists[1].id} from exclude`, @@ -1988,7 +1988,7 @@ QUnit.test('unsupported playlist should not be re-included when excluding last p assert.strictEqual( master.playlists[1].excludeUntil, Infinity, - 'blacklisted invalid audio codec' + 'excluded invalid audio codec' ); const requri = this.requests[0].uri; @@ -1998,10 +1998,10 @@ QUnit.test('unsupported playlist should not be re-included when excluding last p assert.strictEqual( master.playlists[1].excludeUntil, Infinity, - 'audio codec still blacklisted' + 'audio codec still excluded' ); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); assert.equal( this.env.log.warn.args[0][0], `Problem encountered with playlist ${master.playlists[0].id}. HLS request errored at URL: ${requri} Switching to playlist 0-media.m3u8.`, @@ -2010,7 +2010,7 @@ QUnit.test('unsupported playlist should not be re-included when excluding last p }); }); -QUnit.test('segment 404 should trigger blacklisting of media', function(assert) { +QUnit.test('segment 404 should trigger exclusion of media', function(assert) { this.player.src({ src: 'manifest/master.m3u8', type: 'application/vnd.apple.mpegurl' @@ -2030,20 +2030,20 @@ QUnit.test('segment 404 should trigger blacklisting of media', function(assert) // segment this.requests[2].respond(400); - assert.ok(media.excludeUntil > 0, 'original media blacklisted for some time'); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + assert.ok(media.excludeUntil > 0, 'original media excluded for some time'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); // verify stats assert.equal(this.player.tech_.vhs.stats.bandwidth, 20000, 'bandwidth set above'); }); -QUnit.test('playlist 404 should blacklist media', function(assert) { +QUnit.test('playlist 404 should exclude media', function(assert) { let media; let url; let index; - let blacklistplaylist = 0; + let excludedplaylist = 0; let retryplaylist = 0; - let vhsRenditionBlacklistedEvents = 0; + let vhsRenditionExcludedEvents = 0; this.player.src({ src: 'manifest/master.m3u8', @@ -2053,11 +2053,11 @@ QUnit.test('playlist 404 should blacklist media', function(assert) { this.clock.tick(1); openMediaSource(this.player, this.clock); - this.player.tech_.on('blacklistplaylist', () => blacklistplaylist++); + this.player.tech_.on('excludeplaylist', () => excludedplaylist++); this.player.tech_.on('retryplaylist', () => retryplaylist++); this.player.tech_.on('usage', (event) => { - if (event.name === 'vhs-rendition-blacklisted') { - vhsRenditionBlacklistedEvents++; + if (event.name === 'vhs-rendition-excluded') { + vhsRenditionExcludedEvents++; } }); @@ -2077,11 +2077,11 @@ QUnit.test('playlist 404 should blacklist media', function(assert) { 'no media is initially set' ); - assert.equal(blacklistplaylist, 0, 'there is no blacklisted playlist'); + assert.equal(excludedplaylist, 0, 'there is no excluded playlist'); assert.equal( - vhsRenditionBlacklistedEvents, + vhsRenditionExcludedEvents, 0, - 'no vhs-rendition-blacklisted event was fired' + 'no vhs-rendition-excluded event was fired' ); // media this.requests[1].respond(404); @@ -2094,18 +2094,18 @@ QUnit.test('playlist 404 should blacklist media', function(assert) { } media = this.player.tech_.vhs.playlists.master.playlists[createPlaylistID(index, url)]; - assert.ok(media.excludeUntil > 0, 'original media blacklisted for some time'); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + assert.ok(media.excludeUntil > 0, 'original media excluded for some time'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); assert.equal( this.env.log.warn.args[0], `Problem encountered with playlist ${media.id}. HLS playlist request error at URL: media.m3u8. Switching to playlist 1-media1.m3u8.`, 'log generic error message' ); - assert.equal(blacklistplaylist, 1, 'there is one blacklisted playlist'); + assert.equal(excludedplaylist, 1, 'there is one excluded playlist'); assert.equal( - vhsRenditionBlacklistedEvents, + vhsRenditionExcludedEvents, 1, - 'a vhs-rendition-blacklisted event was fired' + 'a vhs-rendition-excluded event was fired' ); assert.equal(retryplaylist, 0, 'haven\'t retried any playlist'); @@ -2120,8 +2120,8 @@ QUnit.test('playlist 404 should blacklist media', function(assert) { media = this.player.tech_.vhs.playlists.master.playlists[createPlaylistID(index, url)]; - assert.ok(media.excludeUntil > 0, 'second media was blacklisted after playlist 404'); - assert.equal(this.env.log.warn.calls, 2, 'warning logged for blacklist'); + assert.ok(media.excludeUntil > 0, 'second media was excluded after playlist 404'); + assert.equal(this.env.log.warn.calls, 2, 'warning logged for exclusion'); assert.equal( this.env.log.warn.args[1], 'Removing other playlists from the exclusion list because the last rendition is about to be excluded.', @@ -2134,14 +2134,14 @@ QUnit.test('playlist 404 should blacklist media', function(assert) { 'log generic error message' ); assert.equal(retryplaylist, 1, 'fired a retryplaylist event'); - assert.equal(blacklistplaylist, 2, 'media1 is blacklisted'); + assert.equal(excludedplaylist, 2, 'media1 is excluded'); this.clock.tick(2 * 1000); // no new request was made since it hasn't been half the segment duration assert.strictEqual(3, this.requests.length, 'no new request was made'); this.clock.tick(3 * 1000); - // loading the first playlist since the blacklist duration was cleared + // loading the first playlist since the exclusion duration was cleared // when half the segment duaration passed assert.strictEqual(4, this.requests.length, 'one more request was made'); @@ -2153,8 +2153,8 @@ QUnit.test('playlist 404 should blacklist media', function(assert) { } media = this.player.tech_.vhs.playlists.master.playlists[createPlaylistID(index, url)]; - // the first media was unblacklisted after a refresh delay - assert.ok(!media.excludeUntil, 'removed first media from blacklist'); + // the first media was removed from exclusion after a refresh delay + assert.ok(!media.excludeUntil, 'removed first media from exclusion'); assert.strictEqual( this.requests[3].url, @@ -2166,7 +2166,7 @@ QUnit.test('playlist 404 should blacklist media', function(assert) { assert.equal(this.player.tech_.vhs.stats.bandwidth, 1e10, 'bandwidth set above'); }); -QUnit.test('blacklists playlist if it has stopped being updated', function(assert) { +QUnit.test('excludes playlist if it has stopped being updated', function(assert) { let playliststuck = 0; this.player.src({ @@ -2200,9 +2200,9 @@ QUnit.test('blacklists playlist if it has stopped being updated', function(asser assert.ok( !this.player.tech_.vhs.playlists.media().excludeUntil, - 'playlist was not blacklisted' + 'playlist was not excluded' ); - assert.equal(this.env.log.warn.calls, 0, 'no warning logged for blacklist'); + assert.equal(this.env.log.warn.calls, 0, 'no warning logged for exclusion'); assert.equal(playliststuck, 0, 'there is no stuck playlist'); this.player.tech_.trigger('play'); @@ -2222,9 +2222,9 @@ QUnit.test('blacklists playlist if it has stopped being updated', function(asser assert.ok( media.excludeUntil > 0, - 'playlist blacklisted for some time' + 'playlist excluded for some time' ); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); assert.equal( this.env.log.warn.args[0], `Problem encountered with playlist ${media.id}. ` + @@ -2234,7 +2234,7 @@ QUnit.test('blacklists playlist if it has stopped being updated', function(asser assert.equal(playliststuck, 1, 'there is one stuck playlist'); }); -QUnit.test('never blacklist the playlist if it is the only playlist', function(assert) { +QUnit.test('never excluded the playlist if it is the only playlist', function(assert) { this.player.src({ src: 'manifest/media.m3u8', type: 'application/vnd.apple.mpegurl' @@ -2252,9 +2252,9 @@ QUnit.test('never blacklist the playlist if it is the only playlist', function(a this.requests.shift().respond(404); const media = this.player.tech_.vhs.playlists.media(); - // media wasn't blacklisted because it's the only rendition - assert.ok(!media.excludeUntil, 'media was not blacklisted after playlist 404'); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + // media wasn't excluded because it's the only rendition + assert.ok(!media.excludeUntil, 'media was not excluded after playlist 404'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); assert.equal( this.env.log.warn.args[0], `Problem encountered with playlist ${media.id}. ` + @@ -2286,9 +2286,9 @@ QUnit.test( const url = this.requests[1].url.slice(this.requests[1].url.lastIndexOf('/') + 1); const media = this.player.tech_.vhs.playlists.master.playlists[createPlaylistID(0, url)]; - // media wasn't blacklisted because it's the only rendition - assert.ok(!media.excludeUntil, 'media was not blacklisted after playlist 404'); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + // media wasn't excluded because it's the only rendition + assert.ok(!media.excludeUntil, 'media was not excluded after playlist 404'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); assert.equal( this.env.log.warn.args[0], `Problem encountered with playlist ${media.id}. ` + @@ -2347,7 +2347,7 @@ QUnit.test('fire loadedmetadata once we successfully load a playlist', function( count, 0, 'loadedMedia not triggered after playlist 404' ); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); // media this.standardXHRResponse(this.requests.shift()); @@ -2601,12 +2601,12 @@ QUnit.test('the withCredentials option overrides the global default', function(a videojs.options.vhs = vhsOptions; }); -QUnit.test('playlist blacklisting duration is set through options', function(assert) { +QUnit.test('playlist exclusion duration is set through options', function(assert) { const vhsOptions = videojs.options.vhs; this.player.dispose(); videojs.options.vhs = { - blacklistDuration: 3 * 60 + playlistExclusionDuration: 3 * 60 }; this.player = createPlayer(); this.player.src({ @@ -2635,8 +2635,8 @@ QUnit.test('playlist blacklisting duration is set through options', function(ass } const media = this.player.tech_.vhs.playlists.master.playlists[createPlaylistID(index, url)]; - assert.ok(media.excludeUntil > 0, 'original media blacklisted for some time'); - assert.equal(this.env.log.warn.calls, 1, 'warning logged for blacklist'); + assert.ok(media.excludeUntil > 0, 'original media excluded for some time'); + assert.equal(this.env.log.warn.calls, 1, 'warning logged for exclusion'); assert.equal( this.env.log.warn.args[0], `Problem encountered with playlist ${media.id}. ` + @@ -2649,7 +2649,7 @@ QUnit.test('playlist blacklisting duration is set through options', function(ass this.standardXHRResponse(this.requests[2]); this.clock.tick(2 * 60 * 1000 - 1); - assert.ok(media.excludeUntil - Date.now() > 0, 'original media still be blacklisted'); + assert.ok(media.excludeUntil - Date.now() > 0, 'original media still excluded'); this.clock.tick(1 * 60 * 1000); assert.equal( @@ -4313,7 +4313,7 @@ QUnit.test('eme handles keystatuschange where status is output-restricted', func const excludes = []; - this.player.tech_.vhs.masterPlaylistController_.blacklistCurrentPlaylist = (exclude) => { + this.player.tech_.vhs.masterPlaylistController_.excludePlaylist = (exclude) => { excludes.push(exclude); }; @@ -4321,7 +4321,7 @@ QUnit.test('eme handles keystatuschange where status is output-restricted', func this.player.tech_.trigger({type: 'keystatuschange', status: 'output-restricted'}); assert.deepEqual(excludes, [{ - blacklistDuration: Infinity, + playlistExclusionDuration: Infinity, message: 'DRM keystatus changed to output-restricted. Playlist will fail to play. Check for HDCP content.', playlist: undefined }], 'excluded playlist'); @@ -4363,7 +4363,7 @@ QUnit.test('eme handles keystatuschange where status is usable', function(assert const excludes = []; - this.player.tech_.vhs.masterPlaylistController_.blacklistCurrentPlaylist = (exclude) => { + this.player.tech_.vhs.masterPlaylistController_.excludePlaylist = (exclude) => { excludes.push(exclude); }; @@ -5567,7 +5567,7 @@ QUnit.module('HLS - Encryption', { } }); -QUnit.test('blacklists playlist if key requests fail', function(assert) { +QUnit.test('excludes playlist if key requests fail', function(assert) { const vhs = VhsSourceHandler.handleSource({ src: 'manifest/encrypted-master.m3u8', type: 'application/vnd.apple.mpegurl' @@ -5608,14 +5608,14 @@ QUnit.test('blacklists playlist if key requests fail', function(assert) { assert.ok( vhs.playlists.media().excludeUntil > 0, - 'playlist blacklisted' + 'playlist excluded' ); - assert.equal(this.env.log.warn.calls, 1, 'logged warning for blacklist'); + assert.equal(this.env.log.warn.calls, 1, 'logged warning for exclusion'); vhs.dispose(); }); QUnit.test( - 'treats invalid keys as a key request failure and blacklists playlist', + 'treats invalid keys as a key request failure and excludes playlist', function(assert) { const vhs = VhsSourceHandler.handleSource({ src: 'manifest/encrypted-master.m3u8', @@ -5660,12 +5660,12 @@ QUnit.test( this.requests.shift().respond(200, null, ''); this.clock.tick(1); - // blacklist this playlist + // exclude this playlist assert.ok( vhs.playlists.media().excludeUntil > 0, - 'blacklisted playlist' + 'exclude playlist' ); - assert.equal(this.env.log.warn.calls, 1, 'logged warning for blacklist'); + assert.equal(this.env.log.warn.calls, 1, 'logged warning for exclusion'); // verify stats assert.equal(vhs.stats.mediaBytesTransferred, 1024, '1024 bytes');