Socket
Socket
Sign inDemoInstall

media-playlist

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

2

dist/media-playlist.js

@@ -1,1 +0,1 @@

const e=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],t={addTextTrack:{type:"function"},audioTracks:{type:"object",readOnly:!0},autoplay:{type:"boolean"},buffered:{type:"object",readOnly:!0},canPlayType:{type:"function",default:""},controls:{type:"boolean"},crossOrigin:{type:"string"},currentSrc:{type:"string",readOnly:!0},currentTime:{type:"number",default:0},defaultMuted:{type:"boolean"},duration:{type:"number",readOnly:!0,default:NaN},fastSeek:{type:"function"},load:{type:"function"},networkState:{type:"number",readOnly:!0,default:0},pause:{type:"function"},paused:{type:"boolean",readOnly:!0,default:!0},play:{type:"function"},playbackRate:{type:"number"},played:{type:"object",readOnly:!0},poster:{type:"string",default:""},preload:{type:"string",default:"metadata"},readyState:{type:"number",readOnly:!0,default:0},seekable:{type:"object",readOnly:!0},src:{type:"string"},textTracks:{type:"object",readOnly:!0},videoHeight:{type:"number",readOnly:!0},videoWidth:{type:"number",readOnly:!0},videoTracks:{type:"object",readOnly:!0},volume:{type:"number",default:1}},n=document.createElement("template");n.innerHTML='\n<style>\n:host {\n display: block;\n position: relative;\n min-width: 450px;\n min-height: 300px;\n}\n\n#currentMedia {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n</style>\n\n<div id="container"></div>\n';class a extends HTMLElement{}window.customElements.get("media-playlist-item")||window.customElements.define("media-playlist-item",a);class r extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(n.content.cloneNode(!0))}connectedCallback(){this.currentItem=this.querySelector("media-playlist-item"),this.getAttribute("autoplay")&&this.play()}disconnectedCallback(){}get currentItem(){return this.querySelector("media-playlist-item[current]")||null}set currentItem(t){let n=this.currentItem,a=this.shadowRoot.querySelector("#currentMedia");if(n&&n.removeAttribute("current"),a){a.pause();a.playlistEventHandlers.forEach(e=>{a.removeEventListener(e[0],e[1])}),a.playlistEventHandlers=[],this.shadowRoot.querySelector("#container").innerHTML=""}if(n=t,t){const n=document.createElement(t.getAttribute("type"));n.id="currentMedia";for(let e=0,a=t.attributes.length;e<a;e++){const a=t.attributes[e];n.setAttribute(a.nodeName,a.value)}n.playlistEventHandlers=[];const a=e=>{this.next()};n.addEventListener("ended",a,!1),n.playlistEventHandlers.push(["ended",a]),e.forEach(e=>{if("ended"===e)return;const t=t=>{this.dispatchEvent(new CustomEvent(e))};n.addEventListener(e,t,!1),n.playlistEventHandlers.push([e,t])}),t.childNodes.forEach(e=>{const t=e.cloneNode(!0);n.appendChild(t)}),this.shadowRoot.querySelector("#container").appendChild(n),t.setAttribute("current","")}}next(){var e=Array.prototype.slice.call(this.querySelectorAll("media-playlist-item")),t=e[e.indexOf(this.currentItem)+1];t||null===this.getAttribute("loop")||(t=e[0]),t?(this.currentItem=t,this.play()):(this.currentItem=null,this.dispatchEvent(new Event("ended")))}previous(){var e=Array.prototype.slice.call(this.querySelectorAll("media-playlist-item")),t=e[e.indexOf(this.currentItem)-1];t||null===this.getAttribute("loop")||(t=e[e.length-1]),t&&(this.currentItem=t,this.play())}get autoplay(){}set autoplay(e){}get controls(){}set controls(e){}get crossOrigin(){}set crossOrigin(e){}get defaultMuted(){}set defaultMuted(e){}get defaultPlaybackRate(){}set defaultPlaybackRate(e){}get ended(){}get muted(){}set muted(e){}get src(){}set src(e){}}function i(e){return e.shadowRoot.querySelector("#currentMedia")}Object.keys(t).forEach(e=>{const n=t[e];if(r.prototype[e])return;if("function"==n.type)return void(r.prototype[e]=function(){const t=i(this);return t[e].apply(t,arguments)});const a={get:function(){return i(this)[e]}};n.readOnly||(a.set=function(t){i(this)[e]=t}),Object.defineProperty(r.prototype,e,a)}),window.customElements.get("media-playlist")||(window.customElements.define("media-playlist",r),window.MediaPlaylist=r);export{r as default};
const e=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],t={addTextTrack:{type:"function"},audioTracks:{type:"object",readOnly:!0},autoplay:{type:"boolean"},buffered:{type:"object",readOnly:!0},canPlayType:{type:"function",default:""},controls:{type:"boolean"},crossOrigin:{type:"string"},currentSrc:{type:"string",readOnly:!0},currentTime:{type:"number",default:0},defaultMuted:{type:"boolean"},duration:{type:"number",readOnly:!0,default:NaN},fastSeek:{type:"function"},load:{type:"function"},networkState:{type:"number",readOnly:!0,default:0},pause:{type:"function"},paused:{type:"boolean",readOnly:!0,default:!0},play:{type:"function"},playbackRate:{type:"number"},played:{type:"object",readOnly:!0},poster:{type:"string",default:""},preload:{type:"string",default:"metadata"},readyState:{type:"number",readOnly:!0,default:0},seekable:{type:"object",readOnly:!0},src:{type:"string"},textTracks:{type:"object",readOnly:!0},videoHeight:{type:"number",readOnly:!0},videoWidth:{type:"number",readOnly:!0},videoTracks:{type:"object",readOnly:!0},volume:{type:"number",default:1}},n=document.createElement("template");n.innerHTML='\n<style>\n:host {\n display: block;\n position: relative;\n min-width: 450px;\n min-height: 300px;\n}\n\n#currentMedia {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n</style>\n\n<div id="container"></div>\n';class a extends HTMLElement{}window.customElements.get("media-playlist-item")||window.customElements.define("media-playlist-item",a);class r extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(n.content.cloneNode(!0))}connectedCallback(){this.currentItem=this.querySelector("media-playlist-item"),this.getAttribute("autoplay")&&this.play()}disconnectedCallback(){}get currentItem(){return this.querySelector("media-playlist-item[current]")||null}set currentItem(t){let n=this.currentItem,a=this.shadowRoot.querySelector("#currentMedia");if(n&&n.removeAttribute("current"),a){a.pause();a.playlistEventHandlers.forEach(e=>{a.removeEventListener(e[0],e[1])}),a.playlistEventHandlers=[],this.shadowRoot.querySelector("#container").innerHTML=""}if(n=t,t){const n=document.createElement(t.getAttribute("type"));n.id="currentMedia";for(let e=0,a=t.attributes.length;e<a;e++){const a=t.attributes[e];"type"!==a.nodeName&&n.setAttribute(a.nodeName,a.value)}n.playlistEventHandlers=[];const a=e=>{this.next()};n.addEventListener("ended",a,!1),n.playlistEventHandlers.push(["ended",a]),e.forEach(e=>{if("ended"===e)return;const t=t=>{this.dispatchEvent(new CustomEvent(e))};n.addEventListener(e,t,!1),n.playlistEventHandlers.push([e,t])}),t.childNodes.forEach(e=>{const t=e.cloneNode(!0);n.appendChild(t)}),this.shadowRoot.querySelector("#container").appendChild(n),t.setAttribute("current","")}}next(){var e=Array.prototype.slice.call(this.querySelectorAll("media-playlist-item")),t=e[e.indexOf(this.currentItem)+1];t||null===this.getAttribute("loop")||(t=e[0]),t?(this.currentItem=t,this.play()):(this.currentItem=null,this.dispatchEvent(new Event("ended")))}previous(){var e=Array.prototype.slice.call(this.querySelectorAll("media-playlist-item")),t=e[e.indexOf(this.currentItem)-1];t||null===this.getAttribute("loop")||(t=e[e.length-1]),t&&(this.currentItem=t,this.play())}get autoplay(){}set autoplay(e){}get controls(){}set controls(e){}get crossOrigin(){}set crossOrigin(e){}get defaultMuted(){}set defaultMuted(e){}get defaultPlaybackRate(){}set defaultPlaybackRate(e){}get ended(){}get muted(){}set muted(e){}get src(){}set src(e){}}function i(e){return e.shadowRoot.querySelector("#currentMedia")}Object.keys(t).forEach(e=>{const n=t[e];if(r.prototype[e])return;if("function"==n.type)return void(r.prototype[e]=function(){const t=i(this);return t[e].apply(t,arguments)});const a={get:function(){return i(this)[e]}};n.readOnly||(a.set=function(t){i(this)[e]=t}),Object.defineProperty(r.prototype,e,a)}),window.customElements.get("media-playlist")||(window.customElements.define("media-playlist",r),window.MediaPlaylist=r);export{r as default};
{
"name": "media-playlist",
"version": "0.1.0",
"version": "0.1.1",
"description": "Play through a set of video and audio elements.",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc