Socket
Socket
Sign inDemoInstall

vue-dadan-sdk

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-dadan-sdk

A lightweight Vue package used for checking validating, and manipulating [Google Dadan Extension](https://haal.link.sa/onboarding/download) with Vue.


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Vue Dadan SDK

A lightweight Vue package used for checking validating, and manipulating Google Dadan Extension with Vue.

Install

npm install vue-dadan-sdk
Or
yarn add vue-dadan-sdk

Usage

In Your component import the RecordVideoButton component

<script>
import RecordVideoButton from "vue-dadan-sdk"; //Main component to import
export default {
  name: "App",
  data: function() {
    return {
      videos: [], //initial state used to get recorded or selected videos
    };
  },
  components: {
    RecordVideoButton, //our component
  },
  methods: {
    handleResponse: function({ success, data, message }) {
      if (success) {
        if (data) {
          this.videos = data;
        }
      } else {
        this.videos = [];
        console.log(message);
      }
    },
  },
};
</script>

In Your component template , add the component with props

<template>
  <RecordVideoButton
    title="Select Video"
    v-bind:showSvg="true"
    v-bind:showPreview="true"
    v-bind:copyToClipboard="true"
    buttonClass=""
    buttonStyle=""
    type="select"
    @onFailure="handleResponse"
    @onSuccess="handleResponse"
  />
</template>

the handleResponse function in Methods , is a callback function which accept object with three parameters

handleResponse : function({ success, data, message }) {
  if (success) {
    // only false when user close extension
    if (data) {
      // represnts the selected videos , or recorded video object after stop recording
      this.videos = data;
    }
  } else {
    this.videos = [];
    console.error(message); //User Closed Extension
  }
}

Record Button Props

ParameterTypeDescription
typestringRequired. either record or select , else will show error
titlestringOptional. button title
buttonClassstringOptional. the default class , or your custom class
buttonStylestringOptional. the default style , or your custom style as string
showSvgbooleanOptional. to show Svg icon in button
showPreviewbooleanOptional. to show preview dialog of recorded video
copyToClipboardbooleanOptional. to notify user that video shared url was copied to clipboard as toast message

License

MIT

FAQs

Last updated on 25 Oct 2021

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