Skip to content

rbingham/videoScroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

videoScroll

Bower version

Video Scroll is an angular directive to allow for playing an html5 video while you scroll.

Installation

bower install angular-videoScroll --save

Code Examples

Include videoScroll as a dependency of your angular module.

angular.module('yourModule', ['videoScroll']);

Add the play-video attribute to the video you want to play.

<video id="v0" tabindex="0" autobuffer="autobuffer" preload="preload" play-video>
</video>

To change the scroll speed of the video add the time attribute. Note: The default time is .15 seconds.

<video id="v0" tabindex="0" autobuffer="autobuffer" preload="preload" play-video time=".15">
</video>

To change when the video starts playing relative to the top of the screen (in pixels), use the offset attribute.

<video id="v0" tabindex="0" autobuffer="autobuffer" preload="preload" play-video offset="100">
</video>

To change whether normal scrolling is disabled while the video is playing, add the preventScroll option. Default is set to true.

<video id="v0" tabindex="0" autobuffer="autobuffer" preload="preload" play-video preventScroll="true">
</video>

License

Video Scroll is an open-sourced software licensed under the MIT licence