Skip to content

exinfinite/videoPause

Repository files navigation

Video Pause & Play by IntersectionObserver

GitHub package.json version GitHub file size in bytes GitHub GitHub all releases Netlify Status

範例及代碼

線上範例

Sample code

Production

<script src='./dist/video-pause.prod.js'></script>
vid_pause.init({
    html5: true,//default
    yt: true,//default
    options: { threshold: 0.5 }
});
//options 參考 https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#Intersection_observer_concepts_and_usage

Development with webpack-dev-server

npm run start

Build

npm run build