Detalhes do pacote

v-clappr

vinayakkulkarni346MIT3.4.0

Vue.js wrapper for Clappr

Vue.js, V-Clappr, Clappr, Vue Component

readme (leia-me)

V-Clappr 🎥

GitHub Workflow Status GitHub Workflow Status GitHub Workflow Status GitHub release (latest SemVer) npm DeepScan grade Snyk Vulnerabilities for GitHub Repo GitHub contributors npm type definitions npm npm npm bundle size (version)

built using janak vue vite eslint prettier typescript


Features


Demo

Edit v-clappr


Table of Contents

Requirements

Build Setup

# install dependencies
$ npm ci

# package the library
$ npm run build

Installation

$ npm install v-clappr
$ npm install @clappr/core @clappr/plugins @clappr/hlsjs-playback

Usage

Global component:

// main.ts
import { VClappr } from 'v-clappr';
import { createApp } from 'vue';

const app = createApp({});
app.component('VClappr', VClappr);

Or use locally

// component.vue
<script lang="ts">
import { defineComponent } from 'vue';
import { VClappr } from 'v-clappr';

export default defineComponent({
  components: {
    VClappr,
  },
});
</script>

For Nuxt 3, create a file in plugins/v-clappr.ts

import { VClappr } from 'v-clappr';

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.component('VClappr', VClappr);
});

Example(s)

<summary> Example 1 (w/ all options – refer App.vue) </summary> HTML html <v-clappr el="player" :source="source" :options="options" @init="oninit" @ready="onready" @play="onplay" @pause="onpause" @stop="onstop" @ended="onended" @fullscreen="onfullscreen" @resize="onresize" @seek="onseek" @timeupdate="ontimeupdate" @volumeupdate="onvolumeupdate" @error="onerror" /> JS javascript import { defineComponent, reactive } from 'vue'; import { VClappr } from 'v-clappr'; export default defineComponent({ name: 'ClapprComponent', components: { VClappr, }, setup() { const state = reactive({ clappr: null, source: 'http://clappr.io/highline.mp4', poster: 'http://clappr.io/poster.png', options: { width: '100%', height: '100%', autoPlay: false, mute: false, loop: false, language: 'en-US', playbackNotSupportedMessage: 'Playback not supported', autoSeekFromUrl: true, includeResetStyle: true, playback: { preload: 'metadata', disableContextMenu: true, controls: false, crossOrigin: null, playInline: false, minimumDvrSize: null, externalTracks: [], hlsjsConfig: {}, shakaConfiguration: {}, }, }, }); const onInit = (clappr: any) => { state.clappr = clappr; }; const onReady = (e: any) => { console.log('onReady Event: ', e); }; const onResize = (e: any) => { console.log('onResize Event: ', e); }; const onPlay = (e: any) => { console.log('onPlay Event: ', e); }; const onPause = (e: any) => { console.log('onPause Event: ', e); }; const onStop = (e: any) => { console.log('onStop Event: ', e); }; const onEnded = (e: any) => { console.log('onEnded Event: ', e); }; const onSeek = (e: any) => { console.log('onSeek Event: ', e); }; const onError = (e: any) => { console.log('onError Event: ', e); }; const onTimeUpdated = (e: any) => { console.log('onTimeUpdate Event: ', e); }; const onVolumeUpdated = (e: any) => { console.log('onVolumeUpdate Event: ', e); }; const onSubtitleAvailable = (e: any) => { console.log('onSubtitleAvailable Event: ', e); }; return { state, onInit, onReady, onResize, onPlay, onPause, onStop, onEnded, onSeek, onError, onTimeUpdated, onVolumeUpdated, onSubtitleAvailable, }; }, });
<summary> Example 2 (minimal) </summary> HTML html <v-clappr el="my-custom-id" :source="source" /> JS javascript import { defineComponent, ref } from 'vue'; import { VClappr } from 'v-clappr'; export default defineComponent({ name: 'ClapprComponent', components: { VClappr, }, setup() { const source = ref('http://clappr.io/highline.mp4'); return { source, }; }, });

API

Props

Name Type Required? Description
el String Yes The id required for initializing Clappr
source String Yes The URL of the video to be fed to Clappr
options Object No Set of options provided by Clappr defaults: L47-L69

Events

Name Description
ready Emits an Object the Player instance
resize Emits an Object with width & height numbers
play Emits an Boolean value
pause Emits an Boolean value
stop Emits an Boolean value
ended Emits an Boolean value
seek Emits an Number value
error Emits an Error type
time-updated Emits an Object current & total time in microseconds
volume-updated Emits an Number with current volume
subtitle-available Emits an Boolean value

Contributing

  1. Fork it ( https://github.com/vinayakkulkarni/v-clappr/fork )
  2. Create your feature branch (git checkout -b feat/new-feature)
  3. Commit your changes (git commit -Sam 'feat: add feature')
  4. Push to the branch (git push origin feat/new-feature)
  5. Create a new Pull Request

Note:

  1. Please contribute using GitHub Flow
  2. Commits & PRs will be allowed only if the commit messages & PR titles follow the conventional commit standard, read more about it here
  3. PS. Ensure your commits are signed. Read why

Author

v-clappr © Vinayak, Released under the MIT License.
Authored and maintained by Vinayak Kulkarni with help from contributors (list).

vinayakkulkarni.dev · GitHub @vinayakkulkarni · Twitter @_vinayak_k

License

FOSSA Status

changelog (log de mudanças)

3.4.0 (2024-05-18)

Bug Fixes

  • deps: bump amannn/action-semantic-pull-request (#1765) (b6049ef)
  • deps: bump dependabot/fetch-metadata from 1.7.0 to 2.0.0 (#1704) (89b3dd2)
  • deps: bump github/super-linter from 4 to 5 (#1706) (22dd7e3)
  • deps: bump github/super-linter from 5 to 6 (#1766) (d0b7e1b)
  • deps: bump peaceiris/actions-gh-pages from 3.9.3 to 4.0.0 (#1733) (d3f30e2)
  • deps: bump the actions-minor group with 1 update (#1696) (786c76f)
  • deps: bump the actions-minor group with 2 updates (#1769) (33441b7)
  • deps: bump unocss from 0.58.9 to 0.59.0 in /example (#1730) (e397cbd)
  • deps: bump unocss from 0.59.4 to 0.60.0 in /example (#1788) (fcba445)
  • deps: update @clappr/hlsjs-playback requirement from ^1.2.0 to ^1.3.0 in /example (#1705) (0df3dad)
  • deps: update unocss requirement from ^0.58.6 to ^0.58.8 in /example (#1711) (a0e79d1)
  • deps: update unocss requirement from ^0.58.8 to ^0.58.9 in /example (#1717) (13b4c29)
  • deps: update unocss requirement from ^0.59.0 to ^0.59.2 in /example (#1742) (0d66898)
  • deps: update unocss requirement from ^0.59.2 to ^0.59.4 in /example (#1752) (8fe7c49)
  • deps: update v-github-icon requirement from ^3.1.3 to ^3.2.1 in /example (#1691) (8c1a4d4)
  • deps: update vue requirement from ^3.4.21 to ^3.4.23 in /example (#1750) (4069525)
  • deps: update vue requirement from ^3.4.23 to ^3.4.26 in /example (#1770) (0bcc595)
  • deps: update vue requirement from ^3.4.26 to ^3.4.27 in /example (#1785) (bd59476)

Features

  • add support for super-linter (93ee29a)

3.3.0 (2024-03-20)

Bug Fixes

  • deps: Bump @antfu/utils from 0.7.2 to 0.7.4 in /example (#1273) (dd02e9b)
  • deps: Bump @clappr/hlsjs-playback from 1.0.1 to 1.1.0 in /example (#1249) (7d0ad56)
  • deps: bump @clappr/hlsjs-playback from 1.1.0 to 1.2.0 in /example (#1506) (86e5691)
  • deps: bump actions/setup-node from 3 to 4 (#1483) (77dcea0)
  • deps: bump actions/stale from 8 to 9 (#1567) (797e242)
  • deps: bump amannn/action-semantic-pull-request from 5.2.0 to 5.3.0 (#1447) (64654fd)
  • deps: bump amannn/action-semantic-pull-request from 5.3.0 to 5.4.0 (#1501) (8082513)
  • deps: Bump dash-shaka-playback from 3.0.5 to 3.1.0 in /example (#1251) (c717ce7)
  • deps: bump dash-shaka-playback from 3.1.0 to 3.2.0 in /example (#1507) (a5824ca)
  • deps: Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 (#1166) (4ecf9b0)
  • deps: Bump dependabot/fetch-metadata from 1.4.0 to 1.5.0 (#1254) (31feacc)
  • deps: Bump dependabot/fetch-metadata from 1.5.0 to 1.5.1 (#1259) (909f5ee)
  • deps: bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 (#1318) (a69e136)
  • deps: bump github/codeql-action from 2 to 3 (#1578) (4597920)
  • deps: bump postcss from 8.4.18 to 8.4.31 in /example (#1458) (9bd19b5)
  • deps: bump v-github-icon from 3.0.2 to 3.1.1 in /example (#1160) (38fe67e)
  • deps: bump v-github-icon from 3.1.1 to 3.1.2 in /example (#1587) (24bb725)
  • deps: bump v-github-icon from 3.1.2 to 3.1.3 in /example (#1632) (8d14684)
  • deps: Bump vue from 3.2.47 to 3.3.1 in /example (#1228) (391d0ef)
  • deps: Bump vue from 3.3.1 to 3.3.2 in /example (#1234) (923a82a)
  • deps: bump vue from 3.3.10 to 3.3.11 in /example (#1572) (281c8b9)
  • deps: bump vue from 3.3.11 to 3.3.12 in /example (#1583) (994c161)
  • deps: bump vue from 3.3.12 to 3.3.13 in /example (#1585) (aeaa539)
  • deps: bump vue from 3.3.13 to 3.4.3 in /example (#1593) (a13f6ff)
  • deps: Bump vue from 3.3.2 to 3.3.4 in /example (#1250) (a2ba440)
  • deps: bump vue from 3.3.4 to 3.3.6 in /example (#1482) (36eae6a)
  • deps: bump vue from 3.3.6 to 3.3.7 in /example (#1486) (d90d150)
  • deps: bump vue from 3.3.7 to 3.3.8 in /example (#1505) (6647e66)
  • deps: bump vue from 3.3.8 to 3.3.9 in /example (#1535) (73c44c2)
  • deps: bump vue from 3.3.9 to 3.3.10 in /example (#1558) (f3c294d)
  • deps: bump vue from 3.4.10 to 3.4.13 in /example (#1617) (c0f4c38)
  • deps: bump vue from 3.4.13 to 3.4.14 in /example (#1621) (061a381)
  • deps: bump vue from 3.4.14 to 3.4.15 in /example (#1624) (c88d50f)
  • deps: bump vue from 3.4.15 to 3.4.16 in /example (#1637) (00274ba)
  • deps: bump vue from 3.4.16 to 3.4.18 in /example (#1642) (68309ee)
  • deps: bump vue from 3.4.18 to 3.4.19 in /example (#1646) (efe0110)
  • deps: bump vue from 3.4.19 to 3.4.20 in /example (#1663) (588da56)
  • deps: bump vue from 3.4.20 to 3.4.21 in /example (#1664) (0e89d38)
  • deps: bump vue from 3.4.3 to 3.4.4 in /example (#1596) (2bdfaa4)
  • deps: bump vue from 3.4.4 to 3.4.5 in /example (#1597) (e3d6234)
  • deps: bump vue from 3.4.5 to 3.4.6 in /example (#1612) (b868c97)
  • deps: bump vue from 3.4.6 to 3.4.7 in /example (#1614) (9710932)
  • deps: bump vue from 3.4.7 to 3.4.8 in /example (#1615) (94c2052)
  • deps: bump vue from 3.4.8 to 3.4.10 in /example (#1616) (2bfee1e)
  • enable grouping for examples (c0118ce)

Features

Reverts

3.2.0 (2023-04-13)

Bug Fixes

  • deps: bump @clappr/core from 0.4.22 to 0.4.23 in /example (#981) (06c3db0)
  • deps: bump @clappr/core from 0.4.23 to 0.4.24 in /example (#998) (b1148a3)
  • deps: bump @clappr/core from 0.4.24 to 0.4.25 in /example (#1013) (f0914a3)
  • deps: bump @clappr/core from 0.4.25 to 0.4.27 in /example (#1024) (2ce717e)
  • deps: bump @clappr/hlsjs-playback from 0.6.0 to 1.0.1 in /example (#1026) (d096168)
  • deps: bump amannn/action-semantic-pull-request from 5.0.2 to 5.1.0 (#1064) (5417025)
  • deps: bump amannn/action-semantic-pull-request from 5.1.0 to 5.2.0 (#1113) (723788c)
  • deps: bump dash-shaka-playback from 3.0.3 to 3.0.5 in /example (#1004) (ccbee2f)
  • deps: bump json5 from 1.0.1 to 1.0.2 (#1015) (7fb914e)
  • deps: bump peaceiris/actions-gh-pages from 3.9.0 to 3.9.1 (#1012) (69a9c35)
  • deps: bump peaceiris/actions-gh-pages from 3.9.1 to 3.9.2 (#1034) (aaeb2b1)
  • deps: bump peaceiris/actions-gh-pages from 3.9.2 to 3.9.3 (#1138) (c5ab6e2)
  • deps: bump v-clappr from 3.1.1 to 3.1.2 in /example (#920) (86626b2)
  • deps: bump vue from 3.2.41 to 3.2.44 in /example (#925) (f1760b6)
  • deps: bump vue from 3.2.44 to 3.2.45 in /example (#928) (09d2e93)
  • deps: bump vue from 3.2.45 to 3.2.47 in /example (#1055) (2f17e85)
  • use squash merge (80b58eb)

Features

  • add automerger workflow 🎉 (b65d49e)
  • node: pin to LTS version (74be0cf)

3.1.2 (2022-11-08)

Bug Fixes

  • update docs with correct v-clappr version (c9d1753)

3.1.1 (2022-11-08)

3.1.0 (2022-11-08)

Bug Fixes

Features

3.0.0 (2022-10-28)

Bug Fixes

  • dependency issue for v-clappr in example (a5144f0)
  • deps: bump actions/checkout from 2 to 3 (#661) (d0b1199)
  • deps: bump actions/setup-node from 2.3.2 to 2.4.0 (#359) (28fcc92)
  • deps: bump actions/setup-node from 2.4.0 to 2.4.1 (#449) (58ef581)
  • deps: bump actions/setup-node from 2.4.1 to 2.5.0 (#526) (77e7bad)
  • deps: bump actions/setup-node from 2.5.0 to 3 (#659) (ac0e20f)
  • deps: bump ansi-regex from 5.0.0 to 5.0.1 (#881) (8605aa7)
  • deps: bump axios from 0.21.1 to 0.21.4 (#702) (d035d11)
  • deps: bump ejs from 3.1.6 to 3.1.7 (#744) (c313a2b)
  • deps: bump follow-redirects from 1.14.1 to 1.14.8 (#640) (a056f1c)
  • deps: bump minimist from 1.2.5 to 1.2.6 (#690) (f33f44c)
  • deps: bump nanoid from 3.1.23 to 3.3.1 (#685) (f7cd356)
  • deps: bump shell-quote from 1.7.2 to 1.7.3 (#790) (ae28779)
  • deps: bump terser from 5.7.1 to 5.14.2 (#812) (661c082)
  • deps: bump wearerequired/lint-action from 1 to 2 (#734) (42e114b)

2.0.2 (2021-08-05)

Bug Fixes

  • build: use pull_request_target event (5b4d097)
  • deps: bump actions/setup-node from 2.3.0 to 2.3.2 (#357) (3181817)

2.0.1 (2021-07-30)

2.0.0 (2021-07-30)

Bug Fixes

  • add support for eslint-plugin-prettier (b4997ce)
  • deps: bump actions/cache from 2.1.4 to 2.1.6 (#289) (99d622f)
  • deps: bump actions/cache from v2 to v2.1.4 (#202) (62a7e80)
  • deps: bump browserslist from 4.16.3 to 4.16.6 (#285) (a0ee28a)
  • deps: bump glob-parent from 5.1.1 to 5.1.2 (#297) (a4b0c3f)
  • deps: bump hosted-git-info from 2.8.8 to 2.8.9 (#274) (2ade0b2)
  • deps: bump lodash from 4.17.20 to 4.17.21 (#273) (0ed28b1)
  • deps: bump pug-code-gen from 2.0.2 to 2.0.3 (#230) (ce77f2a)
  • deps: bump ws from 6.2.1 to 6.2.2 (#294) (619f635)
  • deps: update actions/setup-node requirement to v2.1.5 (#215) (18ee0d3)

1.5.0 (2021-01-11)

Bug Fixes

1.1.1 (2020-05-29)

1.1.0 (2020-05-29)

Bug Fixes

Features

  • add support for built in plugins & minor housekeeping (#10) (c9f7103)

1.0.0 (2020-04-12)

Features

  • add dependabot support (68def2f)
  • add husky & commitlint configs (13391d9)
  • add semantic-pull-request support (0111837)
  • add ship.js github action 🚀 (9af3326)
  • add support for plugins (7b5df88)
  • update babel configuration (ea8a14b)