Giter VIP home page Giter VIP logo

ng2-youtube-player-mini's Introduction

ng2-youtube-player-mini

Angular 2 lightweight wrapper for Youtube player - AoT ready

Installation:

npm install ng2-youtube-player-mini --save

Use Example:

In systemjs.config.js:

System.config({
    paths: {
      // paths serve as alias
      'npm:': 'node_modules/'
    },
    map: {
         //add line
         'ng2-youtube-player-mini': 'npm:ng2-youtube-player-mini'
      },
      // packages tells the System loader how to load when no filename and/or no extension
      packages: {
         //add line
         'ng2-youtube-player-mini': { defaultExtension: 'js' },

In app.module

import { YoutubePlayerMiniModule }  from 'ng2-youtube-player-mini'
...
imports:[YoutubePlayerMiniModule]

in Component

import {Component} from '@angular/core';

@Component({
  template: `
    <youtube-player [playerId]='"player"' [width]="640" [height]="480" [videoId]='"vntAEVjPBzQ"'> </youtube-player>
  `,
})

class App {

}

for Playlist, you can specify a playlistId:

<youtube-player [playerId]='"player"' [width]="640" [height]="480" [videoId]='' [playlistId]='"PLy_wKxVmWb4ZrduWMNXPWmBBImCAMqHV4"' > </youtube-player>

the videoId is then the id of the video where you want the playlist to start.

Notes

You can also pass an http type link to videoId.

Security Notes

videoId is considered Safe. Ensure these values are not provided by an unknown source.

Author

Sylvain Cau

Licence

This project is licensed under the MIT license. See the LICENSE file for more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.