Media Capture
Media capture is performed client-side using the following methods:
await skylight.startPhotoCapture()
await skylight.startVideoCapture()
When calling the
startPhotoCapture
method, there are several parameters in the configuration object that is passed in. These include:delay
: The number of seconds until a photo is automatically captured from when the capture screen launches. This is currently unsupported by the web client preview tool.properties
: This is a dictionary of key-value pairs that is added to the captured media object. This is accessible when working with captured media objects from theskylight.session.media
array.labels
: This is a list of strings that is added to the media object of the photo that is captured by thisstartPhotoCapture
call. This list is used in futurestartPhotoCapture
calls by thegalleryFilter
parameter, described below.galleryFilter
: This is a list of strings used to determine which previously-captured photos are shown in the gallery that appears when thisstartPhotoCapture
is called. Specifically, if any of the strings in thisgalleryFilter
list matches any of thelabels
of a previously-captured photo, then that photo will appear in the gallery.
As a rule of thumb, it's reasonable to set
labels
and galleryFilter
to the same list of strings for a given startPhotoCapture
call.
When calling the
startVideoCapture
method, there are several parameters in the configuration object that is passed in. These include:properties
: This is a dictionary of key-value pairs that is added to the captured media object. This is accessible when working with captured media objects from theskylight.session.media
array.labels
: This is a list of strings that is added to the media object of the video that is captured by thisstartVideoCapture
call. This list is used in futurestartVideoCapture
calls by thegalleryFilter
parameter, described below.galleryFilter
: This is a list of strings used to determine which previously-captured videos are shown in the gallery that appears when thisstartVideoCapture
is called. Specifically, if any of the strings in thisgalleryFilter
list matches any of thelabels
of a previously-captured video, then that video will appear in the gallery.
Last modified 2yr ago