Skip to content
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

fix: do not request manifests until play when preload is none #1060

Merged
merged 2 commits into from
Feb 9, 2021

Conversation

brandonocasey
Copy link
Contributor

Description

We don't do a very good job respecting preload=none on the video element because even with preload=none we still download the manifests and potentially waste bandwidth with videos that never get played. We should prevent that when preload is set to none.

@brandonocasey brandonocasey changed the title Fix/preload none for real fix: do not request manifests when preload is none Feb 3, 2021
@brandonocasey brandonocasey changed the title fix: do not request manifests when preload is none fix: do not request manifests until play when preload is none Feb 3, 2021
@@ -3718,7 +3718,7 @@ QUnit.test('switching playlists with an outstanding key request aborts request a
);
});

QUnit.test('does not download segments if preload option set to none', function(assert) {
QUnit.test('does not download anything until play if preload option set to none', function(assert) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was failing, and didn't really make sense anymore. I modified for the new behavior.

@phloxic
Copy link
Contributor

phloxic commented Feb 4, 2021

Great. I haven't tested it yet. But this probably also prevents a scenario with experimentalBufferBasedABR where the buffer check is constantly repeated at a short interval while the player is not 'loaded', see #1041

Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works nicely!

@@ -85,6 +88,13 @@ <h3>Options</h3>
<input id=override-native type="checkbox" checked>
Override Native (reloads player)
</label>
<label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@@ -279,7 +279,16 @@ export class MasterPlaylistController extends videojs.EventTarget {
this.logger_ = logger('MPC');

this.triggeredFmp4Usage = false;
this.masterPlaylistLoader_.load();
if (this.tech_.preload() === 'none') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad it's surprisingly simple.

@gkatsev gkatsev merged commit 49249d5 into main Feb 9, 2021
@gkatsev gkatsev deleted the fix/preload-none-for-real branch February 9, 2021 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants