# @tryangled/vue-video

> vue plugin to create a text area to take the URL of a youtube/vimeo video and return the actual link to the video. It will also validate if the video exsists.

Latest version **1.0.0** (published 2019-08-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tryangled/vue-video
pnpm add @tryangled/vue-video
yarn add @tryangled/vue-video
bun add @tryangled/vue-video
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-08-01 |
| First published | 2019-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vinay Samtani |
| Maintainers | vinay.samtani |
| Keywords | vue, input, youtube, vimeo, thumbnail, components, video list, thumbnail images |

## Links

- npm: https://www.npmjs.com/package/@tryangled/vue-video
- npm.io page: https://npm.io/package/@tryangled/vue-video

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-08-01
- 0.0.19 — 2019-08-01
- 0.0.18 — 2019-08-01
- 0.0.17 — 2019-08-01
- 0.0.16 — 2019-08-01
- 0.0.15 — 2019-08-01
- 0.0.14 — 2019-08-01
- 0.0.13 — 2019-07-31
- 0.0.12 — 2019-07-31
- 0.0.11 — 2019-07-31
- 0.0.10 — 2019-07-31
- 0.0.9 — 2019-07-31
- 0.0.8 — 2019-07-31
- 0.0.7 — 2019-07-31
- 0.0.6 — 2019-07-31
- … 5 more at https://npm.io/package/@tryangled/vue-video/versions

## README

# @tryangled/vue-video youtube and vimeo component for Vue.js

## TL;DR
Component to take as input Youtube and/or Vimeo urls and return the correct video url, type (youtube/vimeo), valid/invalid and thumbnail url.

- Demo Link - https://ve1jk.csb.app/

## Features

- Lightweight (<6KB gzipped)
- Dependency free
- Mobile support
- Returns an array of videos
- Retreives the thumbnail of the video

## Usage

### A. Globally

```js
import Vue from 'vue'
import vue-video from '@tryangled/vue-video'

// register component <vue-video>
Vue.use(vue-video)
```

### B. Use as component: https://codesandbox.io/embed/vue-video-sample-app-ve1jk?fontsize=14

```html
<template>
  <div>
    <vue-video
      thumbWidthPX="100"
      urlInputBorder="blue"
      urlInputTextColor="green"
      urlInputPlaceholderText="Add Youtube / Vimeo Link"
      urlInputTextHeightPX="30"
      limitVideoTo="3"
      @VideoDeleted="onVideoDeleted"
      @thumbnailClick="onThumbClicked"
      @VideoAdded="onVideoAdded"
      @VideoUrlError="onVideoUrlError"
    ></vue-video>
  </div>
</template>

<script>
  import {vueVideo} from '@tryangled/vue-video'

  export default {
    data () {
      return {
        }
      },
    methods: {
      onVideoDeleted(value) {
        //write your code here
        console.log(value.position);
        console.log(value.videos);
        console.log(value.video);
        },
      onThumbClicked(url) {
        //write your code here
        console.log(url);
        },
      onVideoAdded(value) {
        //write your code here
        console.log(value.videos);
        console.log(value.video);
        },
      onVideoUrlError(url) {
        //write your code here
        console.log(url);
        }
      }
    }
</script>
```

## Custom attributes


| Attribute               | Required | Type    | Default | Description                                             |
|-------------------------|----------|---------|---------------------------------|------------------------------|
| thumbWidthPX            | optional | String  | "100"                           | Thumbnail Width in px             |
| urlInputBorder          | optional | String  | "gray"                          | Input Border Color           |
| urlInputTextColor       | optional | String  | "black"                         | Input Text Color             |
| urlInputPlaceholderText | optional | String  | "Video link (Youtube or Vimeo)" | Input placeholder Text       |
| urlInputTextHeightPX    | optional | String  | "30"                            | Input Height in px                |
| limitVideoTo            | optional | String  | "-1"                             | Limit of videos ("-1" = unlimited)    |


## Event handlers
| Event handler  | Parameter                 | Type   | Description                                             |
|----------------|---------------------------|-------------------------------------------------------------------------------------|---------------------------------|------------------------------|
| VideoDeleted   | {position, video, videos} | {String, {Url, isValid, thumbUrl, type}, [{Url, isValid, thumbUrl, type}, ... ]}    | event triggered when a video is deleted from the list |
| thumbnailClick | videoUrl                  | String                                                                              | event triggered when a thumbnail is clicked, parameter passed is the video URL |
| VideoAdded     | {video, videos}  | {{Url, isValid, thumbUrl, type}, [{Url, isValid, thumbUrl, type}, ... ]}            | event triggered when a valid video is added to the list             |
| VideoUrlError  | url | String  | event triggered when the url entered cannot be resolved to a valid youtube / vimeo url      |

### References

- https://developer.vimeo.com/api/guides/start

---
_Source: https://npm.io/package/@tryangled/vue-video · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
