Angular Video Embed
A simple directive for angular 1.x that makes embedding videos from various services easier.
Currently supported:
Installation
Install via npm - In the terminal:
npm install angular-video-embed --save
Include the module in your main app
angular;
You must include the video service's library script in order to use that service
<!-- YOUTUBE --> <!-- VIMEO --> <!-- VIDDLER -->
Usage
Loading a video
Method 1 - Passing an object
Javascript
$scopevideo = id: "49222355" service: "vimeo";
HTML
Method 2 - Passing a video URL
Javascript
$scopeurl = "https://www.youtube.com/watch?v=iNJdPyoqt8U";
HTML
Registering event callbacks
Javascript
$scopeurl = "https://www.youtube.com/watch?v=iNJdPyoqt8U";$scope {console;}$scope {console;}$scope {console;}$scope {console;} // Only supported on Youtube$scope {console;}
HTML
Gaining access to the Player Library Instance
Javascript
// Each event callback receives a "Player Wrapper" instance which contains the underlying player library instance.$scope { ifplayervideoservice === "youtube" playerplayer; }
Contributing
Contributions are always welcome! If you would like to have another service added to the list please request it by opening up an issue or sending a pull request