-
Notifications
You must be signed in to change notification settings - Fork 1
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
Dorska/quality selector #556
Conversation
Codecov Report
@@ Coverage Diff @@
## master #556 +/- ##
==========================================
- Coverage 95.9% 94.96% -0.94%
==========================================
Files 151 152 +1
Lines 5465 5542 +77
Branches 220 220
==========================================
+ Hits 5241 5263 +22
- Misses 189 244 +55
Partials 35 35
Continue to review full report at Codecov.
|
@adorsk if this is ready for review, can you add the "Needs Review" label? That's our most reliable signal that a PR is ready. |
requirements.txt
Outdated
-e git+https://github.com/mitodl/django-elastic-transcoder.git#egg=django-elastic-transcoder | ||
-e git+https://github.com/Brown-University-Library/django-shibboleth-remoteuser.git#egg=django-shibboleth-remoteuser | ||
-e git+https://github.com/mitodl/mit-moira.git#egg=mit-moira | ||
-e git+https://github.com/mitodl/pycaption.git#egg=pycaption |
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.
Can you revert the changes to this file?
static/js/components/VideoPlayer.js
Outdated
return _.last(playlists) | ||
} | ||
// Return playlist with highest bandwidth <= system bandwidth |
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 overrides the native HLS algorithm so that the video player's size in the browser is ignored; and should still be used unless someone manually selects a quality level.
static/js/components/VideoPlayer.js
Outdated
@@ -339,7 +337,12 @@ class VideoPlayer extends React.Component<*, void> { | |||
}) | |||
}) | |||
if (this.tech_.hls !== undefined) { | |||
this.tech_.hls.selectPlaylist = selectPlaylist | |||
const _originalSelectPlaylist = this.tech_.hls.selectPlaylist |
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 was overriden in a previous PR so that the size of the video in the browser is ignored when determining the optimal resolution to play. Can you revert to using that custom algorithm instead of the default 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.
Ah, I see what you mean.
Updated to use a modified version of the previous custom algorithm. The modification is: the algorithm will now select the highest active playlist that is less than the available system bandwidth, or the first active playlist if no active playlist is <= system bandwidth.
The quality selector widget sets all non-selected playlists to disabled. If 'auto' is selected it sets all playlists to active.
82de554
to
e8cab7c
Compare
static/js/components/VideoPlayer.js
Outdated
) | ||
} | ||
|
||
selectInitialQualityLevel() { |
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 function doesn't seem to be used, can it be removed?
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.
ah, nice catch. removed.
@@ -0,0 +1,135 @@ | |||
/* Adapted from https://github.com/chrisboustead/videojs-hls-quality-selector . |
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.
Would it be possible to bring in/adapt some of the unit tests for this plugin too, to improve coverage?
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.
I wasn't sure on whether this would be worth it. The original plugin just tests that it can register against videojs:
https://github.com/chrisboustead/videojs-hls-quality-selector/blob/master/test/plugin.test.js
We could write tests, but I think it would mostly look like a lot of mocking for videojs functions.
Do you think it's worth pursuing? Either way is fine with me.
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.
Ok with me to skip it if it won't add much value.
@mbertrand reverted Ready for review again. |
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.
👍
Closed #377. |
What are the relevant tickets?
#377
What's this PR do?
Adds a new control to the VideoPlayer control bar that allows the user to select a video quality setting.
How should this be manually tested?
video_...-2gfh90...ts
. The "2gfh90
" indicates that the highest bitrate is being used.video_...-06dkm6...ts
..ts
lines..ts
lines..ts
lines..ts
lines.Any background context you want to provide?
Normally videojs adaptively determines which bitrate to use, per:
https://github.com/videojs/videojs-contrib-hls/blob/master/docs/bitrate-switching.md
We can override the normal behavior by toggling active bitrates. The videojs-contrib-quality-levels plugin provides an API for doing this toggling.
And in this PR we add a control that allows humans to interact with that API.