Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-yt-player

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-yt-player

An Angular directive for the You Tube Video Player

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ng-youtube-player

This repo is for distribution on npm and bower.

Install

You can install this package either with npm or with bower.

npm

npm install ng-yt-player

bower

bower install ng-yt-player

The library is then available at bower_components/ng-yt-player/dist/ng-yt-player.js.

Getting Started

Add reference to ng-yt-player

<script src="/bower_components/ng-yt-player/dist/ng-yt-player.js"></script>

Where you declare your app module, add ng-yt-player:

angular.module('myApp',[
	'ng-yt-player',
]);

In your javascript file within the controller where you plan to use ng-yt-player, declare:

angular.controller('home',function($scope,YouTubePlayerConfig){
  //YouTube player configuration
	$scope.playerConfig = new YouTubePlayerConfig(
		{playerVars : {autoplay: 0}, width: '100%',}
  );
});  

In your html file within the controller where you plan to use ng-yt-player, add:

 <you-tube-player yt-video-id="bfPdFzkPqmU" yt-player-config="playerConfig"></you-tube-player>

Customization

You can use all availables parameters for the HTML5 YouTube Players described here

Simply specify your custom configuration in the playerConfig object within your controller, like this:

 $scope.playerConfig = new YouTubePlayerConfig(
		{ playerVars : {autoplay: 0}, 
		  width: '100%',
		  height: '350px',
			events: {
        'onReady': onPlayerReady,
        'onStateChange': onPlayerStateChange
      }
  );

More information on Player Configuration and available events can be found here

FAQs

Package last updated on 06 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc