robby1066 / keepposted-help

Documentation, Issue Tracker, and Repository of Knowledge For Keep Posted (www.keepposted.io) — A way to keep teams informed and connected without disrupting their focus.
https://www.keepposted.io
1 stars 0 forks source link

Allow uploads from iOS via the camera roll #14

Closed robby1066 closed 3 years ago

robby1066 commented 3 years ago

Area affected

Message creation

What's the problem

Mobile Safari doesn't support the APIs needed to record directly through the browser. But there is potentially another way to support iOS, using two attributes on a normal html file upload control.

the capture attribute

the accepts attribute

The capture attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute.

Description of feature

The new feature would add an alternate input that would be available to browsers than cannot use the browser-based apis to capture video from the web cam.

Alternatives and workarounds

Right now mobile safari users cannot record videos for keep posted from their iOS devices. They have to use a desktop computer with a supported browser.

robby1066 commented 3 years ago

Uploading a video via iOS and a normal HTML file input with capture and accept attributes correctly configured works well, except the duration of the video is not captured by the submission. This causes the table of contents to completely break and not be displayed.

A possible workaround here (which may have benefits in other places) is to install FFMpeg on the server and attempt to analyze the video upon upload. FFmpeg has had some issues with videos recorded through the browser, as the proper duration metadata is not sent along with the video stream. This is a patchwork approach (capturing duration via javascript everywhere except iOS, then using ffmpeg on the server for iOS), but it could provide decent coverage.

robby1066 commented 3 years ago

After installing FFMpeg, durations appear to be correctly captured from uploaded iOS videos. A test on desktop, android, and iOS correctly rendered the table of contents. Calling this one complete!