Package Exports
- sirv-media-viewer-script
- sirv-media-viewer-script/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sirv-media-viewer-script) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Sirv Media Viewer script loader
You can add Sirv Media Viewer script to your page as the documentation recommends or you can use this module.
This module adds Sirv Media Viewer script to page once.
install
npm install --save sirv-media-viewer-scriptusage
import loadSMVScript from 'sirv-media-viewer-script';
loadSMVScript().then((sirv) => {
// script is loaded
});
API
promise = loadSMVScript([attrs], [parentNode])
Append a <script> node with 'https://scripts.sirv.com/sirvjs/v3/sirv.js' URL to the <head> element in the DOM.
attrs (optional)
More about it you can find here
parentNode (optional)
More about it you can find here
promise
Returns a promise which resolves to the sirv object, or rejects with err if any occurred.