Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@vimeo/player

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vimeo/player - npm Package Compare versions

Comparing version 2.18.0 to 2.19.0

4

dist/player.min.js

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

/*! @vimeo/player v2.18.0 | (c) 2022 Vimeo | MIT License | https://github.com/vimeo/player.js */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).Vimeo=e.Vimeo||{},e.Vimeo.Player=t())}(this,function(){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var e="undefined"!=typeof global&&"[object global]"==={}.toString.call(global);function i(e,t){return 0===e.indexOf(t.toLowerCase())?e:"".concat(t.toLowerCase()).concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}function l(e){return/^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(e)}function c(e){return/^https:\/\/player\.vimeo\.com\/video\/\d+/.test(e)}function s(e){var t,n=0<arguments.length&&void 0!==e?e:{},r=n.id,o=n.url,i=r||o;if(!i)throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");if(t=i,!isNaN(parseFloat(t))&&isFinite(t)&&Math.floor(t)==t)return"https://vimeo.com/".concat(i);if(l(i))return i.replace("http:","https:");if(r)throw new TypeError("“".concat(r,"” is not a valid video id."));throw new TypeError("“".concat(i,"” is not a vimeo.com url."))}var t=void 0!==Array.prototype.indexOf,n="undefined"!=typeof window&&void 0!==window.postMessage;if(!(e||t&&n))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var o,a,u,f,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(f(this,"_id","_WeakMap_"+m()+"."+m()),0<arguments.length)throw new TypeError("WeakMap iterable is not supported")}function v(e,t){if(!p(e)||!a.call(e,"_id"))throw new TypeError(t+" method called on incompatible receiver "+typeof e)}function m(){return Math.random().toString().substring(2)}function p(e){return Object(e)===e}(o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:d).WeakMap||(a=Object.prototype.hasOwnProperty,u=Object.defineProperty&&function(){try{return 1===Object.defineProperty({},"x",{value:1}).x}catch(e){}}(),f=function(e,t,n){u?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n}):e[t]=n},o.WeakMap=(f(h.prototype,"delete",function(e){if(v(this,"delete"),!p(e))return!1;var t=e[this._id];return!(!t||t[0]!==e)&&(delete e[this._id],!0)}),f(h.prototype,"get",function(e){if(v(this,"get"),p(e)){var t=e[this._id];return t&&t[0]===e?t[1]:void 0}}),f(h.prototype,"has",function(e){if(v(this,"has"),!p(e))return!1;var t=e[this._id];return!(!t||t[0]!==e)}),f(h.prototype,"set",function(e,t){if(v(this,"set"),!p(e))throw new TypeError("Invalid value used as weak map key");var n=e[this._id];return n&&n[0]===e?n[1]=t:f(e,this._id,[e,t]),this}),f(h,"_polyfill",!0),h));var g,y=(function(e){var t,n,r;r=function(){var t,n,r,o,i,a,e=Object.prototype.toString,u="undefined"!=typeof setImmediate?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(e){t=function(e,t,n){return e[t]=n,e}}function c(e,t){this.fn=e,this.self=t,this.next=void 0}function l(e,t){r.add(e,t),n=n||u(r.drain)}function s(e){var t,n=typeof e;return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function f(){for(var e=0;e<this.chain.length;e++)!function(e,t,n){var r,o;try{!1===t?n.reject(e.msg):(r=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(o=s(r))?o.call(r,n.resolve,n.reject):n.resolve(r)}catch(e){n.reject(e)}}(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function d(e){var n,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(n=s(e))?l(function(){var t=new m(r);try{n.call(e,function(){d.apply(t,arguments)},function(){h.apply(t,arguments)})}catch(e){h.call(t,e)}}):(r.msg=e,r.state=1,0<r.chain.length&&l(f,r))}catch(e){h.call(new m(r),e)}}}function h(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,0<t.chain.length&&l(f,t))}function v(e,n,r,o){for(var t=0;t<n.length;t++)!function(t){e.resolve(n[t]).then(function(e){r(t,e)},o)}(t)}function m(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function g(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var r=new p(this);this.then=function(e,t){var n={success:"function"!=typeof e||e,failure:"function"==typeof t&&t};return n.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t}),r.chain.push(n),0!==r.state&&l(f,r),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){d.call(r,e)},function(e){h.call(r,e)})}catch(e){h.call(r,e)}}var y=t({},"constructor",g,!(r={add:function(e,t){a=new c(e,t),i?i.next=a:o=a,i=a,a=void 0},drain:function(){var e=o;for(o=i=n=void 0;e;)e.fn.call(e.self),e=e.next}}));return t(g.prototype=y,"__NPO__",0,!1),t(g,"resolve",function(n){return n&&"object"==typeof n&&1===n.__NPO__?n:new this(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");e(n)})}),t(g,"reject",function(n){return new this(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");t(n)})}),t(g,"all",function(t){var a=this;return"[object Array]"!=e.call(t)?a.reject(TypeError("Not an array")):0===t.length?a.resolve([]):new a(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");var r=t.length,o=Array(r),i=0;v(a,t,function(e,t){o[e]=t,++i===r&&n(o)},e)})}),t(g,"race",function(t){var r=this;return"[object Array]"!=e.call(t)?r.reject(TypeError("Not an array")):new r(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");v(r,t,function(e,t){n(t)},e)})}),g},(n=d)[t="Promise"]=n[t]||r(),e.exports&&(e.exports=n[t])}(g={exports:{}}),g.exports),w=new WeakMap;function b(e,t,n){var r=w.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),w.set(e.element,r)}function k(e,t){return(w.get(e.element)||{})[t]||[]}function E(e,t,n){var r=w.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],w.set(e.element,r),!0;var o=r[t].indexOf(n);return-1!==o&&r[t].splice(o,1),w.set(e.element,r),r[t]&&0===r[t].length}function T(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function P(e,t,n){var r,o;e.element.contentWindow&&e.element.contentWindow.postMessage&&(r={method:t},void 0!==n&&(r.value=n),8<=(o=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1")))&&o<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin))}function _(n,r){var t,e,o=[];(r=T(r)).event?("error"===r.event&&k(n,r.data.method).forEach(function(e){var t=new Error(r.data.message);t.name=r.data.name,e.reject(t),E(n,r.data.method,e)}),o=k(n,"event:".concat(r.event)),t=r.data):!r.method||(e=function(e,t){var n=k(e,t);if(n.length<1)return!1;var r=n.shift();return E(e,t,r),r}(n,r.method))&&(o.push(e),t=r.value),o.forEach(function(e){try{if("function"==typeof e)return void e.call(n,t);e.resolve(t)}catch(e){}})}var M=["autopause","autoplay","background","byline","color","controls","dnt","height","id","interactive_params","keyboard","loop","maxheight","maxwidth","muted","playsinline","portrait","responsive","speed","texttrack","title","transparent","url","width"];function N(r,e){var t=1<arguments.length&&void 0!==e?e:{};return M.reduce(function(e,t){var n=r.getAttribute("data-vimeo-".concat(t));return!n&&""!==n||(e[t]=""===n?1:n),e},t)}function F(e,t){var n=e.html;if(!t)throw new TypeError("An element must be provided");if(null!==t.getAttribute("data-vimeo-initialized"))return t.querySelector("iframe");var r=document.createElement("div");return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute("data-vimeo-initialized","true"),t.querySelector("iframe")}function x(i,e,t){var a=1<arguments.length&&void 0!==e?e:{},u=2<arguments.length?t:void 0;return new Promise(function(t,n){if(!l(i))throw new TypeError("“".concat(i,"” is not a vimeo.com url."));var e="https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(i));for(var r in a)a.hasOwnProperty(r)&&(e+="&".concat(r,"=").concat(encodeURIComponent(a[r])));var o=new("XDomainRequest"in window?XDomainRequest:XMLHttpRequest);o.open("GET",e,!0),o.onload=function(){if(404!==o.status)if(403!==o.status)try{var e=JSON.parse(o.responseText);if(403===e.domain_status_code)return F(e,u),void n(new Error("“".concat(i,"” is not embeddable.")));t(e)}catch(e){n(e)}else n(new Error("“".concat(i,"” is not embeddable.")));else n(new Error("“".concat(i,"” was not found.")))},o.onerror=function(){var e=o.status?" (".concat(o.status,")"):"";n(new Error("There was an error fetching the embed code from Vimeo".concat(e,".")))},o.send()})}var C,j,A,S=new WeakMap,q=new WeakMap,V={},Player=function(){function Player(u){var e,t,c=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Player),window.jQuery&&u instanceof jQuery&&(1<u.length&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),u=u[0]),"undefined"!=typeof document&&"string"==typeof u&&(u=document.getElementById(u)),e=u,!Boolean(e&&1===e.nodeType&&"nodeName"in e&&e.ownerDocument&&e.ownerDocument.defaultView))throw new TypeError("You must pass either a valid element or a valid id.");if("IFRAME"===u.nodeName||(t=u.querySelector("iframe"))&&(u=t),"IFRAME"===u.nodeName&&!l(u.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");if(S.has(u))return S.get(u);this._window=u.ownerDocument.defaultView,this.element=u,this.origin="*";var r,o=new y(function(i,a){var e;c._onMessage=function(e){if(l(e.origin)&&c.element.contentWindow===e.source){"*"===c.origin&&(c.origin=e.origin);var t=T(e.data);if(t&&"error"===t.event&&t.data&&"ready"===t.data.method){var n=new Error(t.data.message);return n.name=t.data.name,void a(n)}var r=t&&"ready"===t.event,o=t&&"ping"===t.method;if(r||o)return c.element.setAttribute("data-ready","true"),void i();_(c,t)}},c._window.addEventListener("message",c._onMessage),"IFRAME"!==c.element.nodeName&&x(s(e=N(u,n)),e,u).then(function(e){var t,n,r,o=F(e,u);return c.element=o,c._originalElement=u,t=u,n=o,r=w.get(t),w.set(n,r),w.delete(t),S.set(c.element,c),e}).catch(a)});return q.set(this,o),S.set(this.element,this),"IFRAME"===this.element.nodeName&&P(this,"ping"),V.isEnabled&&(r=function(){return V.exit()},this.fullscreenchangeHandler=function(){(V.isFullscreen?b:E)(c,"event:exitFullscreen",r),c.ready().then(function(){P(c,"fullscreenchange",V.isFullscreen)})},V.on("fullscreenchange",this.fullscreenchangeHandler)),this}var e,t,n;return e=Player,(t=[{key:"callMethod",value:function(n,e){var r=this,o=1<arguments.length&&void 0!==e?e:{};return new y(function(e,t){return r.ready().then(function(){b(r,n,{resolve:e,reject:t}),P(r,n,o)}).catch(t)})}},{key:"get",value:function(n){var r=this;return new y(function(e,t){return n=i(n,"get"),r.ready().then(function(){b(r,n,{resolve:e,reject:t}),P(r,n)}).catch(t)})}},{key:"set",value:function(n,r){var o=this;return new y(function(e,t){if(n=i(n,"set"),null==r)throw new TypeError("There must be a value to set.");return o.ready().then(function(){b(o,n,{resolve:e,reject:t}),P(o,n,r)}).catch(t)})}},{key:"on",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(!t)throw new TypeError("You must pass a callback function.");if("function"!=typeof t)throw new TypeError("The callback must be a function.");0===k(this,"event:".concat(e)).length&&this.callMethod("addEventListener",e).catch(function(){}),b(this,"event:".concat(e),t)}},{key:"off",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(t&&"function"!=typeof t)throw new TypeError("The callback must be a function.");E(this,"event:".concat(e),t)&&this.callMethod("removeEventListener",e).catch(function(e){})}},{key:"loadVideo",value:function(e){return this.callMethod("loadVideo",e)}},{key:"ready",value:function(){var e=q.get(this)||new y(function(e,t){t(new Error("Unknown player. Probably unloaded."))});return y.resolve(e)}},{key:"addCuePoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return this.callMethod("addCuePoint",{time:e,data:n})}},{key:"removeCuePoint",value:function(e){return this.callMethod("removeCuePoint",e)}},{key:"enableTextTrack",value:function(e,t){if(!e)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:e,kind:t})}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"requestFullscreen",value:function(){return V.isEnabled?V.request(this.element):this.callMethod("requestFullscreen")}},{key:"exitFullscreen",value:function(){return V.isEnabled?V.exit():this.callMethod("exitFullscreen")}},{key:"getFullscreen",value:function(){return V.isEnabled?y.resolve(V.isFullscreen):this.get("fullscreen")}},{key:"requestPictureInPicture",value:function(){return this.callMethod("requestPictureInPicture")}},{key:"exitPictureInPicture",value:function(){return this.callMethod("exitPictureInPicture")}},{key:"getPictureInPicture",value:function(){return this.get("pictureInPicture")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var n=this;return new y(function(e){var t;q.delete(n),S.delete(n.element),n._originalElement&&(S.delete(n._originalElement),n._originalElement.removeAttribute("data-vimeo-initialized")),n.element&&"IFRAME"===n.element.nodeName&&n.element.parentNode&&(n.element.parentNode.parentNode&&n._originalElement&&n._originalElement!==n.element.parentNode?n.element.parentNode.parentNode.removeChild(n.element.parentNode):n.element.parentNode.removeChild(n.element)),n.element&&"DIV"===n.element.nodeName&&n.element.parentNode&&(n.element.removeAttribute("data-vimeo-initialized"),(t=n.element.querySelector("iframe"))&&t.parentNode&&(t.parentNode.parentNode&&n._originalElement&&n._originalElement!==t.parentNode?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))),n._window.removeEventListener("message",n._onMessage),V.isEnabled&&V.off("fullscreenchange",n.fullscreenchangeHandler),e()})}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(e){return this.set("autopause",e)}},{key:"getBuffered",value:function(){return this.get("buffered")}},{key:"getCameraProps",value:function(){return this.get("cameraProps")}},{key:"setCameraProps",value:function(e){return this.set("cameraProps",e)}},{key:"getChapters",value:function(){return this.get("chapters")}},{key:"getCurrentChapter",value:function(){return this.get("currentChapter")}},{key:"getColor",value:function(){return this.get("color")}},{key:"setColor",value:function(e){return this.set("color",e)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(e){return this.set("currentTime",e)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(e){return this.set("loop",e)}},{key:"setMuted",value:function(e){return this.set("muted",e)}},{key:"getMuted",value:function(){return this.get("muted")}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(e){return this.set("playbackRate",e)}},{key:"getPlayed",value:function(){return this.get("played")}},{key:"getQualities",value:function(){return this.get("qualities")}},{key:"getQuality",value:function(){return this.get("quality")}},{key:"setQuality",value:function(e){return this.set("quality",e)}},{key:"getSeekable",value:function(){return this.get("seekable")}},{key:"getSeeking",value:function(){return this.get("seeking")}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(e){return this.set("volume",e)}}])&&r(e.prototype,t),n&&r(e,n),Player}();return e||(C=function(){for(var e,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,r=t.length,o={};n<r;n++)if((e=t[n])&&e[1]in document){for(n=0;n<e.length;n++)o[t[0][n]]=e[n];return o}return!1}(),j={fullscreenchange:C.fullscreenchange,fullscreenerror:C.fullscreenerror},A={request:function(o){return new Promise(function(e,t){function n(){A.off("fullscreenchange",n),e()}A.on("fullscreenchange",n);var r=(o=o||document.documentElement)[C.requestFullscreen]();r instanceof Promise&&r.then(n).catch(t)})},exit:function(){return new Promise(function(t,e){var n,r;A.isFullscreen?(n=function e(){A.off("fullscreenchange",e),t()},A.on("fullscreenchange",n),(r=document[C.exitFullscreen]())instanceof Promise&&r.then(n).catch(e)):t()})},on:function(e,t){var n=j[e];n&&document.addEventListener(n,t)},off:function(e,t){var n=j[e];n&&document.removeEventListener(n,t)}},Object.defineProperties(A,{isFullscreen:{get:function(){return Boolean(document[C.fullscreenElement])}},element:{enumerable:!0,get:function(){return document[C.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(document[C.fullscreenEnabled])}}}),V=A,function(e){function n(e){"console"in window&&console.error&&console.error("There was an error creating an embed: ".concat(e))}var t=0<arguments.length&&void 0!==e?e:document;[].slice.call(t.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")).forEach(function(t){try{if(null!==t.getAttribute("data-vimeo-defer"))return;var e=N(t);x(s(e),e,t).then(function(e){return F(e,t)}).catch(n)}catch(e){n(e)}})}(),function(e){var r=0<arguments.length&&void 0!==e?e:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener("message",function(e){if(l(e.origin)&&e.data&&"spacechange"===e.data.event)for(var t=r.querySelectorAll("iframe"),n=0;n<t.length;n++)if(t[n].contentWindow===e.source){t[n].parentElement.style.paddingBottom="".concat(e.data.data[0].bottom,"px");break}}))}(),function(e){var a=0<arguments.length&&void 0!==e?e:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener("message",function(e){if(l(e.origin)){var t=T(e.data);if(t&&"ready"===t.event)for(var n=a.querySelectorAll("iframe"),r=0;r<n.length;r++){var o=n[r],i=o.contentWindow===e.source;c(o.src)&&i&&new Player(o).callMethod("appendVideoMetadata",window.location.href)}}}))}(),function(e){var a,u=0<arguments.length&&void 0!==e?e:document;window.VimeoCheckedUrlTimeParam||(window.VimeoCheckedUrlTimeParam=!0,a=function(e){"console"in window&&console.error&&console.error("There was an error getting video Id: ".concat(e))},window.addEventListener("message",function(e){if(l(e.origin)){var t=T(e.data);if(t&&"ready"===t.event)for(var n=u.querySelectorAll("iframe"),r=0;r<n.length;r++){var o=n[r],i=o.contentWindow===e.source;c(o.src)&&i&&function(){var r=new Player(o);r.getVideoId().then(function(e){var t,n=new RegExp("[?&]vimeo_t_".concat(e,"=([^&#]*)")).exec(window.location.href);n&&n[1]&&(t=decodeURI(n[1]),r.setCurrentTime(t))}).catch(a)}()}}}))}()),Player});
/*! @vimeo/player v2.19.0 | (c) 2023 Vimeo | MIT License | https://github.com/vimeo/player.js */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).Vimeo=e.Vimeo||{},e.Vimeo.Player=t())}(this,function(){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var e="undefined"!=typeof global&&"[object global]"==={}.toString.call(global);function i(e,t){return 0===e.indexOf(t.toLowerCase())?e:"".concat(t.toLowerCase()).concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}function c(e){return/^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(e)}function l(e){return/^https:\/\/player\.vimeo\.com\/video\/\d+/.test(e)}function s(e){var t,n=0<arguments.length&&void 0!==e?e:{},r=n.id,o=n.url,i=r||o;if(!i)throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");if(t=i,!isNaN(parseFloat(t))&&isFinite(t)&&Math.floor(t)==t)return"https://vimeo.com/".concat(i);if(c(i))return i.replace("http:","https:");if(r)throw new TypeError("“".concat(r,"” is not a valid video id."));throw new TypeError("“".concat(i,"” is not a vimeo.com url."))}var t=void 0!==Array.prototype.indexOf,n="undefined"!=typeof window&&void 0!==window.postMessage;if(!(e||t&&n))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var o,a,u,f,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(f(this,"_id","_WeakMap_"+v()+"."+v()),0<arguments.length)throw new TypeError("WeakMap iterable is not supported")}function m(e,t){if(!p(e)||!a.call(e,"_id"))throw new TypeError(t+" method called on incompatible receiver "+typeof e)}function v(){return Math.random().toString().substring(2)}function p(e){return Object(e)===e}(o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:d).WeakMap||(a=Object.prototype.hasOwnProperty,u=Object.defineProperty&&function(){try{return 1===Object.defineProperty({},"x",{value:1}).x}catch(e){}}(),f=function(e,t,n){u?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n}):e[t]=n},o.WeakMap=(f(h.prototype,"delete",function(e){if(m(this,"delete"),!p(e))return!1;var t=e[this._id];return!(!t||t[0]!==e)&&(delete e[this._id],!0)}),f(h.prototype,"get",function(e){if(m(this,"get"),p(e)){var t=e[this._id];return t&&t[0]===e?t[1]:void 0}}),f(h.prototype,"has",function(e){if(m(this,"has"),!p(e))return!1;var t=e[this._id];return!(!t||t[0]!==e)}),f(h.prototype,"set",function(e,t){if(m(this,"set"),!p(e))throw new TypeError("Invalid value used as weak map key");var n=e[this._id];return n&&n[0]===e?n[1]=t:f(e,this._id,[e,t]),this}),f(h,"_polyfill",!0),h));var y,g=(function(e){var t,n,r;r=function(){var t,n,r,o,i,a,e=Object.prototype.toString,u="undefined"!=typeof setImmediate?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(e){t=function(e,t,n){return e[t]=n,e}}function l(e,t){this.fn=e,this.self=t,this.next=void 0}function c(e,t){r.add(e,t),n=n||u(r.drain)}function s(e){var t,n=typeof e;return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function f(){for(var e=0;e<this.chain.length;e++)!function(e,t,n){var r,o;try{!1===t?n.reject(e.msg):(r=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(o=s(r))?o.call(r,n.resolve,n.reject):n.resolve(r)}catch(e){n.reject(e)}}(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function d(e){var n,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(n=s(e))?c(function(){var t=new v(r);try{n.call(e,function(){d.apply(t,arguments)},function(){h.apply(t,arguments)})}catch(e){h.call(t,e)}}):(r.msg=e,r.state=1,0<r.chain.length&&c(f,r))}catch(e){h.call(new v(r),e)}}}function h(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,0<t.chain.length&&c(f,t))}function m(e,n,r,o){for(var t=0;t<n.length;t++)!function(t){e.resolve(n[t]).then(function(e){r(t,e)},o)}(t)}function v(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function y(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var r=new p(this);this.then=function(e,t){var n={success:"function"!=typeof e||e,failure:"function"==typeof t&&t};return n.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t}),r.chain.push(n),0!==r.state&&c(f,r),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){d.call(r,e)},function(e){h.call(r,e)})}catch(e){h.call(r,e)}}var g=t({},"constructor",y,!(r={add:function(e,t){a=new l(e,t),i?i.next=a:o=a,i=a,a=void 0},drain:function(){var e=o;for(o=i=n=void 0;e;)e.fn.call(e.self),e=e.next}}));return t(y.prototype=g,"__NPO__",0,!1),t(y,"resolve",function(n){return n&&"object"==typeof n&&1===n.__NPO__?n:new this(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");e(n)})}),t(y,"reject",function(n){return new this(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");t(n)})}),t(y,"all",function(t){var a=this;return"[object Array]"!=e.call(t)?a.reject(TypeError("Not an array")):0===t.length?a.resolve([]):new a(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");var r=t.length,o=Array(r),i=0;m(a,t,function(e,t){o[e]=t,++i===r&&n(o)},e)})}),t(y,"race",function(t){var r=this;return"[object Array]"!=e.call(t)?r.reject(TypeError("Not an array")):new r(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");m(r,t,function(e,t){n(t)},e)})}),y},(n=d)[t="Promise"]=n[t]||r(),e.exports&&(e.exports=n[t])}(y={exports:{}}),y.exports),w=new WeakMap;function b(e,t,n){var r=w.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),w.set(e.element,r)}function k(e,t){return(w.get(e.element)||{})[t]||[]}function E(e,t,n){var r=w.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],w.set(e.element,r),!0;var o=r[t].indexOf(n);return-1!==o&&r[t].splice(o,1),w.set(e.element,r),r[t]&&0===r[t].length}function T(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function P(e,t,n){var r,o;e.element.contentWindow&&e.element.contentWindow.postMessage&&(r={method:t},void 0!==n&&(r.value=n),8<=(o=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1")))&&o<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin))}function _(n,r){var t,e,o=[];(r=T(r)).event?("error"===r.event&&k(n,r.data.method).forEach(function(e){var t=new Error(r.data.message);t.name=r.data.name,e.reject(t),E(n,r.data.method,e)}),o=k(n,"event:".concat(r.event)),t=r.data):!r.method||(e=function(e,t){var n=k(e,t);if(n.length<1)return!1;var r=n.shift();return E(e,t,r),r}(n,r.method))&&(o.push(e),t=r.value),o.forEach(function(e){try{if("function"==typeof e)return void e.call(n,t);e.resolve(t)}catch(e){}})}var M=["autopause","autoplay","background","byline","color","controls","dnt","height","id","interactive_params","keyboard","loop","maxheight","maxwidth","muted","playsinline","portrait","responsive","speed","texttrack","title","transparent","url","width"];function N(r,e){var t=1<arguments.length&&void 0!==e?e:{};return M.reduce(function(e,t){var n=r.getAttribute("data-vimeo-".concat(t));return!n&&""!==n||(e[t]=""===n?1:n),e},t)}function F(e,t){var n=e.html;if(!t)throw new TypeError("An element must be provided");if(null!==t.getAttribute("data-vimeo-initialized"))return t.querySelector("iframe");var r=document.createElement("div");return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute("data-vimeo-initialized","true"),t.querySelector("iframe")}function x(i,e,t){var a=1<arguments.length&&void 0!==e?e:{},u=2<arguments.length?t:void 0;return new Promise(function(t,n){if(!c(i))throw new TypeError("“".concat(i,"” is not a vimeo.com url."));var e="https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(i));for(var r in a)a.hasOwnProperty(r)&&(e+="&".concat(r,"=").concat(encodeURIComponent(a[r])));var o=new("XDomainRequest"in window?XDomainRequest:XMLHttpRequest);o.open("GET",e,!0),o.onload=function(){if(404!==o.status)if(403!==o.status)try{var e=JSON.parse(o.responseText);if(403===e.domain_status_code)return F(e,u),void n(new Error("“".concat(i,"” is not embeddable.")));t(e)}catch(e){n(e)}else n(new Error("“".concat(i,"” is not embeddable.")));else n(new Error("“".concat(i,"” was not found.")))},o.onerror=function(){var e=o.status?" (".concat(o.status,")"):"";n(new Error("There was an error fetching the embed code from Vimeo".concat(e,".")))},o.send()})}var C,j,A,S=new WeakMap,q=new WeakMap,V={},Player=function(){function Player(u){var e,t,l=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Player),window.jQuery&&u instanceof jQuery&&(1<u.length&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),u=u[0]),"undefined"!=typeof document&&"string"==typeof u&&(u=document.getElementById(u)),e=u,!Boolean(e&&1===e.nodeType&&"nodeName"in e&&e.ownerDocument&&e.ownerDocument.defaultView))throw new TypeError("You must pass either a valid element or a valid id.");if("IFRAME"===u.nodeName||(t=u.querySelector("iframe"))&&(u=t),"IFRAME"===u.nodeName&&!c(u.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");if(S.has(u))return S.get(u);this._window=u.ownerDocument.defaultView,this.element=u,this.origin="*";var r,o=new g(function(i,a){var e;l._onMessage=function(e){if(c(e.origin)&&l.element.contentWindow===e.source){"*"===l.origin&&(l.origin=e.origin);var t=T(e.data);if(t&&"error"===t.event&&t.data&&"ready"===t.data.method){var n=new Error(t.data.message);return n.name=t.data.name,void a(n)}var r=t&&"ready"===t.event,o=t&&"ping"===t.method;if(r||o)return l.element.setAttribute("data-ready","true"),void i();_(l,t)}},l._window.addEventListener("message",l._onMessage),"IFRAME"!==l.element.nodeName&&x(s(e=N(u,n)),e,u).then(function(e){var t,n,r,o=F(e,u);return l.element=o,l._originalElement=u,t=u,n=o,r=w.get(t),w.set(n,r),w.delete(t),S.set(l.element,l),e}).catch(a)});return q.set(this,o),S.set(this.element,this),"IFRAME"===this.element.nodeName&&P(this,"ping"),V.isEnabled&&(r=function(){return V.exit()},this.fullscreenchangeHandler=function(){(V.isFullscreen?b:E)(l,"event:exitFullscreen",r),l.ready().then(function(){P(l,"fullscreenchange",V.isFullscreen)})},V.on("fullscreenchange",this.fullscreenchangeHandler)),this}var e,t,n;return e=Player,(t=[{key:"callMethod",value:function(n,e){var r=this,o=1<arguments.length&&void 0!==e?e:{};return new g(function(e,t){return r.ready().then(function(){b(r,n,{resolve:e,reject:t}),P(r,n,o)}).catch(t)})}},{key:"get",value:function(n){var r=this;return new g(function(e,t){return n=i(n,"get"),r.ready().then(function(){b(r,n,{resolve:e,reject:t}),P(r,n)}).catch(t)})}},{key:"set",value:function(n,r){var o=this;return new g(function(e,t){if(n=i(n,"set"),null==r)throw new TypeError("There must be a value to set.");return o.ready().then(function(){b(o,n,{resolve:e,reject:t}),P(o,n,r)}).catch(t)})}},{key:"on",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(!t)throw new TypeError("You must pass a callback function.");if("function"!=typeof t)throw new TypeError("The callback must be a function.");0===k(this,"event:".concat(e)).length&&this.callMethod("addEventListener",e).catch(function(){}),b(this,"event:".concat(e),t)}},{key:"off",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(t&&"function"!=typeof t)throw new TypeError("The callback must be a function.");E(this,"event:".concat(e),t)&&this.callMethod("removeEventListener",e).catch(function(e){})}},{key:"loadVideo",value:function(e){return this.callMethod("loadVideo",e)}},{key:"ready",value:function(){var e=q.get(this)||new g(function(e,t){t(new Error("Unknown player. Probably unloaded."))});return g.resolve(e)}},{key:"addCuePoint",value:function(e,t){var n=1<arguments.length&&void 0!==t?t:{};return this.callMethod("addCuePoint",{time:e,data:n})}},{key:"removeCuePoint",value:function(e){return this.callMethod("removeCuePoint",e)}},{key:"enableTextTrack",value:function(e,t){if(!e)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:e,kind:t})}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"requestFullscreen",value:function(){return V.isEnabled?V.request(this.element):this.callMethod("requestFullscreen")}},{key:"exitFullscreen",value:function(){return V.isEnabled?V.exit():this.callMethod("exitFullscreen")}},{key:"getFullscreen",value:function(){return V.isEnabled?g.resolve(V.isFullscreen):this.get("fullscreen")}},{key:"requestPictureInPicture",value:function(){return this.callMethod("requestPictureInPicture")}},{key:"exitPictureInPicture",value:function(){return this.callMethod("exitPictureInPicture")}},{key:"getPictureInPicture",value:function(){return this.get("pictureInPicture")}},{key:"remotePlaybackPrompt",value:function(){return this.callMethod("remotePlaybackPrompt")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var n=this;return new g(function(e){var t;q.delete(n),S.delete(n.element),n._originalElement&&(S.delete(n._originalElement),n._originalElement.removeAttribute("data-vimeo-initialized")),n.element&&"IFRAME"===n.element.nodeName&&n.element.parentNode&&(n.element.parentNode.parentNode&&n._originalElement&&n._originalElement!==n.element.parentNode?n.element.parentNode.parentNode.removeChild(n.element.parentNode):n.element.parentNode.removeChild(n.element)),n.element&&"DIV"===n.element.nodeName&&n.element.parentNode&&(n.element.removeAttribute("data-vimeo-initialized"),(t=n.element.querySelector("iframe"))&&t.parentNode&&(t.parentNode.parentNode&&n._originalElement&&n._originalElement!==t.parentNode?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))),n._window.removeEventListener("message",n._onMessage),V.isEnabled&&V.off("fullscreenchange",n.fullscreenchangeHandler),e()})}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(e){return this.set("autopause",e)}},{key:"getBuffered",value:function(){return this.get("buffered")}},{key:"getCameraProps",value:function(){return this.get("cameraProps")}},{key:"setCameraProps",value:function(e){return this.set("cameraProps",e)}},{key:"getChapters",value:function(){return this.get("chapters")}},{key:"getCurrentChapter",value:function(){return this.get("currentChapter")}},{key:"getColor",value:function(){return this.get("color")}},{key:"setColor",value:function(e){return this.set("color",e)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(e){return this.set("currentTime",e)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(e){return this.set("loop",e)}},{key:"setMuted",value:function(e){return this.set("muted",e)}},{key:"getMuted",value:function(){return this.get("muted")}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(e){return this.set("playbackRate",e)}},{key:"getPlayed",value:function(){return this.get("played")}},{key:"getQualities",value:function(){return this.get("qualities")}},{key:"getQuality",value:function(){return this.get("quality")}},{key:"setQuality",value:function(e){return this.set("quality",e)}},{key:"getRemotePlaybackAvailability",value:function(){return this.get("remotePlaybackAvailability")}},{key:"getRemotePlaybackState",value:function(){return this.get("remotePlaybackState")}},{key:"getSeekable",value:function(){return this.get("seekable")}},{key:"getSeeking",value:function(){return this.get("seeking")}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(e){return this.set("volume",e)}}])&&r(e.prototype,t),n&&r(e,n),Player}();return e||(C=function(){for(var e,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,r=t.length,o={};n<r;n++)if((e=t[n])&&e[1]in document){for(n=0;n<e.length;n++)o[t[0][n]]=e[n];return o}return!1}(),j={fullscreenchange:C.fullscreenchange,fullscreenerror:C.fullscreenerror},A={request:function(o){return new Promise(function(e,t){function n(){A.off("fullscreenchange",n),e()}A.on("fullscreenchange",n);var r=(o=o||document.documentElement)[C.requestFullscreen]();r instanceof Promise&&r.then(n).catch(t)})},exit:function(){return new Promise(function(t,e){var n,r;A.isFullscreen?(n=function e(){A.off("fullscreenchange",e),t()},A.on("fullscreenchange",n),(r=document[C.exitFullscreen]())instanceof Promise&&r.then(n).catch(e)):t()})},on:function(e,t){var n=j[e];n&&document.addEventListener(n,t)},off:function(e,t){var n=j[e];n&&document.removeEventListener(n,t)}},Object.defineProperties(A,{isFullscreen:{get:function(){return Boolean(document[C.fullscreenElement])}},element:{enumerable:!0,get:function(){return document[C.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(document[C.fullscreenEnabled])}}}),V=A,function(e){function n(e){"console"in window&&console.error&&console.error("There was an error creating an embed: ".concat(e))}var t=0<arguments.length&&void 0!==e?e:document;[].slice.call(t.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")).forEach(function(t){try{if(null!==t.getAttribute("data-vimeo-defer"))return;var e=N(t);x(s(e),e,t).then(function(e){return F(e,t)}).catch(n)}catch(e){n(e)}})}(),function(e){var r=0<arguments.length&&void 0!==e?e:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener("message",function(e){if(c(e.origin)&&e.data&&"spacechange"===e.data.event)for(var t=r.querySelectorAll("iframe"),n=0;n<t.length;n++)if(t[n].contentWindow===e.source){t[n].parentElement.style.paddingBottom="".concat(e.data.data[0].bottom,"px");break}}))}(),function(e){var a=0<arguments.length&&void 0!==e?e:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener("message",function(e){if(c(e.origin)){var t=T(e.data);if(t&&"ready"===t.event)for(var n=a.querySelectorAll("iframe"),r=0;r<n.length;r++){var o=n[r],i=o.contentWindow===e.source;l(o.src)&&i&&new Player(o).callMethod("appendVideoMetadata",window.location.href)}}}))}(),function(e){var a,u=0<arguments.length&&void 0!==e?e:document;window.VimeoCheckedUrlTimeParam||(window.VimeoCheckedUrlTimeParam=!0,a=function(e){"console"in window&&console.error&&console.error("There was an error getting video Id: ".concat(e))},window.addEventListener("message",function(e){if(c(e.origin)){var t=T(e.data);if(t&&"ready"===t.event)for(var n=u.querySelectorAll("iframe"),r=0;r<n.length;r++){var o=n[r],i=o.contentWindow===e.source;l(o.src)&&i&&function(){var r=new Player(o);r.getVideoId().then(function(e){var t,n=new RegExp("[?&]vimeo_t_".concat(e,"=([^&#]*)")).exec(window.location.href);n&&n[1]&&(t=decodeURI(n[1]),r.setCurrentTime(t))}).catch(a)}()}}}))}()),Player});
{
"name": "@vimeo/player",
"version": "2.18.0",
"version": "2.19.0",
"description": "Interact with and control an embedded Vimeo Player.",

@@ -21,3 +21,4 @@ "license": "MIT",

"postversion": "git branch -f latest master",
"push-release": "git push origin master latest && git push --tags"
"push-release": "git push origin master latest && git push --tags",
"prepublishOnly": "npm run build && git add -A dist"
},

@@ -35,2 +36,6 @@ "main": "dist/player.js",

"repository": "vimeo/player.js",
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"bugs": "https://github.com/vimeo/player.js/issues",

@@ -37,0 +42,0 @@ "keywords": [

@@ -178,2 +178,5 @@ # Vimeo Player API [![npm](https://img.shields.io/npm/v/@vimeo/player.svg?cacheSeconds=120)](https://www.npmjs.com/package/@vimeo/player) [![Coverage](https://img.shields.io/codecov/c/github/vimeo/player.js.svg?cacheSeconds=120)](https://codecov.io/gh/vimeo/player.js) ![Badge size](https://img.badgesize.io/https://raw.githubusercontent.com/vimeo/player.js/master/dist/player.min.js?compression=gzip&label=gzip)

+ [getPictureInPicture](#getpictureinpicture-promiseboolean-error)
+ [remotePlaybackPrompt](#remoteplaybackprompt-promisevoid-error)
+ [getRemotePlaybackAvailability](#getremoteplaybackavailability-promisestring-error)
+ [getRemotePlaybackState](#getremoteplaybackstate-promiseboolean-error)
+ [getAutopause](#getautopause-promiseboolean-unsupportederrorerror)

@@ -243,2 +246,6 @@ + [setAutopause](#setautopauseautopause-boolean-promiseboolean-unsupportederrorerror)

+ [leavepictureinpicture](#leavepictureinpicture)
+ [remoteplaybackavailabilitychange](#remoteplaybackavailabilitychange)
+ [remoteplaybackconnecting](#remoteplaybackconnecting)
+ [remoteplaybackconnect](#remoteplaybackconnect)
+ [remoteplaybackdisconnect](#remoteplaybackdisconnect)
+ [interactivehotspotclicked](#interactivehotspotclicked)

@@ -333,36 +340,5 @@ + [interactiveoverlaypanelclicked](#interactiveoverlaypanelclicked)

These options are available to use as `data-vimeo-` attributes on elements or as
an object passed to the `Vimeo.Player` constructor. More information on embed options can be found in the [Vimeo Help Center](https://help.vimeo.com/hc/en-us/articles/360001494447-Using-Player-Parameters).
These options are available to be appended to the query string of the player URL, used as `data-vimeo-` attributes on elements, or included as
an object passed to the `Vimeo.Player` constructor. The complete list of embed options can be found in our [official SDK documentation](https://developer.vimeo.com/player/sdk/embed).
option | default | description
------------------ | -------- | -----------
id _or_ url | | **Required.** Either the id or the URL of the video. Note that if the video [privacy settings](https://vimeo.zendesk.com/hc/en-us/articles/224817847-Privacy-settings-overview) are "Private", instead of an id, a URL that includes the `h` parameter must be provided.
autopause | `true` | Pause this video automatically when another one plays.
autoplay | `false` | Automatically start playback of the video. Note that this won’t work on some devices.
background | `false` | Enable the player's background mode which hides the controls, autoplays and loops the video (available to Plus, PRO, or Business members).
byline | `true` | Show the byline on the video.
color | `00adef` | Specify the color of the video controls. Colors may be overridden by the embed settings of the video.
controls | `true` | This parameter will hide all elements in the player (play bar, sharing buttons, etc) for a chromeless experience. ⚠️Warning: When using this parameter, the play bar and UI will be hidden. To start playback for your viewers, you'll need to either enable autoplay or use our player SDK to start and control playback. (available to Plus, PRO, or Business members)
dnt | `false` | Block the player from tracking any session data, including cookies.
height | | The exact height of the video. Defaults to the height of the largest available version of the video.
interactive_params | | Key-value pairs representing dynamic parameters that are utilized on interactive videos with live elements. Ex: `key1=value1,key2=value2`.
keyboard | `true` | Allows for keyboard input to trigger player events. If false, will ignore keyboard input. Tabbing will still be supported in either mode.
loop | `false` | Play the video again when it reaches the end.
maxheight | | Same as height, but video will not exceed the native size of the video.
maxwidth | | Same as width, but video will not exceed the native size of the video.
muted | `false` | Mute this video on load. Required to autoplay in certain browsers.
pip | `false` | Show the picture-in-picture button in the controlbar and enable the picture-in-picture API.
playsinline | `true` | Play video inline on mobile devices, to automatically go fullscreen on playback set this parameter to `false`.
portrait | `true` | Show the portrait on the video.
quality | | Vimeo Plus, PRO, and Business members can default an embedded video to a specific quality on desktop. Possible values: `4K`, `2K`, `1080p`, `720p`, `540p`, `360p` and `240p` https://help.vimeo.com/hc/en-us/articles/224983008-Setting-default-quality-for-embedded-videos
responsive | `false` | Resize according to the parent element (experimental)
speed | `false` | Show the speed controls in the preferences menu and enable playback rate API (available to PRO and Business accounts).
texttrack | | Turn captions/subtitles on for a specific language by default. If you enter a language preference that hasn't yet been uploaded for your particular video, the text track parameter will be ignored, and your embedded video may load with CC or subtitles disabled by default. Supports lowercase language code (such as: `fr`, `es`, `de`, `en`). You can find a full list of popular language codes [here](https://www.andiamo.co.uk/resources/iso-language-codes/).
title | `true` | Show the title on the video.
transparent | `true` | The responsive player and transparent background are enabled by default, to disable set this parameter to `false`.
width | | The exact width of the video. Defaults to the width of the largest available version of the video.
## Methods

@@ -678,2 +654,50 @@

### remotePlaybackPrompt(): Promise&lt;void, Error&gt;
Prompt the viewer to activate or deactivate a remote playback device, if one is available.
*Note:* This method may require user interaction directly with the player before working properly and must be triggered by a user interaction. It is best to wait for initial playback before calling this method.
```js
player.remotePlaybackPrompt().then(function() {
// viewer has been prompted
}).catch(function(error) {
switch (error.name) {
case 'NotFoundError':
// remote playback is not supported or there is no device available
break;
default:
// some other error occurred
break;
}
});
```
### getRemotePlaybackAvailability(): Promise&lt;string, Error&gt;
Checks if there is a remote playback device available.
```js
player.getRemotePlaybackAvailability().then(function(remotePlaybackAvailable) {
// remotePlaybackAvailable = whether there is a remote playback device available or not
}).catch(function(error) {
// an error occurred
})
```
### getRemotePlaybackState(): Promise&lt;boolean, Error&gt;
Get the current state of remote playback. Can be one of `connecting`, `connected`, or `disconnected`. These values are equivalent to the state values in the [Remote Playback API](http://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback/state).
```js
player.getRemotePlaybackState().then(function(remotePlaybackState) {
// remotePlaybackState === 'connecting': player is attempting to connect to the remote device
// remotePlaybackState === 'connected': player successfully connected and is playing on the remote playback device
// remotePlaybackState === 'disconnected': player is not connected to a remote playback device
}).catch(function(error) {
// an error occurred
})
```
### getAutopause(): Promise&lt;boolean, (UnsupportedError|Error)&gt;

@@ -1025,3 +1049,3 @@

Get the playback rate of the player on a scale from `0.5` to `2`.
Get the playback rate of the player on a scale from `0` to `2`.

@@ -1038,3 +1062,3 @@ ```js

Set the playback rate of the player on a scale from `0.5` to `2` (available to PRO and Business accounts). When set
Set the playback rate of the player on a scale from `0` to `2` (available to PRO and Business accounts). When set
via the API, the playback rate will not be synchronized to other

@@ -1049,3 +1073,3 @@ players or stored as the viewer's preference.

case 'RangeError':
// the playback rate was less than 0.5 or greater than 2
// the playback rate was less than 0 or greater than 2
break;

@@ -1671,2 +1695,20 @@

### remoteplaybackavailabilitychange
Triggered when the availability of remote playback changes.
Listening for this event is equivalent to the [RemotePlayback.watchAvailability() API](http://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback/watchAvailability), except that there is no `cancelWatchAvailability()`. You can remove the listener for this event instead.
### remoteplaybackconnecting
Triggered when the player is attempting to connect to a remote playback device.
### remoteplaybackconnect
Triggered when the player has successfully connected to a remote playback device.
### remoteplaybackdisconnect
Triggered when the player has disconnected from a remote playback device.
### interactivehotspotclicked

@@ -1673,0 +1715,0 @@

@@ -526,2 +526,18 @@ import './lib/compatibility-check';

/**
* A promise to prompt the viewer to initiate remote playback.
*
* @promise RemotePlaybackPromptPromise
* @fulfill {void}
* @reject {NotFoundError} No remote playback device is available.
*/
/**
* Request to prompt the user to initiate remote playback.
*
* @return {RemotePlaybackPromptPromise}
*/
remotePlaybackPrompt() {
return this.callMethod('remotePlaybackPrompt');
}
/**
* A promise to unload the video.

@@ -948,6 +964,6 @@ *

* @promise GetPlaybackRatePromise
* @fulfill {number} The playback rate of the player on a scale from 0.5 to 2.
* @fulfill {number} The playback rate of the player on a scale from 0 to 2.
*/
/**
* Get the playback rate of the player on a scale from `0.5` to `2`.
* Get the playback rate of the player on a scale from `0` to `2`.
*

@@ -965,6 +981,6 @@ * @return {GetPlaybackRatePromise}

* @fulfill {number} The playback rate was set.
* @reject {RangeError} The playback rate was less than 0.5 or greater than 2.
* @reject {RangeError} The playback rate was less than 0 or greater than 2.
*/
/**
* Set the playback rate of the player on a scale from `0.5` to `2`. When set
* Set the playback rate of the player on a scale from `0` to `2`. When set
* via the API, the playback rate will not be synchronized to other

@@ -1043,2 +1059,32 @@ * players or stored as the viewer's preference.

/**
* A promise to get the remote playback availability.
*
* @promise RemotePlaybackAvailabilityPromise
* @fulfill {boolean} Whether remote playback is available.
*/
/**
* Get the availability of remote playback.
*
* @return {RemotePlaybackAvailabilityPromise}
*/
getRemotePlaybackAvailability() {
return this.get('remotePlaybackAvailability');
}
/**
* A promise to get the current remote playback state.
*
* @promise RemotePlaybackStatePromise
* @fulfill {string} The state of the remote playback: connecting, connected, or disconnected.
*/
/**
* Get the current remote playback state.
*
* @return {RemotePlaybackStatePromise}
*/
getRemotePlaybackState() {
return this.get('remotePlaybackState');
}
/**
* A promise to get the seekable property of the video.

@@ -1045,0 +1091,0 @@ *

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc