An open API service indexing awesome lists of open source software.

https://github.com/numbersprotocol/preview-video


https://github.com/numbersprotocol/preview-video

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          

# @numbersprotocol/preview-video

Preview Video using native iOS, Android players

## Install

```bash
npm install @numbersprotocol/preview-video
npx cap sync
```

## API

* [`echo(...)`](#echo)
* [`create(...)`](#create)
* [`destroy(...)`](#destroy)
* [`onScroll(...)`](#onscroll)
* [Interfaces](#interfaces)

### echo(...)

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

| Param | Type |
| ------------- | ------------------------------- |
| **`options`** | { value: string; } |

**Returns:** Promise<{ value: string; }>

--------------------

### create(...)

```typescript
create(_args: CreatePreviewVideoArgs) => Promise
```

| Param | Type |
| ----------- | ------------------------------------------------------------------------- |
| **`_args`** | CreatePreviewVideoArgs |

**Returns:** Promise<any>

--------------------

### destroy(...)

```typescript
destroy(_args: DestroyPreviewVideoArgs) => Promise
```

| Param | Type |
| ----------- | --------------------------------------------------------------------------- |
| **`_args`** | DestroyPreviewVideoArgs |

**Returns:** Promise<any>

--------------------

### onScroll(...)

```typescript
onScroll(args: OnScrollArgs) => Promise
```

| Param | Type |
| ---------- | ----------------------------------------------------- |
| **`args`** | OnScrollArgs |

--------------------

### Interfaces

#### CreatePreviewVideoArgs

| Prop | Type |
| ------------- | ----------------------------------------------------------------- |
| **`id`** | string |
| **`src`** | string |
| **`element`** | HTMLElement |
| **`config`** | PreviewVideoConfig |

#### PreviewVideoConfig

| Prop | Type | Description |
| ------------ | ------------------- | --------------------------------------------------------------- |
| **`width`** | number | Override width for native Video Player |
| **`height`** | number | Override height for native Video Player |
| **`x`** | number | Override absolute x coordinate position for native Video Player |
| **`y`** | number | Override absolute y coordinate position for native Video Player |

#### DestroyPreviewVideoArgs

| Prop | Type |
| -------- | ------------------- |
| **`id`** | string |

#### OnScrollArgs

| Prop | Type |
| ------------------------ | --------------------------------------------------------------------- |
| **`id`** | string |
| **`previewVideoBounds`** | { x: number; y: number; width: number; height: number; } |