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

feat: remove experimental options #1301

Merged
merged 11 commits into from
Aug 19, 2022
Merged

Conversation

kchang-brightcove
Copy link
Contributor

@kchang-brightcove kchang-brightcove commented Jul 28, 2022

Description

Removed some experimental options and make them default.

@welcome
Copy link

welcome bot commented Jul 28, 2022

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@gkatsev
Copy link
Member

gkatsev commented Jul 28, 2022

This probably should go against the next branch? Also, should we enable llhls by default here as well? @misteroneill?

@kchang-brightcove kchang-brightcove changed the base branch from main to next August 1, 2022 19:38
@kchang-brightcove kchang-brightcove force-pushed the wp-529-remove-experimental-options branch 2 times, most recently from 47d1261 to b8da6d6 Compare August 1, 2022 19:54
Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

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

Yeah, we should, I think. The others are blocked by lack of enough real world data.

src/manifest.js Outdated
@@ -23,7 +23,7 @@ export const createPlaylistID = (index, uri) => {
* An array of custom tag parsers for the m3u8-parser instance
* @param {Object[]} [customTagMappers]
* An array of custom tag mappers for the m3u8-parser instance
* @param {boolean} [experimentalLLHLS=false]
* @param {boolean} [llhls=false]
Copy link
Member

Choose a reason for hiding this comment

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

This should default to true now.

@@ -34,7 +34,7 @@ export const parseManifest = ({
manifestString,
customTagParsers = [],
customTagMappers = [],
experimentalLLHLS
llhls
Copy link
Member

Choose a reason for hiding this comment

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

The change to the JSDoc isn't enough to default it to true. It would need to be changed here as well

Suggested change
llhls
llhls = true

Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

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

LGTM. @gesinger would you mind having a quick look?

Comment on lines 400 to 403
// force experimentalLLHLS for IE 11
// force llhls for IE 11
if (videojs.browser.IE_VERSION) {
this.experimentalLLHLS = false;
this.llhls = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this whole block can be removed.

src/manifest.js Outdated
@@ -34,7 +34,7 @@ export const parseManifest = ({
manifestString,
customTagParsers = [],
customTagMappers = [],
experimentalLLHLS
llhls = true
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this default should be at a higher level (probably in src/videojs-http-streaming.js), as, as it stands, it looks like playlist-loader will set it to false if left unspecified.

if (videojs.browser.IE_VERSION) {
this.llhls = false;
}
this.llhls = (vhsOptions && vhsOptions.llhls) || true;
Copy link
Contributor

Choose a reason for hiding this comment

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

This line will always evaluate to true. But I think the option should to be set at a higher level (in src/videojs-http-streaming.js, probably in setOptions_ https://github.com/videojs/http-streaming/blob/main/src/videojs-http-streaming.js#L622 ).

src/manifest.js Outdated
@@ -23,7 +23,7 @@ export const createPlaylistID = (index, uri) => {
* An array of custom tag parsers for the m3u8-parser instance
* @param {Object[]} [customTagMappers]
* An array of custom tag mappers for the m3u8-parser instance
* @param {boolean} [experimentalLLHLS=false]
* @param {boolean} [llhls=true]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @param {boolean} [llhls=true]
* @param {boolean} [llhls]

@@ -395,7 +395,7 @@ export default class PlaylistLoader extends EventTarget {

this.customTagParsers = (vhsOptions && vhsOptions.customTagParsers) || [];
this.customTagMappers = (vhsOptions && vhsOptions.customTagMappers) || [];
this.llhls = (vhsOptions && vhsOptions.llhls) || true;
this.llhls = (vhsOptions && vhsOptions.llhls) || false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the option is set at a higher level, I think we can just use:

Suggested change
this.llhls = (vhsOptions && vhsOptions.llhls) || false;
this.llhls = vhsOptions && vhsOptions.llhls;

@@ -597,6 +597,7 @@ class VhsHandler extends Component {
this.options_.customTagParsers = this.options_.customTagParsers || [];
this.options_.customTagMappers = this.options_.customTagMappers || [];
this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
this.options_.llhls = this.options_.llhls === false ? false : true;
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we use this style above, but I think it's clearer as:

Suggested change
this.options_.llhls = this.options_.llhls === false ? false : true;
this.options_.llhls = Boolean(this.options_.llhls);

Copy link
Member

Choose a reason for hiding this comment

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

Coming back to this, Kevin has restored the previous state:

this.options_.llhls === false ? false : true

This is because simply doing Boolean(this.options_.llhls) was not defaulting to true, which is what was wanted.

Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

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

I think the build is failing due to some linting issues in scripts/index.js

@codecov
Copy link

codecov bot commented Aug 11, 2022

Codecov Report

Merging #1301 (d6d4ed1) into next (206f099) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head d6d4ed1 differs from pull request most recent head 4b1d2a3. Consider uploading reports for the commit 4b1d2a3 to get more accurate results

@@            Coverage Diff             @@
##             next    #1301      +/-   ##
==========================================
- Coverage   86.27%   86.23%   -0.04%     
==========================================
  Files          39       39              
  Lines        9791     9757      -34     
  Branches     2275     2276       +1     
==========================================
- Hits         8447     8414      -33     
+ Misses       1344     1343       -1     
Impacted Files Coverage Δ
src/manifest.js 93.45% <100.00%> (ø)
src/master-playlist-controller.js 94.95% <100.00%> (ø)
src/playlist-loader.js 95.00% <100.00%> (-0.03%) ⬇️
src/playlist-selectors.js 87.05% <100.00%> (ø)
src/playlist.js 94.56% <100.00%> (ø)
src/segment-loader.js 96.36% <100.00%> (-0.01%) ⬇️
src/videojs-http-streaming.js 90.46% <100.00%> (+0.05%) ⬆️
src/decrypter-worker.js 84.73% <0.00%> (-0.64%) ⬇️
src/util/container-request.js 82.85% <0.00%> (-0.48%) ⬇️
src/transmuxer-worker.js 73.54% <0.00%> (-0.25%) ⬇️
... and 5 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -398,9 +398,9 @@
vhs: {
Copy link
Member

Choose a reason for hiding this comment

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

I removed this entire file in #1308

@@ -597,6 +597,7 @@ class VhsHandler extends Component {
this.options_.customTagParsers = this.options_.customTagParsers || [];
this.options_.customTagMappers = this.options_.customTagMappers || [];
this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
this.options_.llhls = Boolean(this.options_.llhls);
Copy link
Member

Choose a reason for hiding this comment

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

I could be wrong, but this would still default to false, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Member

Choose a reason for hiding this comment

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

I think we want it to default to true, though. Maybe something like this?

Suggested change
this.options_.llhls = Boolean(this.options_.llhls);
this.options_.llhls = this.options_.hasOwnProperty('llhls') ? this.options_.llhls : true;

@@ -641,11 +642,11 @@ class VhsHandler extends Component {
'initialPlaylistSelector',
'experimentalBufferBasedABR',
Copy link
Member

Choose a reason for hiding this comment

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

Also, we do want to rename this to bufferBasedABR - but leave it defaulting to false for the time being.

@kchang-brightcove kchang-brightcove force-pushed the wp-529-remove-experimental-options branch from c99b0ca to d6d4ed1 Compare August 16, 2022 20:46
Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

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

The netlify preview is broken. Also, I noticed that fields in the "Options" tabs still say "[EXPERIMENTAL]".

scripts/index.js Outdated
[
'exact-manifest-timings',
'pixel-diff-selector',
'bufferBasedABR'
Copy link
Member

Choose a reason for hiding this comment

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

This is throwing an error on the Netlify preview build:

Suggested change
'bufferBasedABR'
'buffer-water'

@@ -597,6 +597,7 @@ class VhsHandler extends Component {
this.options_.customTagParsers = this.options_.customTagParsers || [];
this.options_.customTagMappers = this.options_.customTagMappers || [];
this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
this.options_.llhls = Boolean(this.options_.llhls);
Copy link
Member

Choose a reason for hiding this comment

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

I think we want it to default to true, though. Maybe something like this?

Suggested change
this.options_.llhls = Boolean(this.options_.llhls);
this.options_.llhls = this.options_.hasOwnProperty('llhls') ? this.options_.llhls : true;

@kchang-brightcove kchang-brightcove force-pushed the wp-529-remove-experimental-options branch from d6d4ed1 to 4b1d2a3 Compare August 18, 2022 17:06
@@ -597,6 +597,7 @@ class VhsHandler extends Component {
this.options_.customTagParsers = this.options_.customTagParsers || [];
this.options_.customTagMappers = this.options_.customTagMappers || [];
this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
this.options_.llhls = this.options_.llhls === false ? false : true;
Copy link
Member

Choose a reason for hiding this comment

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

Coming back to this, Kevin has restored the previous state:

this.options_.llhls === false ? false : true

This is because simply doing Boolean(this.options_.llhls) was not defaulting to true, which is what was wanted.

@misteroneill misteroneill merged commit 02c3c77 into next Aug 19, 2022
@misteroneill misteroneill deleted the wp-529-remove-experimental-options branch August 19, 2022 14:19
@welcome
Copy link

welcome bot commented Aug 19, 2022

Congrats on merging your first pull request! 🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants