Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

v-pip

vinayakkulkarni249MIT3.2.0TypeScript support: included

Vue wrapper for native picture-in-picture (PiP)

V-pip, pip, Vue.js, pip, Component, Vue-pip

readme

V-pip 🖼

Continuous Integration CodeQL Ship js trigger GitHub release (latest SemVer) npm npm npm (downloads) npm bundle size (version) npm type definitions DeepScan grade Snyk Vulnerabilities for GitHub Repo license GitHub contributors

eslint prettier vite vue typescript


Demo

Edit v-pip


Features

  • Vue 💚 Picture-in-picture!
  • Built from scratch using TypeScript

Versions

  • For Vue 3.x version – npm i v-pip
  • For Vue 2.x version – npm i v-pip@1

Table of Contents

Demo

Edit v-pip demo

Requirements

Installation

npm install v-pip # yarn add v-pip

CDN: UNPKG | jsDelivr (available as window.VPip)

Build Setup

# install dependencies
$ npm ci

# package the library
$ npm run build

Usage

Globally

As a component

import { VPip } from 'v-pip';
Vue.component('VPip', VPip);

As a plugin

import Vue from 'vue';
import VPip from 'v-pip';

Vue.use(VPip);

Locally

import { VPip } from 'v-pip';
<summary> Example 1 (refer App.vue) </summary>

HTML

<v-pip
  :video-options="videoOptions"
  :button-options="buttonOptions"
  @video-in-pip="handlePIP"
  @requesting-pip-failure="handlePipOpenFailure"
  @exiting-pip-failure="handlePipExitFailure"
/>

JS

import { VPip } from 'v-pip';

Vue.component('example-component', {
  components: {
    VPip,
  },
  data: () => ({
    isPip: false,
    videoOptions: {
      src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
      poster:
        'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg',
      wrapper: '',
      class: '',
      height: '',
      width: '',
    },
    buttonOptions: {
      wrapper: '',
      type: 'button',
      class: '',
      label: 'Toggle picture-in-picture',
    },
  }),
  methods: {
    handlePIP(e) {
      this.isPip = e;
    },
    handlePipOpenFailure(err) {
      console.log('Video failed to enter Picture-in-Picture mode.', err);
    },
    handlePipExitFailure(err) {
      console.log('Video failed to leave Picture-in-Picture mode.', err);
    },
  },
});
<summary> Example 2 (minimal) </summary>

HTML

<v-pip :video-options="videoOptions" />

JS

import { VPip } from 'v-pip';

Vue.component('example-component', {
  components: {
    VPip,
  },
  data: () => ({
    videoOptions: {
      src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
    },
  }),
});

Props

Name Type Required? Description
video-options Object Yes The set of options required to setup the V-Pip component.
button-options Object No The set of options for the toggle button

Events

Name Description
video-in-pip Emits an Boolean whether the Video is in PIP or not
requesting-pip-failure Emits an Object when the video fails to enter Picture-in-Picture mode.
exiting-pip-failure Emits an Object when the video fails to leave Picture-in-Picture mode.

