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

Dynamic video size limitation for chunkuploader settings #409

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ferishili
Copy link
Contributor

@ferishili ferishili commented Dec 20, 2024

This PR fixes #376,

Description

currently it is only possible to select from a range of predefined video size limits, that are not so comprehensive!
For example there is a huge gap of missing sizes between 5GB and 10GB which admins are not able to select.

How it works

  • We now have a so called block of settings for this matter namely "Video size limit in chunkuploader settings section" as follow:
    • A new setting (as a dropdown with the name of "Video file size limitation mode") has been introduced to decide whether it has to be unlimited or limited file sizes for uploading videos with 2 options:
  1. "Unlimited video Size" => no limit for the chunkuploads in the upload file forms

Screenshot 2024-12-20 at 13 27 21

  1. "Limited video size" => the file size is going to be limited, when this option is selected, the "Video size limit" config setting will be provided to admins to set the limit size based on their likings.

Screenshot 2024-12-20 at 13 27 13

  • The old setting called "Video size limit" has now been changed in these ways:
    • The setting type is now filesize type and not a dropdown anymore! by filesize type you can now enter any dynamic values with the respected size unit (e.g. MB, GB etc.) so you are not limited to a range of predefined values anymore!
    • This option is now depending on the value selected as "Limited video size" in "Video file size limitation mode"

How to TEST

  • Make sure you have chunupload plugin installed: https://moodle.org/plugins/local_chunkupload
  • You need a course with an already configured Opencast Block in it.
  • Patch this PR (NOTE: there is a mandatory upgrade (new version), because an upgrade step is introduced see: NOTES SECTION)
  • Go to admin setting of Opencast videos (this) plugin > Additional Features > Settings for the chunkuploader
  • Make sure "Enable Chunkupload" is checked to use Chunkuploader.
  • Make sure to change the newly introduced settings with different values e.g. limited with different limit sizes or unlimited.
  • Save changes every time you configure the settings.
  • Go to the course with Opencast block and then go to "Add video" page, and check the "Maximum file size" on top right corner of the chunkuploader blocks. see screenshot:

Screenshot 2024-12-20 at 13 38 51

  • Go ahead and upload some videos greater that the Maximum file size, and check the result!
  • Go ahead and repeat the above steps with different settings!

NOTES:

  • As to introduce an upgrade step in /db/upgrade.php file and for the sake of testing etc. I had to increase the version of the plugin to 2024111103. Therefore, be advised to take care of this on your test env later on when you switch branches etc.
  • This new versioning as well as upgrade_block_savepoint must be taken care of after/during the merge of this PR.

@ferishili ferishili requested a review from bluetom December 20, 2024 12:45
@ferishili ferishili self-assigned this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting uploadfilelimit_x should be continous not selection
2 participants