# angular-lightweight-youtube-embed

> lightweight youtube embedder. Embeds coverimage on pageload, loads iframe only after click

Latest version **1.0.1** (published 2016-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install angular-lightweight-youtube-embed
pnpm add angular-lightweight-youtube-embed
yarn add angular-lightweight-youtube-embed
bun add angular-lightweight-youtube-embed
```

## 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 | 2016-05-15 |
| First published | 2016-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jestersimpps |
| Maintainers | jestersimpps |
| Keywords | lightweight, youtube, embed |

## Links

- npm: https://www.npmjs.com/package/angular-lightweight-youtube-embed
- Repository: https://github.com/jestersimpps/angular-lightweight-youtube-embed
- Homepage: https://github.com/jestersimpps/angular-lightweight-youtube-embed#readme
- Issues: https://github.com/jestersimpps/angular-lightweight-youtube-embed/issues
- npm.io page: https://npm.io/package/angular-lightweight-youtube-embed

## Recent versions

- 1.0.1 (latest) — 2016-05-15
- 1.0.0 — 2016-05-15

## README

## Angular youtube embed directive that loads the youtube iframe only after clicking the play icon

I found that other Youtube player directives would slow down my pageload significantly when embedding multiple videos in the same page.
To get around this problem, this directive simulates a youtube player by using the cover image of the video with a play icon on top of it.
Clicking the play icon will load the youtube iframe.



![example](https://raw.githubusercontent.com/jestersimpps/angular-lightweight-youtube-embed/master/example/example.png)


Install using npm:

```
npm i angular-lightweight-youtube-embed
```

Use in your angular project by injecting the dependency like so:

```
var yourapp = angular.module('yourapp', ['lwytEmbed']);
```

If you are using the video url, you can use it like this:

```
<lwyt-embed
  youtubeurl="https://www.youtube.com/watch?v=jJG8p9udwMA"
  playerWidth="100%"
  playerHeight="250px">
</lwyt-embed>
```

If you are using the videoid:

```
<lwyt-embed
  youtubeurl="https://www.youtube.com/watch?v={{post.videoid}}"
  playerWidth="100%"
  playerHeight="250px">
</lwyt-embed>
```

* youtubeurl : set this to the url of the video you want to load
* playerWidth : desired player width, takes css
* playerHeight : desired player height, takes css

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