Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
chore(package): update dependencies to enable greenkeeper (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and brandonocasey committed Nov 26, 2018
1 parent f77f7a3 commit b017020
Show file tree
Hide file tree
Showing 6 changed files with 1,956 additions and 1,847 deletions.
3,665 changes: 1,872 additions & 1,793 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -68,19 +68,19 @@
"husky": "^1.0.0-rc.13",
"jsdoc": "https://github.com/BrandonOCasey/jsdoc#feat/plugin-from-cli",
"karma": "^3.0.0",
"lint-staged": "^7.2.2",
"lint-staged": "^8.1.0",
"not-prerelease": "^1.0.1",
"npm-merge-driver-install": "^1.0.0",
"npm-run-all": "^4.1.5",
"pkg-ok": "^2.2.0",
"rollup": "^0.65.0",
"rollup": "^0.67.3",
"shx": "^0.3.2",
"sinon": "^6.1.5",
"sinon": "^7.1.1",
"videojs-flash": "^2.1.1",
"videojs-generate-karma-config": "~3.0.0",
"videojs-generate-rollup-config": "~2.2.0",
"videojs-generate-karma-config": "~5.0.0",
"videojs-generate-rollup-config": "~2.3.1",
"videojs-generator-verify": "^1.0.5",
"videojs-standard": "~7.1.0"
"videojs-standard": "~8.0.2"
},
"module": "dist/videojs-flashls-source-handler.es.js",
"browserslist": [
Expand Down
30 changes: 14 additions & 16 deletions src/index.js
Expand Up @@ -18,25 +18,19 @@ const deprecateOldCue = function(cue) {
Object.defineProperties(cue.frame, {
id: {
get() {
videojs.log.warn(
'cue.frame.id is deprecated. Use cue.value.key instead.'
);
videojs.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');
return cue.value.key;
}
},
value: {
get() {
videojs.log.warn(
'cue.frame.value is deprecated. Use cue.value.data instead.'
);
videojs.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');
return cue.value.data;
}
},
privateData: {
get() {
videojs.log.warn(
'cue.frame.privateData is deprecated. Use cue.value.data instead.'
);
videojs.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');
return cue.value.data;
}
}
Expand Down Expand Up @@ -316,8 +310,10 @@ export class FlashlsHandler {
});

// update initial selected index
updateSelectedIndex(this.qualityLevels_,
this.tech_.el_.vjs_getProperty('level') + '');
updateSelectedIndex(
this.qualityLevels_,
this.tech_.el_.vjs_getProperty('level') + ''
);
}

setupAudioTracks(this.tech_);
Expand Down Expand Up @@ -426,7 +422,8 @@ export class FlashlsHandler {
const cue = new window.VTTCue(
time,
time + 0.1,
frame.value || frame.url || frame.data || '');
frame.value || frame.url || frame.data || ''
);

cue.frame = frame;
cue.value = frame;
Expand Down Expand Up @@ -499,10 +496,11 @@ export class FlashlsHandler {

removeOldCues(this.tech_.buffered(), this.inbandTextTracks_[caption.stream]);

this.inbandTextTracks_[caption.stream].addCue(
new window.VTTCue(caption.startPts / 90000,
caption.endPts / 90000,
caption.text));
this.inbandTextTracks_[caption.stream].addCue(new window.VTTCue(
caption.startPts / 90000,
caption.endPts / 90000,
caption.text
));
}
}

Expand Down
36 changes: 24 additions & 12 deletions test/flashlsAudioTracks.test.js
Expand Up @@ -25,14 +25,17 @@ QUnit.module('Flashls Audiotracks', {
}
});

QUnit.test('setupAudioTracks does nothing when no audio tracks from swf',
QUnit.test(
'setupAudioTracks does nothing when no audio tracks from swf',
function(assert) {
setupAudioTracks(this.tech);

assert.equal(this.vjsAudioTracks.length, 0, 'no videojs audio tracks created');
});
}
);

