This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

get-youtube-instance

1.0.1 • Public • Published

getYoutubeInstance

getYoutubeInstance TravisCI Coverage Status Node.js Bundlephobia

getYoutubeInstance is a minimalist script to easily get the Youtube instance from a player added with Youtube iframe API.

The function accept HTML element (iframe) or HTML element id. The YouTube instance then allows you to manipulate the player.

Installation

The plugin is available as the get-youtube-instance package name on npm and Github.

npm i --save-dev get-youtube-instance
yarn add --dev get-youtube-instance

Environment

getYoutubeInstance was built for Node.js >=8.11.2.

Usage

Usage with HTML element

The following example returns the Youtube instance for the current player from iframe element.

<iframe id="player-yt" src="https://www.youtube.com/embed/aqz-KE-bpKQ"></iframe>
getYoutubeInstance(document.querySelector('#player-yt'));

Usage with HTML id

The following example returns the Youtube instance for the current player from iframe id.

<iframe id="player-yt" src="https://www.youtube.com/embed/aqz-KE-bpKQ"></iframe>
getYoutubeInstance('player-yt');

Parameters

option

HTMLElement || string

Tells to the function the target element or the id of the target element.

Licence

getYoutubeInstance is licensed under the MIT License.

Created with ♥ by @yoriiis.

Package Sidebar

Install

npm i get-youtube-instance

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

7.17 kB

Total Files

6

Last publish

Collaborators

  • yoriiis