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

Extend createTimeRange to enable creation of TimeRanges with multiple ranges #2604

Closed
wants to merge 3 commits into from

Conversation

imbcmdth
Copy link
Member

No checks are performed to ensure that the resulting TimeRanges-like object is "normalized" as the spec requires.

Supports not passing an argument to start and end and returns the first range for backward compatibility.

Throws an error with Chrome's error message if start or end is passed an index that is outside the supported ranges.

};
}

function getRange(fnName, valueIndex, ranges, rangeIndex){
if (rangeIndex === undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

No args here actually throws an error with native timeranges. If we want them to be interchangeable we probably shouldn't let people do this.

Copy link
Member

Choose a reason for hiding this comment

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

Just saw the note about backward compatibility. Now I'm on the fence.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could add a deprecation warning to the no-index case.

Copy link
Member

Choose a reason for hiding this comment

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

That would be ok with me. Do we actually use it in that way anywhere? If we are then either way we'd have to update those uses.

Copy link
Member

Choose a reason for hiding this comment

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

This one's still unresolved. Are we punting on it? @imbcmdth

Copy link
Member Author

Choose a reason for hiding this comment

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

@heff I added the deprecation warning, none of our plugins use the no-index style but we can't be sure that no one else has. I'd rather we provide a clear indication that we intend to remove that "feature" in the near future.

@pam
Copy link

pam commented Sep 16, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 46117a1
Build details: https://travis-ci.org/pam/video.js/builds/80735336

(Please note that this is a fully automated comment.)

@heff
Copy link
Member

heff commented Sep 16, 2015

Looks good so far. We'll need to update the video.js file and export both naming versions on the videojs object also. And now that I see it here we could probably just do the aliasing in the video.js file, instead of in the time-ranges.js file, but up to you.

@pam
Copy link

pam commented Sep 16, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 7c3e1e0a8a18029424f3f54868967e406691fe93
Build details: https://travis-ci.org/pam/video.js/builds/80734903

(Please note that this is a fully automated comment.)

@imbcmdth
Copy link
Member Author

That would require changes everywhere createTimeRange is currently used (about half a dozen or so files.) I was trying to make as minor a change as possible so close to the milestone but I can do that if you deem it as necessary.

@heff
Copy link
Member

heff commented Sep 17, 2015

That would require changes everywhere

Exporting it on the videojs object would require that? I just mean having both videojs.createTimeRange and videojs.createTimeRanges
https://github.com/videojs/video.js/blob/master/src/js/video.js#L382

@imbcmdth
Copy link
Member Author

I meant that:

we cold probably just do the aliasing in the video.js file, instead of in the time-ranges.js file

Would require changes everywhere that createTimeRange is used via an import statement.

@pam
Copy link

pam commented Sep 17, 2015

Ahh, I see. Ok.

Sent from mobile

@imbcmdth
Copy link
Member Author

@heff Added the new createTimeRanges function and alias to the videojs object.

@pam
Copy link

pam commented Sep 18, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: d7b7baa
Build details: https://travis-ci.org/pam/video.js/builds/80937622

(Please note that this is a fully automated comment.)

@heff heff added this to the v5.0.0 milestone Sep 18, 2015
@pam
Copy link

pam commented Sep 21, 2015

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: eefb775
Build details: https://travis-ci.org/pam/video.js/builds/81466427

(Please note that this is a fully automated comment.)

@heff
Copy link
Member

heff commented Sep 21, 2015

lgtm!

@heff heff closed this in 24ad984 Sep 21, 2015
@imbcmdth imbcmdth deleted the multiple-timeranges branch September 21, 2015 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants