Skip to content

mehmettamturk/YoutubeDirective

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Youtube Search Module

An Angular.js module to search videos from Youtube.

##How To Use

In first step, you need to inject YoutubeModule from your app file as dependency.

angular.module('myApp', ['YoutubeModule', 'myApp.controllers'])

In YoutubeModule.js file, you can see config object. You can easily change player attributes from config file.

var config = {
    videoId: 'cVU8rS7JKNM', // Initial video id.
    playerHeight: 390, // Youtube player height.
    playerWidth: 640, // Youtube player width.
    quality: 'hd720' // Youtube player video quality if video has that quality.
};

Now you can use youtube-search element. It has two attribute for ng-model and video preview.

  • preview attribute: There will be a video player when you search videos if it is true.
  • target-model-class attribute: Class name of related ng-model element.
 <youtube-search target-model-class="targetModelClassName" preview="true"></youtube-search>
 
 <input class="targetModelClassName" ng-model="selectedYoutubeId"/>

In this example, when you click on a video from search, id of the selected video will assigned to selectedYoutubeId variable.


About

Youtube Search Directive for AngularJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published