ng-videosharing-embed

Embed videos using AngularJS directives

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ng-videosharing-embed
97140.3.67 years ago7 years agoMinified + gzip package size for ng-videosharing-embed in KB

Readme

ng-videosharing-embed
Embed videos using AngularJS directives Build Status

Purpose

A small project I've started while learning angularJS. It has no real purpose other than educational. Donate

Examples

http://erost.net/ng-videosharing-embed/

Usage

Install

  • $ bower install ng-videosharing-embed
  • $ npm install ng-videosharing-embed
Once installed, add videosharing-embed as a dependency in your module:
  • angular.module('myModule', ['videosharing-embed']);

Requirements

  • AngularJS v1.2.0+ is supported

Supported Video Sources

  • Youtube (standard and nocookies, iframe, JS API support)
  • Dailymotion (iframe, JS API support)
  • Vimeo (iframe, JS API support)
  • Youku (iframe, tentative)
  • Vine (iframe, with embed script)
Note on JS API: Each iframe should be identified with a unique id. That ID can be configured by iframe-id Example ```html id="vimeo1" ng-href="//vimeo.com/111690998">Watch ```

Test

Generic ```html options> ``` Example ```html Watch ``` Callback example ```html Watch ``` ```js ... $scope.videoSelected = function(videoId, provider) {
if (videoId) {
console.log("Video from " + provider + " with id " + videoId + " was selected");
} else {
console.log("No valid URL entered");
}
} ... ``` Player's options are unique for each video source. For a list of available options, take a look at src/angular-embedplayer.js, or the player official documentation