-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Easier manually playlist switching, add codecs to renditions #850
Conversation
a67512c
to
c776658
Compare
Added new tests and fixed tests that were failing after the rebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that smoothQualityChange_
and fastQualityChange_
can accept a new playlist to switch to, should we have a test that verifies that we try to switch to that one appropriately?
@@ -41,20 +49,23 @@ const makeMockPlaylist = function(options) { | |||
}; | |||
|
|||
const makeMockVhsHandler = function(playlistOptions, handlerOptions) { | |||
const mcp = { | |||
const mpc = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, 😆
@@ -66,6 +67,10 @@ class Representation { | |||
|
|||
this.bandwidth = playlist.attributes.BANDWIDTH; | |||
|
|||
this.codecs = codecsForPlaylist(mpc.master(), playlist); | |||
|
|||
this.playlist = playlist; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add the whole playlist object to the representation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes it easier to pass to smoothQualityChange
/fastQualityChange
test/rendition-mixin.test.js
Outdated
assert.deepEqual(renditions[0].playlist, vhsHandler.playlists.master.playlists[0], 'rendition 1 has correct codec'); | ||
assert.deepEqual(renditions[1].playlist, vhsHandler.playlists.master.playlists[1], 'rendition 2 has correct codec'); | ||
assert.deepEqual(renditions[2].playlist, vhsHandler.playlists.master.playlists[2], 'rendition 3 has no codec'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.deepEqual(renditions[0].playlist, vhsHandler.playlists.master.playlists[0], 'rendition 1 has correct codec'); | |
assert.deepEqual(renditions[1].playlist, vhsHandler.playlists.master.playlists[1], 'rendition 2 has correct codec'); | |
assert.deepEqual(renditions[2].playlist, vhsHandler.playlists.master.playlists[2], 'rendition 3 has no codec'); | |
assert.deepEqual(renditions[0].playlist, vhsHandler.playlists.master.playlists[0], 'rendition 1 has playlist property'); | |
assert.deepEqual(renditions[1].playlist, vhsHandler.playlists.master.playlists[1], 'rendition 2 has playlist property'); | |
assert.deepEqual(renditions[2].playlist, vhsHandler.playlists.master.playlists[2], 'rendition 3 has playlist property'); |
Right now we don't have a great way to manually switch playlists without calling
blacklistCurrentPlaylist
and hoping for the best or using the renditions api to exclude all renditions that we don't want. This change allows us to pass a playlist intosmoothQualityChange_
andfastQualityChange_
so that we can directly change to the playlist we want. It also adds playlist codecs to the rendition API.