Contributing

  1. Fork it ( https://github.com/vinayakkulkarni/v-pip/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-pip © 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

3.2.0 (2024-03-24)

Bug Fixes

  • deps: bump @antfu/utils from 0.7.2 to 0.7.4 in /example (05e2737)
  • deps: bump actions/checkout from 3 to 4 (b17b541)
  • deps: bump actions/setup-node from 3 to 4 (cfefc59)
  • deps: bump actions/stale from 8 to 9 (fb64814)
  • deps: bump amannn/action-semantic-pull-request from 5.2.0 to 5.4.0 (b982d71)
  • deps: Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 (2c7f46b)
  • deps: bump dependabot/fetch-metadata from 1.4.0 to 1.5.0 (6dda8f6)
  • deps: bump dependabot/fetch-metadata from 1.5.0 to 1.5.1 (f6aeeb5)
  • deps: bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 (408ac7d)
  • deps: bump dependabot/fetch-metadata from 1.6.0 to 2.0.0 (#1888) (c83f017)
  • deps: Bump v-github-icon from 3.0.2 to 3.1.1 in /example (2980cd0)
  • deps: bump v-github-icon from 3.1.1 to 3.1.2 in /example (a5138d7)
  • deps: bump v-pip from 3.0.1 to 3.1.1 in /example (16c539e)
  • deps: Bump vue from 3.2.47 to 3.3.1 in /example (844f268)
  • deps: bump vue from 3.3.1 to 3.3.2 in /example (23d1e87)
  • deps: bump vue from 3.3.11 to 3.3.13 in /example (972d412)
  • deps: bump vue from 3.3.13 to 3.4.4 in /example (6ac2eb5)
  • deps: bump vue from 3.3.2 to 3.3.4 in /example (becb172)
  • deps: bump vue from 3.3.4 to 3.3.11 in /example (fffe671)
  • deps: bump vue from 3.4.15 to 3.4.21 in /example (99e7fe5)
  • deps: bump vue from 3.4.4 to 3.4.15 in /example (f45c2c9)
  • deps: Bump yaml from 2.2.1 to 2.2.2 (3994265)

3.1.1 (2023-04-01)

Bug Fixes

  • shipjs: set github actor while release (98d121d)

3.1.0 (2023-04-01)

Bug Fixes

  • deps: bump actions/stale from 6 to 7 (8bb850a)
  • deps: bump actions/stale from 7 to 8 (d2ec785)
  • deps: bump amannn/action-semantic-pull-request from 5.0.2 to 5.1.0 (c01aafb)
  • deps: bump amannn/action-semantic-pull-request from 5.1.0 to 5.2.0 (d9f02bd)
  • deps: bump peaceiris/actions-gh-pages from 3.9.0 to 3.9.1 (689061a)
  • deps: bump peaceiris/actions-gh-pages from 3.9.1 to 3.9.2 (1f12cfb)
  • deps: bump peaceiris/actions-gh-pages from 3.9.2 to 3.9.3 (204fa3b)
  • deps: bump v-pip from 3.0.0 to 3.0.1 in /example (3c24ee7)
  • deps: bump vue from 3.2.41 to 3.2.44 in /example (2b07cba)
  • deps: bump vue from 3.2.44 to 3.2.45 in /example (6161242)
  • deps: bump vue from 3.2.45 to 3.2.47 in /example (efbaf09)
  • remove tweakpane comment (89768fb)

Features

  • add automerger workflow for merging dependabot PRs (197a175)

3.0.1 (2022-11-07)

Bug Fixes

  • deps: bump v-github-icon from 3.0.1 to 3.0.2 in /example (e67ada8)

3.0.0 (2022-11-07)

Bug Fixes

  • deps: bump actions/checkout from 2 to 3 (d2ae5ba)
  • deps: bump ejs from 3.1.6 to 3.1.7 (4273f12)
  • deps: bump minimist from 1.2.5 to 1.2.6 (ec42c4e)
  • deps: bump terser from 5.12.0 to 5.14.2 (e11bd0a)
  • deps: bump wearerequired/lint-action from 1 to 2 (a374620)
  • remove lgtm config file (8dc25dd)
  • remove unused index.d.ts (dc7b7f5)

Features

2.3.1 (2022-03-11)

Bug Fixes

  • deps: bump actions/cache from 2.1.6 to 2.1.7 (7be7063)
  • deps: bump actions/setup-node from 2.2.0 to 2.3.0 (a77843b)
  • deps: bump actions/setup-node from 2.3.0 to 2.4.0 (1fc6886)
  • deps: bump actions/setup-node from 2.4.0 to 2.4.1 (85a3df2)
  • deps: bump actions/setup-node from 2.4.1 to 2.5.1 (c4fecdb)
  • deps: bump actions/setup-node from 2.5.1 to 3 (2670da4)
  • deps: bump follow-redirects from 1.14.1 to 1.14.8 (d92e59d)

2.3.0 (2021-08-01)

Bug Fixes

  • deps: bump actions/cache from 2.1.4 to 2.1.6 (3d5cf6b)
  • deps: bump actions/setup-node from 2.1.5 to 2.2.0 (37331b1)
  • emit is-pip false (136ca11)
  • remove husky config (488ae5b)
  • remove jsconfig cause we have tsconfig (11f83af)
  • types for ButtonHTML attrib (ca68f79)
  • update ship.js config file (c9d98e4)

Features

2.2.0 (2021-03-04)

Bug Fixes

  • deps: bump eslint prettier config (c648bde)
  • update prettier/vue issue caused by eslint-config-prettier (1642b27)
  • deps: bump actions/cache from v2 to v2.1.4 (bf16cf5)
  • deps: bump actions/setup-node from v2.1.4 to v2.1.5 (8d39da2)

Features

  • ts: enable volar support (b9587ef)

Performance Improvements

2.1.0 (2021-01-29)

Features

  • add commonjs() as rollup plugin in config (ac0fdca)

2.0.2 (2021-01-29)

2.0.1 (2021-01-10)

Bug Fixes

  • bump dependencies (59b358e)
  • remove @rollup/plugin-commonjs (139fc00)
  • deps: bump actions/setup-node from v2.1.2 to v2.1.3 (d41b4f4)
  • deps: bump actions/setup-node from v2.1.3 to v2.1.4 (62d1558)
  • deps: bump ini from 1.3.5 to 1.3.8 (4b168b0)

2.0.0 (2020-10-20)

Bug Fixes

  • bump shipjs (354e849)
  • bump dependencies (47dae12)
  • minified file for cdn (5f00147)
  • remove ava config file (303b731)
  • update dependabot config (60cef31)
  • update build script (ed3d85b)
  • update shipjs trigger (510da1b)
  • update tests (74ce6e2)
  • deps: bump @vue/composition-api from 0.5.0 to 0.6.1 (485c5a4)
  • deps: bump @vue/composition-api from 0.6.1 to 0.6.2 (403658d)
  • deps: bump @vue/composition-api from 0.6.2 to 0.6.3 (1c20f39)
  • deps: bump @vue/composition-api from 0.6.3 to 0.6.4 (2bac0b8)
  • deps: bump @vue/composition-api from 0.6.4 to 0.6.5 (515dfe7)
  • deps: bump @vue/composition-api from 0.6.5 to 0.6.6 (1d56790)
  • deps: bump @vue/composition-api from 0.6.6 to 0.6.7 (803ae0a)
  • deps: bump @vue/composition-api from 1.0.0-beta.14 to 1.0.0-beta.15 (bb3a7b7)
  • deps: bump @vue/composition-api from 1.0.0-beta.15 to 1.0.0-beta.16 (7e4a86f)
  • deps: bump @vue/composition-api from 1.0.0-beta.16 to 1.0.0-beta.17 (db6c829)
  • deps: bump actions/setup-node from v2.1.1 to v2.1.2 (132e769)
  • update shipjs trigger (038a80d)
  • deps: bump lodash from 4.17.15 to 4.17.19 (aad3662)
  • deps: bump node-fetch from 2.6.0 to 2.6.1 (5215964)
  • deps: bump serialize-javascript from 3.0.0 to 3.1.0 (810e3c9)

Features

1.2.1 (2020-05-05)

Bug Fixes

  • update isPipSupported error (6e61cda)

1.2.0 (2020-05-05)

Bug Fixes

Features

  • add onBeforeUnmount hook (9ea6754)

1.1.0 (2020-05-03)

Features