# cloudvoice-connect-vue

> Vue component for Cloudvoice Connect Web Integration via IFrame

Latest version **1.0.1** (published 2021-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install cloudvoice-connect-vue
pnpm add cloudvoice-connect-vue
yarn add cloudvoice-connect-vue
bun add cloudvoice-connect-vue
```

## 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.1 |
| Published | 2021-01-18 |
| First published | 2021-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | CloudVoice Connect |
| Maintainers | cloudvoice |

## Links

- npm: https://www.npmjs.com/package/cloudvoice-connect-vue
- npm.io page: https://npm.io/package/cloudvoice-connect-vue

## Dependencies (1)

- [eslint-plugin-vue](https://npm.io/package/eslint-plugin-vue.md) ^7.4.1

## Recent versions

- 1.0.1 (latest) — 2021-01-18
- 1.0.0 — 2021-01-18

## README

# cloudvoice-connect-vue

Vue component for Cloudvoice Connect Integration.

# Installation

**NPM**

```bash
$ npm install cloudvoice-connect-vue
```

# Usage

```vue
<template>
  <vue-cloudvoice-connect
    ref="CloudvoiceConnectRef"
    domain="telemed.cloudvoice.in"
    :options="cvcOptions"
  ></vue-cloudvoice-connect>
</template>

<script>
import { CloudvoiceConnect } from "cloudvoice-connect-vue";
export default {
  components: {
    VueCloudvoiceConnect: CloudvoiceConnect,
  },
  computed: {
    cvcOptions() {
      return {
        roomName: "cloudvoice",
        token: "",
        noSSL: false,
        userInfo: {
          email: "user@sample.com",
          displayName: "FirstName LastName",
        },
        configOverwrite: {
          enableNoisyMicDetection: false,
        },
        onload: this.onIFrameLoad,
      };
    },
  },
  methods: {
    onIFrameLoad() {
      // do stuff
    },
  },
};
</script>
```

# Events

**Methods**

> `addEventListener(eventName, handler)`

To create an event, you must specify a `ref` in the CloudvoiceConnect component. This `ref` is required to access the methods in the CloudvoiceConnect component.

```html
<cloudvoice-connect-vue ref="CloudvoiceConnectRef" :options="cvcOptions" />
```

```javascript
...
computed: {
  cvcOptions () {
    return {
      ...
      onload: this.onIFrameLoad
    };
  },
},
methods: {
  // Setup events after the IFrame onload event
  onIFrameLoad () {
    this.$refs.CloudvoiceConnectRef.addEventListener('participantJoined', this.onParticipantJoined);
  },
  onParticipantJoined (e) {
    // do stuff
  },
}
...
```

**Methods**

> `executeCommand(commandName, arg1, arg2, ...args)`

Control the embedded CloudvoiceConnect conference using the `executeCommand` method. Similar to the [events](#events), this can also be achieved using `ref`.

```html
<cloudvoice-connect-vue ref="CloudvoiceConnectRef" :options="cvcOptions" />
```

```javascript
...
computed: {
  cvcOptions () {
    return {
      ...
      onload: this.onIFrameLoad
    };
  },
},
methods: {
  // Execute commands after the IFrame onload event
  // or at any given action by the user.
  onIFrameLoad () {
    // This will load the 'The display name' value using the `displayName` command.
    this.$refs.CloudvoiceConnectRef.executeCommand('displayName', 'The display name');
  },
}
...
```

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