services library

Service interfaces behind the story creator, for replacing platform services (simulated camera, test fakes). Pass a StoryServices to StoryCreator.open.

Classes

CaptureCapabilities
What the current camera can do.
CapturedFile
A file produced by the camera.
CaptureEvent
Something that happened to the camera session outside a direct call.
CaptureFailed
The camera failed irrecoverably.
CaptureInterrupted
The session stopped (backgrounded, a call, another app took the camera, camera disconnected). The service must be initialised again.
CaptureService
Camera access.
DrawingStroke
A freehand stroke.
EmojiOverlay
An emoji, drawn with the platform emoji font.
ExportContext
Inputs an export needs besides the document.
ExportedStory
An exported file, before the flow turns it into a StoryResult.
ExportJob
A running export.
GalleryAlbum
An album (collection) of the photo library.
GalleryAsset
A photo or video in the library.
GallerySaver
Writes finished stories to the device gallery.
GallerySource
Access to existing photos and videos.
MediaInspector
Native media inspection helpers.
MediaPlacement
How the media sits on the 1080×1920 canvas.
MediaProbe
Facts about a local media file, read natively.
MusicSelection
Music chosen for the story.
MusicSession
Plays music for preview in the picker, the segment selector and the editor. One instance per screen that plays music.
OverlayTransform
Position, scale and rotation of an overlay on the canvas.
PermissionService
Camera and microphone permissions. Photo library access is part of GallerySource.
PickedMedia
A picked item available as a local file.
SessionFiles
Working directory of one story session.
StickerOverlay
A host-supplied sticker image.
StoryBackground
Canvas background behind media that does not fill the canvas: a vertical gradient from top to bottom.
StoryDocument
Every edit of one story. Immutable; the editor replaces it on each change and keeps snapshots for undo/redo.
StoryExporter
Renders a StoryDocument into a JPEG or MP4.
StoryMedia
The source photo or video being edited.
StoryOverlay
Something placed on top of the media: text, a sticker or an emoji.
StoryPaintResources
Everything the painters need that is not in the StoryDocument: fonts by id, decoded sticker images by id and filters by id.
StoryServices
The platform services the story creator uses.
StrokePoint
One sampled point of a stroke, in canvas units.
TextOverlay
A text overlay.
TextOverlayStyle
Style of a text overlay.
TrimRange
The part of the source video that is kept.
VideoPlaybackState
Snapshot of a video player.
VideoSession
Plays the source video in the editor.

Enums

GalleryAccess
Photo library access state.
PermissionState
State of a runtime permission.
StoryFlashMode
Flash behaviour for photos. Videos use the torch when on.
StrokeTool
Brush kinds.
TextBackgroundStyle
How the text background is drawn.

Typedefs

CaptureServiceFactory = CaptureService Function()
Creates a CaptureService; called each time the camera screen opens.
MusicSessionFactory = MusicSession Function()
Creates a MusicSession.
VideoSessionFactory = VideoSession Function()
Creates a VideoSession.

Exceptions / Errors

ExportCancelledException
Thrown by ExportJob.result when the job was cancelled.