Comparing version
/*! | ||
* @license MIT | ||
* @name vlitejs | ||
* @version 4.0.6 | ||
* @version 4.0.7 | ||
* @copyright 2022 Joris DANIEL | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VlitejsPip=t():e.VlitejsPip=t()}(globalThis,(()=>(()=>{var e={391:function(e,t,i){var n,r,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n=[i,t,i(377)],r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i=o(i);t.default=class{constructor({player:e}){this.providers=["html5"],this.types=["video"],this.player=e,this.onClickOnPipButton=this.onClickOnPipButton.bind(this),this.onEnterPip=this.onEnterPip.bind(this),this.onLeavePip=this.onLeavePip.bind(this)}init(){this.isPipApiAvailable()&&this.player.options.controls&&(this.render(),this.pipButton=this.player.elements.container.querySelector(".v-pipButton"),this.addEvents())}isPipApiAvailable(){return"pictureInPictureEnabled"in document&&!this.player.media.hasAttribute("disablePictureInPicture")}render(){const e=`<button class="v-pipButton v-controlButton">${i.default}</button>`,t=this.player.elements.container.querySelector(".v-controlBar"),n=this.player.elements.container.querySelector(".v-fullscreenButton");t&&(n?n.insertAdjacentHTML("beforebegin",e):t.insertAdjacentHTML("beforeend",e))}addEvents(){this.pipButton.addEventListener("click",this.onClickOnPipButton),this.player.media.addEventListener("enterpictureinpicture",this.onEnterPip),this.player.media.addEventListener("leavepictureinpicture",this.onLeavePip)}async onClickOnPipButton(e){e.preventDefault();try{this.player.media!==document.pictureInPictureElement?await this.player.media.requestPictureInPicture():await document.exitPictureInPicture()}catch(e){console.warn(`vlitejs :: ${e}`)}}onEnterPip(e){this.player.dispatchEvent("enterpip")}onLeavePip(e){this.player.dispatchEvent("leavepip")}}}.apply(t,n),void 0===r||(e.exports=r)},377:e=>{"use strict";e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path d="M19 11h-8v6h8v-6zm-2 4h-4v-2h4v2zm4-12H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V4.98C23 3.88 22.1 3 21 3zm0 16.02H3V4.97h18v14.05z"/></svg>\n'}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";i.d(n,{default:()=>t});var e=i(391);const t=i.n(e)()})(),n=n.default})())); |
/*! | ||
* @license MIT | ||
* @name vlitejs | ||
* @version 4.0.6 | ||
* @version 4.0.7 | ||
* @copyright 2022 Joris DANIEL | ||
@@ -6,0 +6,0 @@ */ |
/*! | ||
* @license MIT | ||
* @name vlitejs | ||
* @version 4.0.6 | ||
* @version 4.0.7 | ||
* @copyright 2022 Joris DANIEL | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VlitejsVimeo=t():e.VlitejsVimeo=t()}(globalThis,(()=>{return e={868:(e,t,i)=>{var n;n=function(e,t){"use strict";t.default=function(e){if(window.VlitejsVimeoQueue=window.VlitejsVimeoQueue||[],void 0===window.Vimeo){const e=document.createElement("script");e.async=!0,e.type="text/javascript",e.src="https://player.vimeo.com/api/player.js",e.onload=()=>{window.VlitejsVimeoQueue.forEach((e=>{e.initVimeoPlayer().then((()=>{e.addSpecificEvents(),e.onReady()}))})),window.VlitejsVimeoQueue=[]},document.getElementsByTagName("body")[0].appendChild(e)}return class extends e{constructor(e){super(e);const t={id:this.media.getAttribute("data-vimeo-id"),playsinline:this.options.playsinline?1:0,loop:this.options.loop?1:0,controls:!1};this.params=Object.assign(Object.assign({},t),this.options.providerParams),this.events=[{type:"timeupdate",listener:super.onTimeUpdate},{type:"ended",listener:super.onMediaEnded},{type:"playing",listener:this.onPlaying},{type:"waiting",listener:this.onWaiting},{type:"seeking",listener:this.onSeeking},{type:"seeked",listener:this.onSeeked}]}init(){this.waitUntilVideoIsReady().then((()=>{this.addSpecificEvents(),super.onReady()}))}waitUntilVideoIsReady(){return new window.Promise(((e,t)=>{void 0!==window.Vimeo?this.initVimeoPlayer().then(e):window.VlitejsVimeoQueue.push(this)}))}initVimeoPlayer(){return new window.Promise(((e,t)=>{this.instance=new window.Vimeo.Player(this.media.getAttribute("id"),this.params),this.media=this.instance.element,this.instance.ready().then((()=>{this.media.firstElementChild.setAttribute("tabindex","-1"),e()}))}))}addSpecificEvents(){this.events.forEach((e=>{this.instance.on(e.type,e.listener.bind(this))}))}getInstance(){return this.instance}getCurrentTime(){return new window.Promise((e=>{this.instance.getCurrentTime().then((t=>e(t)))}))}getDuration(){return new window.Promise((e=>{this.instance.getDuration().then((t=>e(t)))}))}methodPlay(){this.instance.play()}methodPause(){this.instance.pause()}methodSetVolume(e){this.instance.setVolume(e)}methodGetVolume(){return new window.Promise((e=>{this.instance.getVolume().then((t=>{e(t)}))}))}methodMute(){this.instance.setVolume(0)}methodUnMute(){this.instance.setVolume(1)}methodSeekTo(e){this.instance.setCurrentTime(e)}onWaiting(){this.loading(!0)}onPlaying(){this.loading(!1)}onSeeking(){this.loading(!0)}onSeeked(){this.loading(!1)}removeSpecificEvents(){this.events.forEach((e=>{this.instance.off(e.type,e.listener)}))}destroy(){this.removeSpecificEvents(),this.instance.destroy(),super.destroy()}}}}.apply(t,[i,t]),void 0===n||(e.exports=n)}},t={},i=function i(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}(868),i=i.default;var e,t,i})); |
/*! | ||
* @license MIT | ||
* @name vlitejs | ||
* @version 4.0.6 | ||
* @version 4.0.7 | ||
* @copyright 2022 Joris DANIEL | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VlitejsYoutube=t():e.VlitejsYoutube=t()}(globalThis,(()=>{return e={277:(e,t,i)=>{var n;n=function(e,t){"use strict";t.default=function(e){if(window.VlitejsYoutubeQueue=window.VlitejsYoutubeQueue||[],void 0===window.YT){const e=document.createElement("script");e.async=!0,e.type="text/javascript",e.src="https://youtube.com/iframe_api",window.onYouTubeIframeAPIReady=()=>{window.VlitejsYoutubeQueue.forEach((e=>{e.initYoutubePlayer().then((()=>{e.onReady()}))})),window.VlitejsYoutubeQueue=[]},document.getElementsByTagName("body")[0].appendChild(e)}return class extends e{constructor(e){super(e);const t={autohide:1,controls:0,fs:this.options.fullscreen?1:0,modestbranding:0,playsinline:this.options.playsinline?1:0,rel:0,showinfo:0,wmode:"transparent"};this.params=Object.assign(Object.assign({},t),this.options.providerParams)}init(){this.waitUntilVideoIsReady().then((()=>{super.onReady()}))}waitUntilVideoIsReady(){return new window.Promise(((e,t)=>{void 0!==window.YT?this.initYoutubePlayer().then(e):window.VlitejsYoutubeQueue.push(this)}))}initYoutubePlayer(){return new window.Promise(((e,t)=>{this.instance=new window.YT.Player(this.media.getAttribute("id"),{videoId:this.media.getAttribute("data-youtube-id"),height:"100%",width:"100%",playerVars:this.params,events:{onReady:t=>{this.media=t.target.getIframe(),e()},onStateChange:e=>this.onPlayerStateChange(e)}})}))}onPlayerStateChange(e){switch(this.rafPlaying&&window.cancelAnimationFrame(this.rafPlaying),e.data){case window.YT.PlayerState.ENDED:super.onMediaEnded();break;case window.YT.PlayerState.PLAYING:super.loading(!1),this.options.controls&&window.requestAnimationFrame(this.onRafPlaying.bind(this));break;case window.YT.PlayerState.BUFFERING:super.loading(!0)}}onRafPlaying(){super.onTimeUpdate(),this.isPaused||(this.rafTimeout=setTimeout((()=>{this.rafPlaying=window.requestAnimationFrame(this.onRafPlaying.bind(this))}),100))}getInstance(){return this.instance}getCurrentTime(){return new window.Promise((e=>e(this.instance.getCurrentTime())))}getDuration(){return new window.Promise((e=>e(this.instance.getDuration())))}methodPlay(){this.instance.playVideo()}methodPause(){this.instance.pauseVideo()}methodSetVolume(e){this.instance.setVolume(100*e)}methodGetVolume(){return new window.Promise((e=>e(this.instance.getVolume()/100)))}methodMute(){this.instance.mute()}methodUnMute(){this.instance.unMute()}methodSeekTo(e){this.instance.seekTo(e),super.onTimeUpdate()}destroy(){clearTimeout(this.rafTimeout),this.instance.destroy(),super.destroy()}}}}.apply(t,[i,t]),void 0===n||(e.exports=n)}},t={},i=function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}(277),i=i.default;var e,t,i})); |
/*! | ||
* @license MIT | ||
* @name vlitejs | ||
* @version 4.0.6 | ||
* @version 4.0.7 | ||
* @copyright 2022 Joris DANIEL | ||
@@ -6,0 +6,0 @@ */ |
{ | ||
"name": "vlitejs", | ||
"version": "4.0.6", | ||
"version": "4.0.7", | ||
"description": "vLitejs is a fast and lightweight Javascript library for customizing video and audio player in Javascript with a minimalist theme (HTML5, Youtube, Vimeo)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%73098
-7.52%10
-9.09%