Comment to 'Developer Question: BxTemplUploaderRecordVideo'
  • Most of that code had been created/written a few years ago. You as a dev should know that in such a case it requires quite some time to recall what and how works there under the hood. :)

    Anyway answering your question, I think the best approach would be to do a server side check rather than a client side.

    At the BxBaseUploaderRecordVideo::handleUploads method the $mixedFiles param is actually what you're looking for - it is the $_FILES['file'] array. So you could try to use a call to

    $iDuration = BxDolTranscoderVideo::getDuration($mixedFiles['tmp_name']);
    

    And then in case it exceeds the desired limit then prevent the call to parent::handleUploads and add your error message to

    $this->_sUploadErrorMessages
    
    • Um, thanks for the reply, but you must not have read my discussion at all, as I already found I can not pull from the files array because recordings (WebRTC) is sent back to the server as a blob. So, the normal files array are all null. All are empty.

      So, I moved on to checking it at form submit. Yet, I can't find any documentation or even a hint of how I do the check at submission.

      And, as a developer, it should not mean I have to read code, figure out hooks, figure out what classes to extend and what functions to override, without documentation. Otherwise, I'm trying to build an engine from a million parts without a schematic. Yes, I'll eventually get it, but if only I had t schematic. I hope you understand my parable.

      • The camera recordings are not sent via WebRTC, they are sent as a blob data via an AJAX request and in the end are treated as a regular $_FILES param (in a different variable though). So just try the solution I've provided above. Check the $mixedFiles['tmp_name'] as I suggested - this is the recorded file to be processed.