Skip to content

simply201051/ps-youtube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 

Repository files navigation

ps-youtube

AngularJS lazy load youtube video

Usage

-load js

<script src="./angular.js"></script>
<script src="./angular-youtube.min.js"></script>

-module

angular.module('MyApp', ['ps-youtube'])

-html

<!-- use variable -->
<div ps-youtube="player" video-id="video.id"></div>
<!-- or string -->
<div ps-youtube video-id="'your video id'"></div>

Directive options

  • ps-youtube player
  • video-id video id is required
  • video-name video name add this attribute to <img alt="videoName">
  • video-quality image quality
    1. mq 320×180
    2. hq 480×360
    3. sd 640×480 default
    4. maxres 1920×1080
  • player-options default { autoplay: 1, rel: 0 }
    refer youtube player parameters

Reference

 How to “Lazy Load” Embedded YouTube Videos

About

AngularJS 延遲載入 Youtube 影片

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published