diff --git a/.eslintrc.js b/.eslintrc.js index e9479a183c1..8cd32d72654 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -77,6 +77,18 @@ module.exports = { { 'name': 'window', 'message': 'Use `self` instead of `window` to access the global context everywhere (including workers).' + }, + { + 'name': 'SourceBuffer', + 'message': 'Use `self.SourceBuffer`' + }, + { + 'name': 'setTimeout', + 'message': 'Use `self.setTimeout`' + }, + { + 'name': 'setInterval', + 'message': 'Use `self.setInterval`' } ], @@ -90,11 +102,11 @@ module.exports = { 'no-var': 1, 'no-empty': 1, 'no-mixed-operators': 1, - 'no-unused-vars': 1, + 'no-unused-vars': 2, '@typescript-eslint/no-unused-vars': 1, 'no-console': 1, 'no-fallthrough': 1, - 'no-case-declarations': 1, + 'no-case-declarations': 2, 'no-irregular-whitespace': 1, 'no-self-assign': 1, 'new-cap': 1, @@ -108,7 +120,7 @@ module.exports = { 'no-useless-catch': 2, 'lines-between-class-members': 2, 'no-prototype-builtins': 0, - '@typescript-eslint/consistent-type-assertions': [ 2, + '@typescript-eslint/consistent-type-assertions': [ 2, { 'assertionStyle': 'as', 'objectLiteralTypeAssertions': 'never' diff --git a/.travis.yml b/.travis.yml index 8d6de05d8dd..59b99f5fc4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ jobs: api_key: secure: "kR9xHKhWfOv6vwxz1d//PpC22VDupnPI59L9czLkpLoIdzm5rm3eV7he4XPlQfbSrV1UBgURARgF+yekmeqUZk9vqfo4F5oa+6KiBxAdnI9PjsjYRSXitdq4a6kpIR854nxUIOlDXR5AbD2MgNaKsQHiaNlngdR/870OhiwqRJVwQOLKVUADw1QWECXe/DXrQiFbMunxBrTyutbrGuI8cT7wzqFn+aPkI/3liiw8PTr93GrtxZ/bFxI899KzMSHHMXB+eDDMtxPFD+VApruD7h6f+1C0psJeOV8/PkzrRkbPELPBKKaPH9TvVOPUf2OSRHVna828wnLHwseae0rgtuk7+ZJmB9XZKX9FUBDT4/Gv/AkE+m/cwnoqaatAMJYR+yiQqsosjBLDAaTUOPHu3wBdAaR5uL5fGsSsKe3sUfSQHrv86vReNl9ETU06apmyWtsIbyhMtv98j9I+hNVjKZUI30g1ee6LgjlDlBavMk8KAbLbyBTcJlNAexj8Rppdqg+AdW7rYW+S6SgfTyyYQKTLeFwmDjfrkqzHJnk78sV18+xPLI1hbzBGp/bXaW23sLDBLLV5Sxifr8flUMkUdH28zsLCHUQ7C4GKQ19el2NZgIxSsnxRA8vGZof7OXasR4HJVjv/PSx+DN6Fi1PV1SiNBcwgPCGIIxBF7TUPxJk=" file_glob: true - file: dist/* + file: dist/*.{js,js.map} draft: true tag_name: $TRAVIS_TAG target_commitish: $TRAVIS_COMMIT diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..d148c7a8c7f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,84 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at the [video-dev slack](https://video-dev.org/). All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the project community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, +available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. diff --git a/package-lock.json b/package-lock.json index 344a44a3cd0..ccd05f429fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15954,11 +15954,52 @@ "dev": true }, "typescript": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz", - "integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", "dev": true }, + "typescript-eslint-parser": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/typescript-eslint-parser/-/typescript-eslint-parser-21.0.2.tgz", + "integrity": "sha512-u+pj4RVJBr4eTzj0n5npoXD/oRthvfUCjSKndhNI714MG0mQq2DJw5WP7qmonRNIFgmZuvdDOH3BHm9iOjIAfg==", + "dev": true, + "requires": { + "eslint-scope": "^4.0.0", + "eslint-visitor-keys": "^1.0.0", + "typescript-estree": "5.3.0" + }, + "dependencies": { + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + } + } + }, + "typescript-estree": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/typescript-estree/-/typescript-estree-5.3.0.tgz", + "integrity": "sha512-Vu0KmYdSCkpae+J48wsFC1ti19Hq3Wi/lODUaE+uesc3gzqhWbZ5itWbsjylLVbjNW4K41RqDzSfnaYNbmEiMQ==", + "dev": true, + "requires": { + "lodash.unescape": "4.0.1", + "semver": "5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + } + } + }, "uglify-js": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", diff --git a/package.json b/package.json index abdafd8be5f..b3953395287 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,8 @@ "selenium-webdriver": "^3.1.0", "sinon": "7.1.1", "sinon-chai": "3.3.0", - "typescript": "^3.6.3", + "typescript": "^3.7.4", + "typescript-eslint-parser": "^21.0.2", "webpack": "^4.27.1", "webpack-cli": "^3.1.2", "webpack-dev-server": "^3.1.4", diff --git a/scripts/travis.sh b/scripts/travis.sh index d51855265c9..dd65cf170e5 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -12,7 +12,7 @@ if [ "${TRAVIS_MODE}" = "build" ]; then echo "travis_fold:end:lint" echo "travis_fold:start:build" npm run type-check - npm run build + npm run build:ci npm run build:types echo "travis_fold:end:build" echo "travis_fold:start:docs" @@ -24,7 +24,7 @@ if [ "${TRAVIS_MODE}" = "build" ]; then elif [ "${TRAVIS_MODE}" = "unitTests" ]; then npm run test:unit elif [ "${TRAVIS_MODE}" = "funcTests" ]; then - npm run build + npm run build:ci n=0 maxRetries=1 until [ $n -ge ${maxRetries} ] @@ -50,8 +50,7 @@ elif [ "${TRAVIS_MODE}" = "release" ] || [ "${TRAVIS_MODE}" = "releaseCanary" ] node ./scripts/set-package-version.js npm run lint npm run type-check - npm run build - npm run build:types + npm run build:ci if [ "${TRAVIS_MODE}" != "netlifyPr" ]; then npm run test:unit diff --git a/src/controller/abr-controller.ts b/src/controller/abr-controller.ts index c088b29d48b..515e65eedc5 100644 --- a/src/controller/abr-controller.ts +++ b/src/controller/abr-controller.ts @@ -50,7 +50,7 @@ class AbrController extends EventHandler { if (frag.type === 'main') { if (!this.timer) { this.fragCurrent = frag; - this.timer = setInterval(this.onCheck, 100); + this.timer = self.setInterval(this.onCheck, 100); } } } diff --git a/src/controller/audio-stream-controller.ts b/src/controller/audio-stream-controller.ts index ffe85893fd3..426b8f3b72c 100644 --- a/src/controller/audio-stream-controller.ts +++ b/src/controller/audio-stream-controller.ts @@ -112,7 +112,7 @@ class AudioStreamController extends BaseStreamController { } break; } - case State.FRAG_LOADING_WAITING_RETRY: + case State.FRAG_LOADING_WAITING_RETRY: { const now = performance.now(); const retryDate = this.retryDate; const isSeeking = media && media.seeking; @@ -122,7 +122,8 @@ class AudioStreamController extends BaseStreamController { this.state = State.IDLE; } break; - case State.WAITING_INIT_PTS: + } + case State.WAITING_INIT_PTS: { const videoTrackCC = this.videoTrackCC; if (Number.isFinite(this.initPTS[videoTrackCC])) { // Ensure we don't get stuck in the WAITING_INIT_PTS state if the waiting frag CC doesn't match any initPTS @@ -145,6 +146,7 @@ class AudioStreamController extends BaseStreamController { } } break; + } default: break; } @@ -448,7 +450,7 @@ class AudioStreamController extends BaseStreamController { switch (data.details) { case ErrorDetails.FRAG_LOAD_ERROR: - case ErrorDetails.FRAG_LOAD_TIMEOUT: + case ErrorDetails.FRAG_LOAD_TIMEOUT: { const frag = data.frag; // don't handle frag error not related to audio fragment if (frag && frag.type !== 'audio') { @@ -480,6 +482,7 @@ class AudioStreamController extends BaseStreamController { } } break; + } case ErrorDetails.AUDIO_TRACK_LOAD_ERROR: case ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT: case ErrorDetails.KEY_LOAD_ERROR: diff --git a/src/controller/fps-controller.js b/src/controller/fps-controller.js index 3206b644070..bf1827baa21 100644 --- a/src/controller/fps-controller.js +++ b/src/controller/fps-controller.js @@ -30,7 +30,7 @@ class FPSController extends EventHandler { } clearInterval(this.timer); - this.timer = setInterval(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod); + this.timer = self.setTimeout(this.checkFPSInterval.bind(this), config.fpsDroppedMonitoringPeriod); } } diff --git a/src/controller/id3-track-controller.js b/src/controller/id3-track-controller.js deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/controller/timeline-controller.ts b/src/controller/timeline-controller.ts index c974c0663ad..09059cf73ca 100644 --- a/src/controller/timeline-controller.ts +++ b/src/controller/timeline-controller.ts @@ -329,7 +329,7 @@ class TimelineController extends EventHandler { onFragLoaded (data: { frag: Fragment, payload: any }) { const { frag, payload } = data; - const { cea608Parser, initPTS, lastSn, unparsedVttFrags } = this; + const { cea608Parser, initPTS, unparsedVttFrags } = this; if (frag.type === 'main') { const sn = frag.sn; // if this frag isn't contiguous, clear the parser so cues with bad start/end times aren't added to the textTrack diff --git a/src/demux/mp4demuxer.ts b/src/demux/mp4demuxer.ts index 566cfd3707d..e57f4964757 100644 --- a/src/demux/mp4demuxer.ts +++ b/src/demux/mp4demuxer.ts @@ -1,7 +1,6 @@ /** * MP4 demuxer */ -import { logger } from '../utils/logger'; import { Demuxer, DemuxerResult, DemuxedTrack } from '../types/demuxer'; import { findBox, segmentValidRange, appendUint8Array } from '../utils/mp4-tools'; import { dummyTrack } from './dummy-demuxed-track'; diff --git a/src/demux/tsdemuxer.ts b/src/demux/tsdemuxer.ts index 49df551937c..2938a229e5b 100644 --- a/src/demux/tsdemuxer.ts +++ b/src/demux/tsdemuxer.ts @@ -282,7 +282,7 @@ class TSDemuxer implements Demuxer { pmtId = this._pmtId = parsePAT(data, offset); break; - case pmtId: + case pmtId: { if (stt) { offset += data[offset] + 1; } @@ -318,6 +318,7 @@ class TSDemuxer implements Demuxer { } pmtParsed = this.pmtParsed = true; break; + } case 17: case 0x1fff: break; diff --git a/src/loader/fragment-loader.ts b/src/loader/fragment-loader.ts index a6893169080..ea608211d0c 100644 --- a/src/loader/fragment-loader.ts +++ b/src/loader/fragment-loader.ts @@ -1,11 +1,9 @@ import { ErrorTypes, ErrorDetails } from '../errors'; -import { logger } from '../utils/logger'; import Fragment from './fragment'; import { Loader, LoaderConfiguration, FragmentLoaderContext, - LoaderContext, LoaderCallbacks } from '../types/loader'; diff --git a/src/remux/dummy-remuxer.js b/src/remux/dummy-remuxer.js deleted file mode 100644 index 72418423052..00000000000 --- a/src/remux/dummy-remuxer.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * dummy remuxer -*/ - -class DummyRemuxer { - constructor (observer) { - this.observer = observer; - } - - destroy () { - } - - resetInitSegment () { - } - - resetTimeStamp () { - } - - remux (audioTrack, videoTrack, id3Track, textTrack, timeOffset) { - this._remuxAACSamples(audioTrack, timeOffset); - this._remuxAVCSamples(videoTrack, timeOffset); - this._remuxID3Samples(id3Track, timeOffset); - this._remuxTextSamples(textTrack, timeOffset); - } - - _remuxAVCSamples (track, timeOffset) { - let avcSample, unit; - // loop through track.samples - while (track.samples.length) { - avcSample = track.samples.shift(); - // loop through AVC sample NALUs - while (avcSample.units.length) { - unit = avcSample.units.shift(); - } - } - // please lint - timeOffset = timeOffset; - } - - _remuxAACSamples (track, timeOffset) { - let aacSample, unit; - // loop through track.samples - while (track.samples.length) { - aacSample = track.samples.shift(); - unit = aacSample.unit; - } - // please lint - timeOffset = timeOffset; - } - - _remuxID3Samples (track, timeOffset) { - let id3Sample, unit; - // loop through track.samples - while (track.samples.length) { - id3Sample = track.samples.shift(); - unit = id3Sample.unit; - } - // please lint - timeOffset = timeOffset; - } - - _remuxTextSamples (track, timeOffset) { - let textSample, bytes; - // loop through track.samples - while (track.samples.length) { - textSample = track.samples.shift(); - bytes = textSample.bytes; - } - // please lint - timeOffset = timeOffset; - } -} - -export default DummyRemuxer; diff --git a/src/utils/discontinuities.js b/src/utils/discontinuities.js index 35b5e09facb..b21124cc0db 100644 --- a/src/utils/discontinuities.js +++ b/src/utils/discontinuities.js @@ -1,4 +1,3 @@ -import BinarySearch from './binary-search'; import { logger } from '../utils/logger'; export function findFirstFragWithCC (fragments, cc) { diff --git a/tests/functional/auto/setup.js b/tests/functional/auto/setup.js index c2b2184f1bb..f7dea51c691 100644 --- a/tests/functional/auto/setup.js +++ b/tests/functional/auto/setup.js @@ -62,7 +62,7 @@ HttpServer.createServer({ root: './' }).listen(8000, hostname); -const wait = ms => new Promise(resolve => setTimeout(resolve, ms)); +const wait = ms => new Promise(resolve => self.setTimeout(resolve, ms)); async function retry (attempt, numAttempts = 5, interval = 2000) { try { return await attempt(); @@ -166,26 +166,26 @@ async function testSeekOnVOD (url, config) { expect(result, JSON.stringify(result, null, 2)).to.have.property('code').which.equals('ended'); } -async function testSeekEndVOD (url, config) { - const result = await browser.executeAsyncScript( - (url, config) => { - const callback = arguments[arguments.length - 1]; - self.startStream(url, config, callback); - const video = self.video; - video.onloadeddata = function () { - self.setTimeout(function () { - video.currentTime = video.duration; - }, 5000); - }; - video.onended = function () { - callback({ code: 'ended', logs: self.logString }); - }; - }, - url, - config - ); - expect(result, JSON.stringify(result, null, 2)).to.have.property('code').which.equals('ended'); -} +// async function testSeekEndVOD (url, config) { +// const result = await browser.executeAsyncScript( +// (url, config) => { +// const callback = arguments[arguments.length - 1]; +// self.startStream(url, config, callback); +// const video = self.video; +// video.onloadeddata = function () { +// self.setTimeout(function () { +// video.currentTime = video.duration; +// }, 5000); +// }; +// video.onended = function () { +// callback({ code: 'ended', logs: self.logString }); +// }; +// }, +// url, +// config +// ); +// expect(result, JSON.stringify(result, null, 2)).to.have.property('code').which.equals('ended'); +// } async function testIsPlayingVOD (url, config) { const result = await browser.executeAsyncScript( @@ -296,7 +296,7 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu browser.manage().setTimeouts({ script: 75000 }), browser.getSession() ]); - console.log(`Retrieved session in ${Date.now() - start}ms`); + console.log(`Retrieved session in ${Date.now() - start}ms. timeouts ${timeouts}`); if (onTravis) { console.log( `Job URL: https://saucelabs.com/jobs/${session.getId()}` @@ -388,6 +388,7 @@ describe(`testing hls.js playback in the browser on "${browserDescription}"`, fu `should seek 5s from end and receive video ended event for ${stream.description}`, testSeekOnVOD.bind(null, url, config) ); + // TODO: Seeking to or past VOD duration should result in the video ending // it(`should seek on end and receive video ended event for ${stream.description}`, testSeekEndVOD.bind(null, url)); } } diff --git a/tests/unit/controller/audio-stream-controller.js b/tests/unit/controller/audio-stream-controller.js index cdf5ed55285..fb715abddc3 100644 --- a/tests/unit/controller/audio-stream-controller.js +++ b/tests/unit/controller/audio-stream-controller.js @@ -1,8 +1,6 @@ import AudioStreamController from '../../../src/controller/audio-stream-controller'; import Hls from '../../../src/hls'; -const sinon = require('sinon'); - describe('AudioStreamController', function () { const tracks = [{ groupId: '1', diff --git a/tests/unit/controller/eme-controller.js b/tests/unit/controller/eme-controller.js index 3f4cc4ee0e3..0ac56526dd4 100644 --- a/tests/unit/controller/eme-controller.js +++ b/tests/unit/controller/eme-controller.js @@ -68,7 +68,7 @@ describe('EMEController', function () { emeController.onManifestParsed({ levels: fakeLevels }); - setTimeout(function () { + self.setTimeout(function () { expect(media.setMediaKeys.callCount).to.equal(0); expect(reqMediaKsAccessSpy.callCount).to.equal(1); done(); @@ -97,7 +97,7 @@ describe('EMEController', function () { media.emit('encrypted', badData); - setTimeout(function () { + self.setTimeout(function () { expect(emeController.hls.trigger.args[0][1].details).to.equal(ErrorDetails.KEY_SYSTEM_NO_KEYS); expect(emeController.hls.trigger.args[1][1].details).to.equal(ErrorDetails.KEY_SYSTEM_NO_ACCESS); done(); diff --git a/tests/unit/controller/gap-controller.js b/tests/unit/controller/gap-controller.js index 06a85cd4079..ebb6e7e24d7 100644 --- a/tests/unit/controller/gap-controller.js +++ b/tests/unit/controller/gap-controller.js @@ -1,5 +1,5 @@ import Hls from '../../../src/hls'; -import GapController, { SKIP_BUFFER_RANGE_START, STALL_MINIMUM_DURATION_MS } from '../../../src/controller/gap-controller'; +import GapController, { SKIP_BUFFER_RANGE_START } from '../../../src/controller/gap-controller'; import { FragmentTracker } from '../../../src/controller/fragment-tracker'; import Event from '../../../src/events'; import { ErrorTypes, ErrorDetails } from '../../../src/errors'; diff --git a/tests/unit/controller/subtitle-track-controller.js b/tests/unit/controller/subtitle-track-controller.js index fa1ef48f7a9..12efd8fe92b 100644 --- a/tests/unit/controller/subtitle-track-controller.js +++ b/tests/unit/controller/subtitle-track-controller.js @@ -216,7 +216,7 @@ describe('SubtitleTrackController', function () { const details = new LevelDetails(''); details.live = false; subtitleTrackController.trackId = 1; - subtitleTrackController.timer = setTimeout(() => {}, 0); + subtitleTrackController.timer = self.setTimeout(() => {}, 0); subtitleTrackController.onSubtitleTrackLoaded({ id: 1, details, stats: new LoadStats() }); expect(subtitleTrackController.timer).to.not.exist; }); diff --git a/tests/unit/loader/fragment-loader.js b/tests/unit/loader/fragment-loader.js index eb7d505d923..b4342c9dc01 100644 --- a/tests/unit/loader/fragment-loader.js +++ b/tests/unit/loader/fragment-loader.js @@ -100,7 +100,7 @@ describe('FragmentLoader tests', function () { }); it('handles fragment load timeouts', function () { - let abortSpy; + // let abortSpy; return new Promise((resolve, reject) => { fragmentLoader.load(frag) .then(() => { @@ -122,7 +122,7 @@ describe('FragmentLoader tests', function () { }); const loaderInstance = fragmentLoader.loader; expect(loaderInstance).to.be.instanceOf(MockXhr); - abortSpy = sinon.spy(loaderInstance.abort); + // abortSpy = sinon.spy(loaderInstance.abort); loaderInstance.callbacks.onTimeout(response, context, networkDetails); }); });