New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-youtube

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-youtube

Youtube API for Angular2, using google oAuth2. Compatible with latest release of Angular

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ngx-youtube

Youtube API for Angular2, using google oAuth2. Compatible with latest release of AngularJs

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Before starting to use fresh module make sure you have already created your client-id, if you don't have the ID please see here. If you are going to create client-id for hybrid apps like ionic, then make sure you have add "restrictions" like

Installing

npm install ngx-youtube

Configuration

After installation connect YTApiModule the top of your main app module

import { YTApiModule } from 'ngx-youtube';

and connect it in imports section with clientID

@NgModule({
imports: [
    YTApiModule.setConfig(
          {
            clientId: "xxxxx-yyyyyy.apps.googleusercontent.com",
            discoveryDocs: ["https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest"],
            scope: "https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtubepartner"
          }
        )
    ]
})

How to use

Now you can connect YT service to your every component

import {YTApiService} from 'ngx-youtube'
export class TestPage {
@Component({
  selector: '......',
  templateUrl: '....'
})
constructor(private YTS: YTApiService) {}

doSearch(keyword){
    let request = this.YTS.search(keyword, 25, 'video');
    request.execute(res=>{
        console.log(res);
    }):
}

Possible functions

auth()

function to do Authorization

parameterstype
eventrequired
<button (click)="doLogin($event)">Authorize</button>
.......
doLogin(ev){
    console.log(this.YTS.auth(ev));
  }
parameterstypeDescription
keywordrequiredkeyword which need to be search. example car
limitrequiredThe limit of result. example 25
typerequiredThe type of search result. example 'video'/'channel'
partoptionalThe information of search result. example 'snippet'
getChannelByID()
parameterstypeDescription
IDrequiredChannel ID which need to be find. example UCPg3xfvygstC-AkG2Fg3ZXw
partoptionalThe information of search result. example 'snippet'/'snippet,statistics'
let YT_channel = this.YTS.getChannelByID(channel_ID,'snippet,statistics');
getVideosByID()
parameterstypeDescription
IDrequiredVideo ID or multiple ID's as string. example '4vkc-Lbcl64'/'Ks-_Mh1QhMc,c0KYU2j0TM4,eIho2S0ZahI'
partoptionalThe information of search result. example 'snippet'/'snippet,statistics'/'snippet,contentDetails,statistics'
 let YT_video_detailed = this.YTS.getVideosByID(videoId,'snippet,statistics');
getMostPopular()

funtion will return most popular videos based on region and categoryID

parameterstypeDescription
regionCoderequiredThe region from where need to get most popular videos. example 'AM'
videoCategoryIdrequiredThe category from where need to get most popular videos. example 17. To see all categories by ID see here
partoptionalThe information of search result. example 'snippet'/'snippet,statistics'/'snippet,contentDetails,statistics'
getAuthLiked()

funtion will return liked videos which are liked from authorized user

parameterstypeDescription
partoptionalThe information of search result. example 'snippet'/'snippet,statistics'/'snippet,contentDetails,statistics'

Deployment

Sorry, but this option is not possible for now

Version - 1.1.0

We are working harder to get all need functionlity in one module, so functionlity will be updated suddenly.

Author

License

This project is licensed under the ISC License - see the LICENSE for details

ThankYou

Thank you for your support and udnerstanding, new functions will be updated soon.

Keywords

FAQs

Package last updated on 04 Jul 2017

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