java.lang.Object | |
↳ | co.megacool.megacool.RecordingConfig |
RecordingConfigs help you customize how the recording is done and how it's finalized to something that can be shared.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RecordingConfig()
Create new RecordingConfig.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RecordingConfig |
frameRate(int frameRate)
How often new frames should be recorded, in frames per second.
| ||||||||||
int |
getFrameRate()
Get the recording's capture frame rate, in frames per second.
| ||||||||||
int |
getLastFrameDelay()
Get the recording's last frame delay, in milliseconds.
| ||||||||||
int |
getLastFrameOverlay()
Get the recording's last frame overlay drawable.
| ||||||||||
String |
getLastFrameOverlayAsset()
Get the recording's last frame overlay asset.
| ||||||||||
int |
getMaxFrames()
Get the recording's max length in frames.
| ||||||||||
OverflowStrategy |
getOverflowStrategy()
Get the recording's overflow strategy.
| ||||||||||
double |
getPeakLocation()
Get the recording's peak location.
| ||||||||||
int |
getPlaybackFrameRate()
Get the recording's playback frame rate, in frames per second.
| ||||||||||
String |
getRecordingId()
Get the recording's identifier.
| ||||||||||
RecordingConfig |
id(String id)
Set an identifier for a recording, to be able to preview or share it again later.
| ||||||||||
RecordingConfig |
lastFrameDelay(int delay)
Set how long to pause the GIF on the last frame, in ms.
| ||||||||||
RecordingConfig |
lastFrameOverlay(int lastFrameOverlay)
Set the image that will be overlayed on the last frame of the gif
| ||||||||||
RecordingConfig |
lastFrameOverlayAsset(String lastFrameOverlayAsset)
Set the image that will be overlayed on the last frame of the gif
| ||||||||||
RecordingConfig |
maxFrames(int maxFrames)
Set the max number of frames in a recording.
| ||||||||||
RecordingConfig |
overflowStrategy(OverflowStrategy overflowStrategy)
Define how recordings longer than the specified max frames should be compressed.
| ||||||||||
RecordingConfig |
peakLocation(double peakLocation)
Set the location of the highest point scored in a highlight recording.
| ||||||||||
RecordingConfig |
playbackFrameRate(int playbackFrameRate)
The frame rate the recording will be played back in.
| ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create new RecordingConfig.
Globals modified after instantiating a RecordingConfig has no effect on the given RecordingConfig.
How often new frames should be recorded, in frames per second.
This is only relevant when you use startRecording(View, RecordingConfig)
,
as when you use captureFrame(View, RecordingConfig)
the frames will be
captured in the rate you call captureFrame
.
The upper limit here will be restricted by how fast captures can occur on the given device, if set too high we'll just capture as many frames per second as possible, and you'll see highly variable results between devices. You probably shouldn't set this higher than 15-20 to avoid too much performance impact from the recording.
Calling this method will automatically update the playback frame rate to be 20% more than
the value passed in for frameRate
, unless you've previously called
playbackFrameRate(int)
frameRate | how frames to capture per second |
---|
Get the recording's capture frame rate, in frames per second.
Get the recording's last frame delay, in milliseconds.
Get the recording's last frame overlay drawable.
Get the recording's last frame overlay asset.
Get the recording's max length in frames.
Get the recording's overflow strategy.
Get the recording's peak location.
Get the recording's playback frame rate, in frames per second.
Get the recording's identifier.
Set an identifier for a recording, to be able to preview or share it again later. To be
able to store multiple completed recordings on disk you must also remember to set
setKeepCompletedRecordings(boolean)
to true.
id | the recording identifier |
---|
Set how long to pause the GIF on the last frame, in ms. Must be a non-negative integer, default is 1000.
If you pass 0, the delay will be the same as the other frames.
delay | how long to pause on the last frame |
---|
Set the image that will be overlayed on the last frame of the gif
lastFrameOverlay | the image to overlay |
---|
Set the image that will be overlayed on the last frame of the gif
lastFrameOverlayAsset | the name of the asset with the last frame overlay image |
---|
Set the max number of frames in a recording. Must be larger than 2.
If the overflow strategy is set to TIMELAPSE
, the resulting GIF
might have a frame count between 1.33x and 0.66x what is set as max.
maxFrames | the max number of frames |
---|
Define how recordings longer than the specified max frames should be compressed.
overflowStrategy | the overflow strategy |
---|
Set the location of the highest point scored in a highlight recording. Must be between 0 and 1, the default is set at 0.7. This value determines how much of the highlight should be leading up to the maximum point. For example, a setting of 0.7 with a max frames setting of 10, means that there will be six frames leading up to the 7th frame with maximum point value, and three frames with lesser point value afterwards. A 0 value means the maximum point value occurs at the very beginning, and a 1 value means it occurs at the end. and
peakLocation | how many frames within the highlightRecording window/maxFrames to automatically include before the highlight |
---|
The frame rate the recording will be played back in. Should be identical to the recording
frame rate set with frameRate(int)
to play back in real time, set higher to speed up the
recording or lower to slow it down. The max is 100fps, but you're unlikely to see browser
play it back at that rate, thus you should keep the rate in the 5-25 range to stay sane.
playbackFrameRate | the playback frame rate, as frames per second |
---|