Socket
Socket
Sign inDemoInstall

@tryangled/vue-video

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @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.


Version published
Weekly downloads
5
decreased by-68.75%
Maintainers
1
Install size
18.8 kB
Created
Weekly downloads
 

Readme

Source

@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

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

<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

AttributeRequiredTypeDefaultDescription
thumbWidthPXoptionalString"100"Thumbnail Width in px
urlInputBorderoptionalString"gray"Input Border Color
urlInputTextColoroptionalString"black"Input Text Color
urlInputPlaceholderTextoptionalString"Video link (Youtube or Vimeo)"Input placeholder Text
urlInputTextHeightPXoptionalString"30"Input Height in px
limitVideoTooptionalString"-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

Keywords

FAQs

Last updated on 01 Aug 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc