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(core): add preload configuration option for media files #1958

Merged
merged 18 commits into from Jan 10, 2020

Conversation

jeeyyy
Copy link
Contributor

@jeeyyy jeeyyy commented Dec 20, 2019

This PR adds an additional type 'media' to the preload configuration.
The intention of this configuration is to await running some rules which requires some metadata from HTMLMediaElement to run checks.

An example of one such rule would be no-autoplay-audio, which relies on duration property of a media file.

Closes issue:

  • NA

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@jeeyyy jeeyyy requested a review from a team as a code owner December 20, 2019 14:19
@jeeyyy jeeyyy changed the title feat(core): add media metadata loading as a preload configuration feat(core): add preload configuration option for media files Dec 20, 2019
lib/core/utils/preload-media.js Outdated Show resolved Hide resolved
lib/core/utils/preload-media.js Show resolved Hide resolved
lib/core/utils/preload.js Show resolved Hide resolved
test/core/utils/preload-media.js Outdated Show resolved Hide resolved
test/core/utils/preload-media.js Outdated Show resolved Hide resolved
test/core/utils/preload-media.js Outdated Show resolved Hide resolved
test/core/utils/preload-media.js Show resolved Hide resolved
WilcoFiers
WilcoFiers previously approved these changes Jan 10, 2020
treeRoot,
'video, audio'
);
if (!mediaVirtualNodes || !mediaVirtualNodes.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is statement can be removed. mediaVirtualNodes is will always be an array, and an empty array will work fine with your map function. Promise.all will resolve.

@jeeyyy jeeyyy merged commit 8a62649 into develop Jan 10, 2020
@jeeyyy jeeyyy deleted the add-preload-media branch January 10, 2020 15:09
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.

None yet

2 participants