PWA offline video audio Uploader and viewer

0
Hello All,   I tried with file uploader and file dropper but both are failing with PWA online and offline file uploading and viewing functionality. it should be compatible for IOS and android mobile devices. Can anyone suggest which widget or what method will be able to achieve this feature?    Image uploader and viewer is working with file uploader and image viewer widgets. It is working fine.   Please if anyone know how can we do this for AUDIO and VIDEO upload - saving & sync it with Mendix DB, retrieve and view the saved info as admin role?     Thanks in Advance!
asked
1 answers
2

Hi Aarthi, 

 

What Works in PWA with Mendix:

  • Image upload & viewer – Confirmed working.

  • Standard file uploads – Have limitations especially in offline PWAs, and for binary files like audio/video.

Recommended Approach:

  1. Use a JavaScript Action to access the device's file system via <input type="file">  and convert the selected file (audio/video) to Base64.

  2. Store the file temporarily in a non-persistable entity with attributes: FileName, MimeType, Base64String, Type (Audio/Video).

  3. When back online, use a Nanoflow + Microflow to:

    • Decode the Base64 string.

    • Save it as a FileDocument or a custom entity (e.g.,VideoFile)  inheriting from FileDocument).

    • Commit it to the Mendix DB.

  4. For playback, use HTML5 <audio> or <video> tags or relevant widgets to stream the file (admins only).

Helpful Tools:

  • Base64 File Handling Module

  • JavaScript Action (FileReader API)

  • HTMLSnippet or Video/Audio Player widgets

This method ensures compatibility with offline PWAs, including iOS Safari limitations.

 

I hope this one helps you! :)

answered