# open-pip

> 🎥 Module to open any url or path to a movie in macOS native picture-in-picture player

Latest version **3.0.6** (published 2020-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install open-pip
pnpm add open-pip
yarn add open-pip
bun add open-pip
```

## 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 | 3.0.6 |
| Published | 2020-05-31 |
| First published | 2017-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6.0 |
| Dependencies | 4 |
| Unpacked size | 8.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 74 |
| Author | Albin Ekblom |
| Maintainers | albinekb |

## Links

- npm: https://www.npmjs.com/package/open-pip
- Repository: https://github.com/albinekb/open-pip
- Homepage: https://github.com/albinekb/open-pip#readme
- Issues: https://github.com/albinekb/open-pip/issues
- npm.io page: https://npm.io/package/open-pip

## Dependencies (4)

- [args](https://npm.io/package/args.md) ^5.0.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0
- [p-min-delay](https://npm.io/package/p-min-delay.md) ^2.0.0
- [child-process-promise](https://npm.io/package/child-process-promise.md) ^2.2.0

## Recent versions

- 3.0.6 (latest) — 2020-05-31
- 3.0.5 — 2017-03-29
- 3.0.4 — 2017-03-29
- 3.0.3 — 2017-03-29
- 3.0.2 — 2017-03-28
- 3.0.1 — 2017-03-28
- 3.0.0 — 2017-03-28
- 2.3.0 — 2017-03-28
- 2.2.0 — 2017-03-28
- 2.1.0 — 2017-03-28
- 2.0.0 — 2017-03-28

## README

# 🎥 open-pip [![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) ![](https://img.shields.io/npm/dm/open-pip.svg) ![](https://img.shields.io/npm/v/open-pip.svg)


Module that will let you open a movie url/path in macOS native picture-in-picture player.

Both local files and urls are supported.

Known **working** formats
  - mp4
  - m4v
  - mov

Known **not** working formats
  - mkv
  - avi

## example

![example](https://cloud.githubusercontent.com/assets/5027156/24427478/535eabd6-140b-11e7-9115-951e90ccf278.gif)

## install

```sh
yarn add open-pip
```

## Usage

```js
const open = require('open-pip')

open('/path/to/movie.mp4')
  .then(() => console.log('Worked 🎉'))
  .catch(error => console.log('Something went wrong 💀', error))
```

### How does it work?

It uses child-process-promise to run this command:
```sh
open pip.app --args <absolute-path-to-file>
```

pip.app is a simple macOS app that reads the input argument and tries to load it in an AVPlayer

Source for `pip.app` can be found here: https://github.com/albinekb/open-pip-app

### Related

- [open-pip-cli](https://github.com/albinekb/open-pip-cli) - CLI for this module.
- [open-pip-menubar](https://github.com/matthiaskern/open-pip-menubar) - A mac menubar app to open videos in PiP mode.

### Credits

Inspiration came from this hack: https://github.com/steve228uk/PiPHack

### Author

Albin Ekblom ([@albinekb](https://github.com/albinekb))

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