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(time-ranges): make iteratable if Symbol.iterator exists #7330

Merged
merged 2 commits into from
Jul 27, 2021

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Jul 19, 2021

This allows us to call Array.from() on TimeRange objects created by Video.js. For example:

var input = [[0, 10], [20, 30]];
var timeRangeObj = videojs.createTimeRanges(input);
var output = Array.from(timeRangeObj);
assert.deepEqual(input, output, "they're the same!");

@codecov
Copy link

codecov bot commented Jul 19, 2021

Codecov Report

Merging #7330 (f291a11) into main (bba6e17) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7330      +/-   ##
==========================================
+ Coverage   79.53%   79.62%   +0.09%     
==========================================
  Files         115      115              
  Lines        7270     7263       -7     
  Branches     1747     1746       -1     
==========================================
+ Hits         5782     5783       +1     
+ Misses       1488     1480       -8     
Impacted Files Coverage Δ
src/js/utils/time-ranges.js 76.00% <100.00%> (+3.27%) ⬆️
src/js/player.js 87.13% <0.00%> (+0.11%) ⬆️
src/js/utils/url.js 78.04% <0.00%> (+8.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bba6e17...f291a11. Read the comment docs.

@gkatsev gkatsev changed the title feat(time-ranges): make iteratable if Symbo.iterator exists feat(time-ranges): make iteratable if Symbol.iterator exists Jul 20, 2021
Copy link
Contributor

@brandonocasey brandonocasey left a comment

Choose a reason for hiding this comment

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

seems good to me, could use a test though.

@gkatsev gkatsev merged commit ad9546c into videojs:main Jul 27, 2021
@gkatsev gkatsev deleted the timeranges-iterator branch July 27, 2021 16:33
edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
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.

2 participants