
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
photoswipe-video-plugin
Advanced tools
The plugin is under development and for now now supports only <video>
tag.
The plugin requires a single JS file (grab it from dist/photoswipe-video-plugin.esm.js
) and can be initialized like this:
<script type="module">
import PhotoSwipeLightbox from './lib/photoswipe/photoswipe-lightbox.esm.js';
import PhotoSwipeVideoPlugin from './dist/photoswipe-video-plugin.esm.js';
const lightbox = new PhotoSwipeLightbox({
gallery: '#gallery',
children: 'a',
pswpModule: './lib/photoswipe/photoswipe.esm.js',
});
const videoPlugin = new PhotoSwipeVideoPlugin(lightbox, {
// options
});
lightbox.init();
</script>
If you're using just one format:
<a
href="my-video.mp4"
data-pswp-video-src="my-video.mp4"
data-pswp-width="800"
data-pswp-height="600"
data-pswp-type="video">
<img src="poster.jpg" alt="" />
</a>
data-pswp-video-src
is optional, if it's not defined - href
attribute will be used.
Attributes data-pswp-width
, data-pswp-height
and data-pswp-type
are required.
If you're serving multiple formats use data-pswp-video-sources
attribute that accepts JSON strignified array:
<a
href="my-video.mp4"
data-pswp-width="800"
data-pswp-height="600"
data-pswp-type="video"
data-pswp-video-sources='[{"src":"my-video.webm","type":"video/webm"},{"src":"my-video.mp4","type":"video/mp4"}]'>
<img src="poster.jpg" alt="" />
</a>
If you're providing the data directly via object:
{
width: 800,
height: 600,
type: 'video',
msrc: 'poster.jpg',
// if you're using just one source
videoSrc: 'my-video.mp4',
// Or for multiple sources;
// videoSrc: [
// { src: 'my-video.webm', type: 'video/webm' },
// { src: 'my-video.mp4', type: 'video/mp4' }
// ]
}
FAQs
PhotoSwipe Video Plugin
We found that photoswipe-video-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.