Skip to content

Instantly share code, notes, and snippets.

@robcmills
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robcmills/d53877c98007a6572e94 to your computer and use it in GitHub Desktop.
Save robcmills/d53877c98007a6572e94 to your computer and use it in GitHub Desktop.
Go Game Custom Forge Camera Module API Specification

GoGame Custom Forge Video Module Specification

V-0.3

Author: rob@thegogame.com

forge.gg.getVideo([options], success, error) iOS

Parameters:

options: object of key-value pairs

success: function(file) callback to be invoked when no errors occur (argument is the returned file)

error: function(object) called with details of any error which may occur

Important: On iOS devices, the first time your app reads from the gallery, the user will be prompted to allow the app to access your location. This is because the EXIF data in files stored there could be used to infer a user's geolocation. For more information, see modules-file-permissions.

The options object:

maxLength: integer, default=30 Video duration must be limited to the given length in seconds

quality: string, default='med' Overall quality of video compression. Possible values are 'low', 'med', or 'high'

useCompression: boolean, default=true If false, no compression occurs

usePauseRecord: boolean, default=false If true, enable pause-record feature

Description

Upon invocation this method presents the user with a video capture environment. The user must not be able to choose an existing video from the phone.

Recording

The user can record a video of length less than or equal to a max specified in the options parameter or default value. If the user records up to the limit, the app must automatically end recording so as to not exceed the limit. The max length should be prominently displayed with a countdown that makes it clear to the user how much recording time is left.

Pause-Record and Hold-to-Record Feature (optional)

If enabled, the user must hold down the record button to continue recording. If the user releases the record button, recording is paused. Recording can then be resumed multiple times by pressing and holding record button. If enabled the app must provide an additional 'STOP' button to end recording and enter 'REVIEW' stage.

Compressing

As soon as recording is complete the app should begin compressing the recorded video in the background if compression is enabled. The app should display a subtle progress bar showing the compression progress. This compression process must be abortable if the user decides to discard and retake a new recording.

Force Review

After recording the app must present the user with a prominent button labeled "REVIEW". No other options are present. The app must force users to review the recorded video. The app should not begin review playback until the user has tapped the "REVIEW" button.

Reviewed

After the forced review the app should present the user with the choice to "ACCEPT" or "DISCARD & RETAKE" If the user chooses "DISCARD & RETAKE", the app must immediately abort the compression process and send the user back to the recording environment. If the user chooses "ACCEPT", the app should finish the compression process, save the video to the phone's gallery, then convert the compressed video file into a javascript file object and return it to the supplied success function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment