-
Notifications
You must be signed in to change notification settings - Fork 425
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: add experimental pixel diff selector behind a flag #786
Conversation
src/playlist-selectors.js
Outdated
stableSort(haveResolution, (left, right) => left.width - right.width); | ||
|
||
// if we have the exact resolution as the player use it | ||
const resolutionBestRepList = haveResolution.filter((rep) => rep.width === playerWidth && rep.height === playerHeight); |
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.
We don't need this now that we use pixelDiff
since the pixelDiff
will be 0
for such a playlist.
124ea78
to
0b58f53
Compare
const playlists = this.masterPlaylistController.master().playlists; | ||
const currenstPlaylist = this.masterPlaylistController.media(); | ||
|
||
return playlists.find((playlist) => playlist !== currenstPlaylist); |
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.
Made these more dynamic
@@ -1059,7 +1059,7 @@ QUnit.test('selects a playlist below the current bandwidth', function(assert) { | |||
}); | |||
|
|||
QUnit.test( | |||
'selects a primary rendtion when there are multiple rendtions share same attributes', | |||
'selects a primary rendition when there are multiple rendtions share same attributes', |
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.
spelling
Will write tests for this if we decide to go with this change. |
92a04a9
to
ddbfb5e
Compare
test/videojs-http-streaming.test.js
Outdated
@@ -1219,12 +1219,12 @@ QUnit.test('selects the correct rendition by tech dimensions', function(assert) | |||
|
|||
assert.deepEqual( | |||
playlist.attributes.RESOLUTION, | |||
{width: 960, height: 540}, | |||
{width: 396, height: 224}, |
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.
Although in many cases, particularly when there's a good number of available renditions, selecting the closest rendition rather than the closest plus one rendition makes sense, in a case like this one, the quality will be pretty degraded compared to the previous logic. We may want to make a reasonable allotment for how many fewer pixels we'll allow before just using the higher rendition, especially if there's plenty of bandwidth available to accommodate.
I think we want to hold off on merging this until we get closer to working on our ABR epic. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
abd9354
to
deb1c7f
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Codecov Report
@@ Coverage Diff @@
## main #786 +/- ##
==========================================
+ Coverage 86.47% 86.49% +0.01%
==========================================
Files 39 39
Lines 9577 9590 +13
Branches 2210 2214 +4
==========================================
+ Hits 8282 8295 +13
Misses 1295 1295
Continue to review full report at Codecov.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
a83a4ee
to
fdb522c
Compare
fdb522c
to
1ebc14d
Compare
'liveui', | ||
'pixel-diff-selector' | ||
].forEach(function(name) { | ||
stateEls[name].addEventListener('change', function(event) { |
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.
merged all the handlers that reload the player, since I was adding a new one.
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.
Did we want to note this in the README?
src/playlist-selectors.js
Outdated
// find the smallest variant that is larger than the player | ||
// if there is no match of exact resolution |
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.
This comment is exactly the same as the one for resolutionPlusOneList
, but the behavior is different. Maybe each should call out why they're choosing each method?
@@ -296,7 +323,9 @@ export let simpleSelector = function( | |||
if (chosenRep && chosenRep.playlist) { | |||
let type = 'sortedPlaylistReps'; | |||
|
|||
if (resolutionPlusOneRep) { | |||
if (leastPixelDiffRep) { | |||
type = 'leastPixelDiffRep'; |
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.
Since we call it leastPixelDiffRep
should we name the property experimentalLeastPixelDiffSelector
?
Co-authored-by: Garrett Singer <[email protected]>
I don't think that we want to add it to the README. We haven't added any of the other experimental options. I think we just need to do an a/b test with them and make them the default or remove them. |
Co-authored-by: Garrett Singer <[email protected]>
Simplify and improve our resolution selection by selecting the closest resolution to the player, rather than using one larger or the exact size.