6.0.0 • Published 10 months ago

@hanhokim/capacitor-device-media v6.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@hanhokim/capacitor-device-media

Device medias from capacitor. For internal project usage

Install

npm install @hanhokim/capacitor-device-media
npx cap sync

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>
ParamType
options{ value: string; }

Returns: Promise<{ value: string; }>


getThumbnails(...)

getThumbnails(options?: ThumbnailFetchOptions | undefined) => Promise<ThumbnailResponse | undefined>
ParamType
optionsThumbnailFetchOptions

Returns: Promise<ThumbnailResponse>


getMedia(...)

getMedia(options?: MediaFetchOptions | undefined) => Promise<MediaResponse | undefined>
ParamType
optionsMediaFetchOptions

Returns: Promise<MediaResponse>


getAlbums()

getAlbums() => Promise<MediaAlbumResponse | undefined>

Returns: Promise<MediaAlbumResponse>


addListener('mediaDidChanged', ...)

addListener(eventName: 'mediaDidChanged', listenerFunc: (event: any) => void) => Promise<PluginListenerHandle>
ParamType
eventName'mediaDidChanged'
listenerFunc(event: any) => void

Returns: Promise<PluginListenerHandle>


Interfaces

ThumbnailResponse

PropType
mediasMediaAsset[]

MediaAsset

PropTypeDescription
identifierstringPlatform-specific identifier
dataMediaDataData for a media : url or base64
mediaTypestringData for a mediaType : image or video
mediaSubtypestringData for a mediaSubtype such as png, mp4
fileSizenumberData for a filesize as Byte
creationDatestringISO date string for creation date of asset
fullWidthnumberFull width of original asset
fullHeightnumberFull height of original asset
thumbnailWidthnumberWidth of thumbnail preview
thumbnailHeightnumberHeight of thumbnail preview
durationanyDuration of media

MediaData

PropType
base64string
urlstring

ThumbnailFetchOptions

PropTypeDescription
quantitynumberThe number of photos to fetch, sorted by last created date descending
thumbnailWidthnumberThe width of thumbnail to return
thumbnailHeightnumberThe height of thumbnail to return
thumbnailQualitynumberThe quality of thumbnail to return as JPEG (0-100)
typesstringWhich types of assets to return (photos or videos or all)
albumIdentifierstringWhich album identifier to query in (get identifier with getAlbums())
startnumberThe start index of photos to fetch (for pagination)

MediaResponse

PropType
mediasMediaAsset[]

MediaFetchOptions

PropTypeDescription
mediaIdentifierstringWhich media to query (only using for getMedia())

MediaAlbumResponse

PropType
albumsMediaAlbum[]

MediaAlbum

PropType
identifierstring
titlestring
count{ total?: number; photos?: number; videos?: number; }
thumbnail{ base64?: string; base64Raw?: string; }
type'smart' | 'shared' | 'user' | 'unfiltered'

PluginListenerHandle

PropType
remove() => Promise<void>
6.0.0

10 months ago

5.0.0

2 years ago

1.0.2

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

0.0.1

2 years ago