-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Disable size limit when uploading videos for a Jetpack site with VideoPress #11090
Conversation
@donnapep: Looks pretty awesome. One thing that occurred to me after reading through the code is that we should also verify that the Jetpack version is >= 4.5, which is the release that enabled this type of uploading. Great work otherwise! |
@dbtlr You got it. I've added a commit for the Jetpack version check. Thx! |
@aduth Mind giving a quick review of this one? Thx! |
client/lib/media/utils.js
Outdated
return null; | ||
} | ||
|
||
if ( site.jetpack && site.isModuleActive( 'videopress' ) && versionCompare( site.options.jetpack_version, '4.5', '>=' ) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few notes:
- I'm not really familiar with
isSupportedFileTypeInPremium
. Is that enough to ensure that the file is a video, or at the very least one which can ignore file size limits? - When splitting condition on multiple lines, we should indent following lines (related guideline)
- The
JetpackSite
prototype has aversionCompare
method you can use as a convenience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx! Fixed the last two and finding out about the first. Cheers.
@donnapep: As I mentioned in my previous comment, that function is not going to be good enough, because we have to limit to videos. This function will allow other file types too that are not currently supported in this way. We need something that checks the filesize AND that the file is mimetype video/*. Until Jetpack starts doing uploads to wpcom for the other file types, photos and such still need to be under the server filesize limit. |
@dbtlr Sorry, missed that. The latest commit does the mime type check. Thx! |
LGTM! |
Ignore the maximum file upload size limitation when uploading a video for a VideoPress-enabled Jetpack site.
cc @dbtlr