QUnit.test('setupAudioTracks creates videojs audio tracks for each swf audio track',
QUnit.test(
'setupAudioTracks creates videojs audio tracks for each swf audio track',
function(assert) {
// org.mangui.hls.model.AudioTrack
this.swfAudioTracks = [
Expand Down Expand Up @@ -127,9 +130,11 @@ QUnit.test('setupAudioTracks creates videojs audio tracks for each swf audio tra
assert.equal(this.vjsAudioTracks[1].enabled, false, 'Other Audio track are disabled');
assert.equal(this.vjsAudioTracks[2].id, 'French', 'corrrect id');
assert.equal(this.vjsAudioTracks[2].enabled, false, 'Other Audio track are disabled');
});
}
);

QUnit.test('updateAudioTrack sets audioTrack on swf when videojs audioTrack changes',
QUnit.test(
'updateAudioTrack sets audioTrack on swf when videojs audioTrack changes',
function(assert) {
// org.mangui.hls.model.AudioTrack
this.swfAudioTracks = [
Expand Down Expand Up @@ -178,20 +183,27 @@ QUnit.test('updateAudioTrack sets audioTrack on swf when videojs audioTrack chan

this.swfAudioTrack = -1;
updateAudioTrack(this.tech);
assert.equal(this.swfAudioTrack, -1,
'When all tracks are disabled, it does not set any track');
assert.equal(
this.swfAudioTrack, -1,
'When all tracks are disabled, it does not set any track'
);

this.vjsAudioTracks[1].enabled = true;
this.vjsAudioTracks[2].enabled = true;

this.swfAudioTrack = -1;
updateAudioTrack(this.tech);
assert.equal(this.swfAudioTrack, 1,
'When more than 1 track enabled, set the swf audio track to the first enabled track');
assert.equal(
this.swfAudioTrack, 1,
'When more than 1 track enabled, set the swf audio track to the first enabled track'
);

this.vjsAudioTracks[1].enabled = false;
this.swfAudioTrack = -1;
updateAudioTrack(this.tech);
assert.equal(this.swfAudioTrack, 2,
'Correct enabled audio track id after switching tracks');
});
assert.equal(
this.swfAudioTrack, 2,
'Correct enabled audio track id after switching tracks'
);
}
);
48 changes: 32 additions & 16 deletions test/representations.test.js
Expand Up @@ -32,27 +32,34 @@ QUnit.test('creates a representation with a working enabled function', function(
isEnabled = representation.enabled();

assert.ok(isEnabled, 'setting enabled to same value has no change');
assert.equal(enabledChanges, 0,
'setting enabled to the same value does not call enabled callback');
assert.equal(
enabledChanges, 0,
'setting enabled to the same value does not call enabled callback'
);

// set enabled to different value: true -> false
representation.enabled(false);
isEnabled = representation.enabled();

assert.notOk(isEnabled, 'setting enabled to different value updates enabled');
assert.equal(enabledChanges, 1,
'setting enabled to different value calls enabled callback');
assert.equal(
enabledChanges, 1,
'setting enabled to different value calls enabled callback'
);

// set enabled to non boolean
representation.enabled('true');
isEnabled = representation.enabled();

assert.notOk(isEnabled, 'setting enabled to non boolean does not update enabled');
assert.equal(enabledChanges, 1,
'setting enabled to non boolean does not call enabled callback');
assert.equal(
enabledChanges, 1,
'setting enabled to non boolean does not call enabled callback'
);
});

QUnit.test('createRepresentations creates a list of representation objects',
QUnit.test(
'createRepresentations creates a list of representation objects',
function(assert) {
const levels = [
{
Expand Down Expand Up @@ -85,18 +92,22 @@ QUnit.test('createRepresentations creates a list of representation objects',

const representationsApi = createRepresentations(tech);

assert.equal(typeof representationsApi, 'function',
'createRepresentations returns a function for getting the list of representations');
assert.equal(
typeof representationsApi, 'function',
'createRepresentations returns a function for getting the list of representations'
);

const representations = representationsApi();

assert.equal(representations.length, 3, 'created a list of representations');
assert.equal(representations[0].id, '0', 'created representation for video');
assert.equal(representations[1].id, '1', 'created representation for video');
assert.equal(representations[2].id, '3', 'created representation for video');
});
}
);

QUnit.test('representations sets levels on tech correctly when enabling/disabling',
QUnit.test(
'representations sets levels on tech correctly when enabling/disabling',
function(assert) {
const levels = [
{
Expand Down Expand Up @@ -130,14 +141,18 @@ QUnit.test('representations sets levels on tech correctly when enabling/disablin
});
const representations = createRepresentations(tech)();

assert.deepEqual(representations.map(rep => rep.enabled()), [true, true, true],
'all representations enabled on creation');
assert.deepEqual(
representations.map(rep => rep.enabled()), [true, true, true],
'all representations enabled on creation'
);
assert.equal(currentLevel, -1, 'auto level mode');
assert.equal(autoLevelCapping, -1, 'no autoLevelCapping');

representations[2].enabled(false);
assert.equal(currentLevel, -1,
'auto level mode when more than one representation is enabled');
assert.equal(
currentLevel, -1,
'auto level mode when more than one representation is enabled'
);
assert.equal(autoLevelCapping, 1, 'autoLevelCapping set to highest enabled bitrate');

representations[2].enabled(true);
Expand All @@ -152,4 +167,5 @@ QUnit.test('representations sets levels on tech correctly when enabling/disablin
representations[1].enabled(false);
assert.equal(currentLevel, -1, 'auto level mode when all disabled');
assert.equal(autoLevelCapping, -1, 'no autoLevelCapping when all disabled');
});
}
);
12 changes: 8 additions & 4 deletions test/videojs-flashls-source-handler.test.js
Expand Up @@ -33,7 +33,8 @@ QUnit.test('can get stats from handler', function(assert) {
assert.deepEqual(handler.stats, stats, 'can get hls.stats');
});

QUnit.test('triggers an event when bandwidth updates after segment load',
QUnit.test(
'triggers an event when bandwidth updates after segment load',
function(assert) {
let bandwidthupdate = 0;

Expand All @@ -48,9 +49,11 @@ QUnit.test('triggers an event when bandwidth updates after segment load',

tech.trigger('fragmentloaded');
assert.equal(bandwidthupdate, 1, 'tech fired a bandwidthupdate');
});
}
);

QUnit.test('seeks to live point when playhead is outside seekable',
QUnit.test(
'seeks to live point when playhead is outside seekable',
function(assert) {
let time = 0;
const tech = makeMochTech({});
Expand All @@ -70,4 +73,5 @@ QUnit.test('seeks to live point when playhead is outside seekable',

tech.trigger('play');
assert.equal(time, seekableEnd, 'seeked to live');
});
}
);

0 comments on commit b017020

Please sign in to comment.