Hello,
Generally you use an insert
with the source
parameter set to picker
to display items picked by the picker
layer.
When the insert
layer creates the layers that correspond to a picker
layer the app automatically generates data that can be accessed via dataKey
inside the layout of the insert
layer.
The generated data differs depending on the file type that was picked.
The data that is equal across all file is looks like this:
name
: Allows a layer to use the files name as its value.
uri
: The URL of the file on disk - used to display the item using a layers value.
deleteAction
: Array containing a single deletePickerItem
action
For audio files the data also contains the following keys:
duration
: Duration of the audio file usable as a layers value.
playing
: Contains a layer condition indicating wether or not the this item is currently playing.
playAction
: Actions-array containing a single playAudio
action for this item.
stopAction
: Actions-array containing a single playAudio
action for this item
Accessing the name
for example can be achieved like this in the inserts layout:
{
"type": "text",
"dataKey": "name"
}
The text
layer will use the generated name as its value. The generated data acts the same as a template.
Displaying different picked items in the same insert is unfortunately tricky because you cant differentiate between the different types and only have the data from above available to use.
Regards