-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(player): add playedPercent and playedRanges helpers
Add two helper functions based on the `played` function native to the `HTMLMediaElement`: - `playedRanges` returns an array representing the start and end times of the played portions of a media. This could make it easier to calculate the effective playback duration of a media, without having to use a complex mechanism for listening to the seeking/seeked events. - `playedPercent` returns the effective percentage played of a media as a decimal between `0` and `1`. - add `playedPercent` and `playedRanges` functions to the `player` component - add test coverage
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters