jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

VideoPress: expose allowed mime types of the site to the client

Open retrofox opened this issue 3 years ago • 2 comments

Probably, we can get the allowed mime types by using get_allowed_mime_types() core function and expose it in the Initial state global var.

retrofox avatar Sep 27 '22 11:09 retrofox

Today we have a fixed array of allowed video formats here: https://github.com/Automattic/jetpack/blob/trunk/projects/packages/videopress/src/client/state/constants.js#L31

We need to use the get_allowed_mime_types() to get this list of extensions from a better (and more maintanable) source of true.

lhkowalski avatar Sep 29 '22 16:09 lhkowalski

get_allowed_mime_types() returns a list of extensions and associated mime types (ref).

To get a list of possible video extensions, what we need to do is fetch all of them and filter for the video/* mimes.

lhkowalski avatar Sep 29 '22 17:09 lhkowalski