Open
Conversation
- Make job type detection DRY - Use job_type to update file format to audio - Add job_type to fluent forms - Update gravity forms to use custom functions - Update ninja forms to use custom functions
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect MIME types being sent to GoDAM Central for audio recordings submitted via supported form plugins, ensuring audio container uploads (e.g., .webm, .mp4) are treated as audio when the transcoding job_type is audio.
Changes:
- Added a shared
godam_get_job_type()helper to consistently determinejob_type(audiovsstream) across form integrations. - Updated multiple form integrations to use the shared job type helper instead of duplicating file-type detection logic.
- Adjusted
rtgodam_send_video_to_godam_for_transcoding()to correctmime_typefromvideo/*toaudio/*whenjob_typeisaudio.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
inc/helpers/custom-functions.php |
Adds godam_get_job_type() and fixes MIME type mapping for audio jobs when WordPress detects a video/* container MIME. |
inc/classes/wpforms/class-wpforms-integration.php |
Uses shared job-type detection when sending recorded files for transcoding. |
inc/classes/sureforms/class-form-submit.php |
Uses shared job-type detection before calling transcoding helper. |
inc/classes/ninja-forms/class-ninja-forms-field-godam-recorder.php |
Replaces custom MIME/extension logic with shared job-type detection and passes it through consistently. |
inc/classes/gravity-forms/class-init.php |
Determines job type per-file (including multi-file) via shared helper before transcoding. |
inc/classes/gravity-forms/class-gf-field-godam-video.php |
Simplifies audio/video detection by using godam_is_audio_file() for audio determination. |
inc/classes/fluentforms/class-form-submit.php |
Computes and passes job_type to transcoding call (previously relied on default). |
inc/classes/everest-forms/class-everest-forms-integration.php |
Uses shared job-type detection before sending for transcoding. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #1531
This PR fixes audio files recorded from form plugins being stored as
video/webminstead of proper audio MIME types on GoDAM Central.When audio files (.webm, .mp4) were uploaded via form recorders, the transcoding API was receiving
job_type: "audio"butmime_type: "video/webm"which was incorrect. This was happening becausewp_check_filetype()returnsvideo/webmfor container formats like.webm,.mp4etc., that can hold both audio and video.To fix this modified
rtgodam_send_video_to_godam_for_transcoding()to set mimetype toaudio/****whenjob_typeis "audio"Testing Instructions
Test Case 1: Audio Recording
Test Case 2: Video Recording (Regression)
Note: I tested with Edge, Chrome, Firefox and Safari to make sure all browser formats are working correctly.
Screenshots
Minor Additional Changes
Added some minor additional fixes which are not directly related to the issue #1531:
Start Recordinginstead ofRecord Videoto match other forms (haven't updated the same for Fluent Forms in this PR because that will be done by PR #1204)Note: Fluent Form was tested by using changes from PR #1204.