vendor: 7,668 bytes, lines 1-239
1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { 40/******/ configurable: false, 41/******/ enumerable: true, 42/******/ get: getter 43/******/ }); 44/******/ } 45/******/ }; 46/******/ 47/******/ // getDefaultExport function for compatibility with non-harmony modules 48/******/ __webpack_require__.n = function(module) { 49/******/ var getter = module && module.__esModule ? 50/******/ function getDefault() { return module['default']; } : 51/******/ function getModuleExports() { return module; }; 52/******/ __webpack_require__.d(getter, 'a', getter); 53/******/ return getter; 54/******/ }; 55/******/ 56/******/ // Object.prototype.hasOwnProperty.call 57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58/******/ 59/******/ // __webpack_public_path__ 60/******/ __webpack_require__.p = "/wp-content/themes/plasticseurope-theme/dist/"; 61/******/ 62/******/ // Load entry module and return exports 63/******/ return __webpack_require__(__webpack_require__.s = 171); 64/******/ }) 65/************************************************************************/ 66/******/ ({ 67 68/***/ 14: 69/***/ (function(module, __webpack_exports__, __webpack_require__) { 70 71"use strict"; 72/* WEBPACK VAR INJECTION */(function(global, setImmediate, __webpack_provided_window_dot_jQuery, jQuery) {/*! @vimeo/player v2.16.4 | (c) 2022 Vimeo | MIT License | https://github.com/vimeo/player.js */ 73function _classCallCheck(instance, Constructor) { 74 if (!(instance instanceof Constructor)) { 75 throw new TypeError("Cannot call a class as a function"); 76 } 77} 78 79function _defineProperties(target, props) { 80 for (var i = 0; i < props.length; i++) { 81 var descriptor = props[i]; 82 descriptor.enumerable = descriptor.enumerable || false; 83 descriptor.configurable = true; 84 if ("value" in descriptor) descriptor.writable = true; 85 Object.defineProperty(target, descriptor.key, descriptor); 86 } 87} 88 89function _createClass(Constructor, protoProps, staticProps) { 90 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 91 if (staticProps) _defineProperties(Constructor, staticProps); 92 return Constructor; 93} 94 95/** 96 * @module lib/functions 97 */ 98 99/** 100 * Check to see this is a node environment. 101 * @type {Boolean} 102 */ 103 104/* global global */ 105var isNode = typeof global !== 'undefined' && {}.toString.call(global) === '[object global]'; 106/** 107 * Get the name of the method for a given getter or setter. 108 * 109 * @param {string} prop The name of the property. 110 * @param {string} type Either âgetâ or âsetâ. 111 * @return {string} 112 */ 113 114function getMethodName(prop, type) { 115 if (prop.indexOf(type.toLowerCase()) === 0) { 116 return prop; 117 } 118 119 return "".concat(type.toLowerCase()).concat(prop.substr(0, 1).toUpperCase()).concat(prop.substr(1)); 120} 121/** 122 * Check to see if the object is a DOM Element. 123 * 124 * @param {*} element The object to check. 125 * @return {boolean} 126 */ 127 128function isDomElement(element) { 129 return Boolean(element && element.nodeType === 1 && 'nodeName' in element && element.ownerDocument && element.ownerDocument.defaultView); 130} 131/** 132 * Check to see whether the value is a number. 133 * 134 * @see http://dl.dropboxusercontent.com/u/35146/js/tests/isNumber.html 135 * @param {*} value The value to check. 136 * @param {boolean} integer Check if the value is an integer. 137 * @return {boolean} 138 */ 139 140function isInteger(value) { 141 // eslint-disable-next-line eqeqeq 142 return !isNaN(parseFloat(value)) && isFinite(value) && Math.floor(value) == value; 143} 144/** 145 * Check to see if the URL is a Vimeo url. 146 * 147 * @param {string} url The url string. 148 * @return {boolean} 149 */ 150 151function isVimeoUrl(url) { 152 return /^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(url); 153} 154/** 155 * Get the Vimeo URL from an element. 156 * The element must have either a data-vimeo-id or data-vimeo-url attribute. 157 * 158 * @param {object} oEmbedParameters The oEmbed parameters. 159 * @return {string} 160 */ 161 162function getVimeoUrl() { 163 var oEmbedParameters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 164 var id = oEmbedParameters.id; 165 var url = oEmbedParameters.url; 166 var idOrUrl = id || url; 167 168 if (!idOrUrl) { 169 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.'); 170 } 171 172 if (isInteger(idOrUrl)) { 173 return "https://vimeo.com/".concat(idOrUrl); 174 } 175 176 if (isVimeoUrl(idOrUrl)) { 177 return idOrUrl.replace('http:', 'https:'); 178 } 179 180 if (id) { 181 throw new TypeError("\u201C".concat(id, "\u201D is not a valid video id.")); 182 } 183 184 throw new TypeError("\u201C".concat(idOrUrl, "\u201D is not a vimeo.com url.")); 185} 186 187var arrayIndexOfSupport = typeof Array.prototype.indexOf !== 'undefined'; 188var postMessageSupport = typeof window !== 'undefined' && typeof window.postMessage !== 'undefined'; 189 190if (!isNode && (!arrayIndexOfSupport || !postMessageSupport)) { 191 throw new Error('Sorry, the Vimeo Player API is not available in this browser.'); 192} 193 194var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 195 196function createCommonjsModule(fn, module) { 197 return module = { exports: {} }, fn(module, module.exports), module.exports; 198} 199 200/*! 201 * weakmap-polyfill v2.0.1 - ECMAScript6 WeakMap polyfill 202 * https://github.com/polygonplanet/weakmap-polyfill 203 * Copyright (c) 2015-2020 Polygon Planet <[email protected]> 204 * @license MIT 205 */ 206(function (self) { 207 208 if (self.WeakMap) { 209 return; 210 } 211 212 var hasOwnProperty = Object.prototype.hasOwnProperty; 213 214 var defineProperty = function (object, name, value) { 215 if (Object.defineProperty) { 216 Object.defineProperty(object, name, { 217 configurable: true, 218 writable: true, 219 value: value 220 }); 221 } else { 222 object[name] = value; 223 } 224 }; 225 226 self.WeakMap = function () { 227 // ECMA-262 23.3 WeakMap Objects 228 function WeakMap() { 229 if (this === void 0) { 230 throw new TypeError("Constructor WeakMap requires 'new'"); 231 } 232 233 defineProperty(this, '_id', genId('_WeakMap')); // ECMA-262 23.3.1.1 WeakMap([iterable]) 234 235 if (arguments.length > 0) { 236 // Currently, WeakMap `iterable` argument is not supported 237 throw new TypeError('WeakMap iterable is not supported'); 238 } 239 }
vendor: 2,516 bytes, lines 239-341
239 // ECMA-262 23.3.3.2 WeakMap.prototype.delete(key) 240 241 242 defineProperty(WeakMap.prototype, 'delete', function (key) { 243 checkInstance(this, 'delete'); 244 245 if (!isObject(key)) { 246 return false; 247 } 248 249 var entry = key[this._id]; 250 251 if (entry && entry[0] === key) { 252 delete key[this._id]; 253 return true; 254 } 255 256 return false; 257 }); // ECMA-262 23.3.3.3 WeakMap.prototype.get(key) 258 259 defineProperty(WeakMap.prototype, 'get', function (key) { 260 checkInstance(this, 'get'); 261 262 if (!isObject(key)) { 263 return void 0; 264 } 265 266 var entry = key[this._id]; 267 268 if (entry && entry[0] === key) { 269 return entry[1]; 270 } 271 272 return void 0; 273 }); // ECMA-262 23.3.3.4 WeakMap.prototype.has(key) 274 275 defineProperty(WeakMap.prototype, 'has', function (key) { 276 checkInstance(this, 'has'); 277 278 if (!isObject(key)) { 279 return false; 280 } 281 282 var entry = key[this._id]; 283 284 if (entry && entry[0] === key) { 285 return true; 286 } 287 288 return false; 289 }); // ECMA-262 23.3.3.5 WeakMap.prototype.set(key, value) 290 291 defineProperty(WeakMap.prototype, 'set', function (key, value) { 292 checkInstance(this, 'set'); 293 294 if (!isObject(key)) { 295 throw new TypeError('Invalid value used as weak map key'); 296 } 297 298 var entry = key[this._id]; 299 300 if (entry && entry[0] === key) { 301 entry[1] = value; 302 return this; 303 } 304 305 defineProperty(key, this._id, [key, value]); 306 return this; 307 }); 308 309 function checkInstance(x, methodName) { 310 if (!isObject(x) || !hasOwnProperty.call(x, '_id')) { 311 throw new TypeError(methodName + ' method called on incompatible receiver ' + typeof x); 312 } 313 } 314 315 function genId(prefix) { 316 return prefix + '_' + rand() + '.' + rand(); 317 } 318 319 function rand() { 320 return Math.random().toString().substring(2); 321 } 322 323 defineProperty(WeakMap, '_polyfill', true); 324 return WeakMap; 325 }(); 326 327 function isObject(x) { 328 return Object(x) === x; 329 } 330})(typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : commonjsGlobal); 331 332var npo_src = createCommonjsModule(function (module) { 333/*! Native Promise Only 334 v0.8.1 (c) Kyle Simpson 335 MIT License: http://getify.mit-license.org 336*/ 337(function UMD(name, context, definition) { 338 // special form of UMD for polyfilling across evironments 339 context[name] = context[name] || definition(); 340 341 if (
vendor: 11,288 bytes, lines 341-789
341module.exports) { 342 module.exports = context[name]; 343 } 344})("Promise", typeof commonjsGlobal != "undefined" ? commonjsGlobal : commonjsGlobal, function DEF() { 345 346 var builtInProp, 347 cycle, 348 scheduling_queue, 349 ToString = Object.prototype.toString, 350 timer = typeof setImmediate != "undefined" ? function timer(fn) { 351 return setImmediate(fn); 352 } : setTimeout; // dammit, IE8. 353 354 try { 355 Object.defineProperty({}, "x", {}); 356 357 builtInProp = function builtInProp(obj, name, val, config) { 358 return Object.defineProperty(obj, name, { 359 value: val, 360 writable: true, 361 configurable: config !== false 362 }); 363 }; 364 } catch (err) { 365 builtInProp = function builtInProp(obj, name, val) { 366 obj[name] = val; 367 return obj; 368 }; 369 } // Note: using a queue instead of array for efficiency 370 371 372 scheduling_queue = function Queue() { 373 var first, last, item; 374 375 function Item(fn, self) { 376 this.fn = fn; 377 this.self = self; 378 this.next = void 0; 379 } 380 381 return { 382 add: function add(fn, self) { 383 item = new Item(fn, self); 384 385 if (last) { 386 last.next = item; 387 } else { 388 first = item; 389 } 390 391 last = item; 392 item = void 0; 393 }, 394 drain: function drain() { 395 var f = first; 396 first = last = cycle = void 0; 397 398 while (f) { 399 f.fn.call(f.self); 400 f = f.next; 401 } 402 } 403 }; 404 }(); 405 406 function schedule(fn, self) { 407 scheduling_queue.add(fn, self); 408 409 if (!cycle) { 410 cycle = timer(scheduling_queue.drain); 411 } 412 } // promise duck typing 413 414 415 function isThenable(o) { 416 var _then, 417 o_type = typeof o; 418 419 if (o != null && (o_type == "object" || o_type == "function")) { 420 _then = o.then; 421 } 422 423 return typeof _then == "function" ? _then : false; 424 } 425 426 function notify() { 427 for (var i = 0; i < this.chain.length; i++) { 428 notifyIsolated(this, this.state === 1 ? this.chain[i].success : this.chain[i].failure, this.chain[i]); 429 } 430 431 this.chain.length = 0; 432 } // NOTE: This is a separate function to isolate 433 // the `try..catch` so that other code can be 434 // optimized better 435 436 437 function notifyIsolated(self, cb, chain) { 438 var ret, _then; 439 440 try { 441 if (cb === false) { 442 chain.reject(self.msg); 443 } else { 444 if (cb === true) { 445 ret = self.msg; 446 } else { 447 ret = cb.call(void 0, self.msg); 448 } 449 450 if (ret === chain.promise) { 451 chain.reject(TypeError("Promise-chain cycle")); 452 } else if (_then = isThenable(ret)) { 453 _then.call(ret, chain.resolve, chain.reject); 454 } else { 455 chain.resolve(ret); 456 } 457 } 458 } catch (err) { 459 chain.reject(err); 460 } 461 } 462 463 function resolve(msg) { 464 var _then, 465 self = this; // already triggered? 466 467 468 if (self.triggered) { 469 return; 470 } 471 472 self.triggered = true; // unwrap 473 474 if (self.def) { 475 self = self.def; 476 } 477 478 try { 479 if (_then = isThenable(msg)) { 480 schedule(function () { 481 var def_wrapper = new MakeDefWrapper(self); 482 483 try { 484 _then.call(msg, function $resolve$() { 485 resolve.apply(def_wrapper, arguments); 486 }, function $reject$() { 487 reject.apply(def_wrapper, arguments); 488 }); 489 } catch (err) { 490 reject.call(def_wrapper, err); 491 } 492 }); 493 } else { 494 self.msg = msg; 495 self.state = 1; 496 497 if (self.chain.length > 0) { 498 schedule(notify, self); 499 } 500 } 501 } catch (err) { 502 reject.call(new MakeDefWrapper(self), err); 503 } 504 } 505 506 function reject(msg) { 507 var self = this; // already triggered? 508 509 if (self.triggered) { 510 return; 511 } 512 513 self.triggered = true; // unwrap 514 515 if (self.def) { 516 self = self.def; 517 } 518 519 self.msg = msg; 520 self.state = 2; 521 522 if (self.chain.length > 0) { 523 schedule(notify, self); 524 } 525 } 526 527 function iteratePromises(Constructor, arr, resolver, rejecter) { 528 for (var idx = 0; idx < arr.length; idx++) { 529 (function IIFE(idx) { 530 Constructor.resolve(arr[idx]).then(function $resolver$(msg) { 531 resolver(idx, msg); 532 }, rejecter); 533 })(idx); 534 } 535 } 536 537 function MakeDefWrapper(self) { 538 this.def = self; 539 this.triggered = false; 540 } 541 542 function MakeDef(self) { 543 this.promise = self; 544 this.state = 0; 545 this.triggered = false; 546 this.chain = []; 547 this.msg = void 0; 548 } 549 550 function Promise(executor) { 551 if (typeof executor != "function") { 552 throw TypeError("Not a function"); 553 } 554 555 if (this.__NPO__ !== 0) { 556 throw TypeError("Not a promise"); 557 } // instance shadowing the inherited "brand" 558 // to signal an already "initialized" promise 559 560 561 this.__NPO__ = 1; 562 var def = new MakeDef(this); 563 564 this["then"] = function then(success, failure) { 565 var o = { 566 success: typeof success == "function" ? success : true, 567 failure: typeof failure == "function" ? failure : false 568 }; // Note: `then(..)` itself can be borrowed to be used against 569 // a different promise constructor for making the chained promise, 570 // by substituting a different `this` binding. 571 572 o.promise = new this.constructor(function extractChain(resolve, reject) { 573 if (typeof resolve != "function" || typeof reject != "function") { 574 throw TypeError("Not a function"); 575 } 576 577 o.resolve = resolve; 578 o.reject = reject; 579 }); 580 def.chain.push(o); 581 582 if (def.state !== 0) { 583 schedule(notify, def); 584 } 585 586 return o.promise; 587 }; 588 589 this["catch"] = function $catch$(failure) { 590 return this.then(void 0, failure); 591 }; 592 593 try { 594 executor.call(void 0, function publicResolve(msg) { 595 resolve.call(def, msg); 596 }, function publicReject(msg) { 597 reject.call(def, msg); 598 }); 599 } catch (err) { 600 reject.call(def, err); 601 } 602 } 603 604 var PromisePrototype = builtInProp({}, "constructor", Promise, 605 /*configurable=*/ 606 false); // Note: Android 4 cannot use `Object.defineProperty(..)` here 607 608 Promise.prototype = PromisePrototype; // built-in "brand" to signal an "uninitialized" promise 609 610 builtInProp(PromisePrototype, "__NPO__", 0, 611 /*configurable=*/ 612 false); 613 builtInProp(Promise, "resolve", function Promise$resolve(msg) { 614 var Constructor = this; // spec mandated checks 615 // note: best "isPromise" check that's practical for now 616 617 if (msg && typeof msg == "object" && msg.__NPO__ === 1) { 618 return msg; 619 } 620 621 return new Constructor(function executor(resolve, reject) { 622 if (typeof resolve != "function" || typeof reject != "function") { 623 throw TypeError("Not a function"); 624 } 625 626 resolve(msg); 627 }); 628 }); 629 builtInProp(Promise, "reject", function Promise$reject(msg) { 630 return new this(function executor(resolve, reject) { 631 if (typeof resolve != "function" || typeof reject != "function") { 632 throw TypeError("Not a function"); 633 } 634 635 reject(msg); 636 }); 637 }); 638 builtInProp(Promise, "all", function Promise$all(arr) { 639 var Constructor = this; // spec mandated checks 640 641 if (ToString.call(arr) != "[object Array]") { 642 return Constructor.reject(TypeError("Not an array")); 643 } 644 645 if (arr.length === 0) { 646 return Constructor.resolve([]); 647 } 648 649 return new Constructor(function executor(resolve, reject) { 650 if (typeof resolve != "function" || typeof reject != "function") { 651 throw TypeError("Not a function"); 652 } 653 654 var len = arr.length, 655 msgs = Array(len), 656 count = 0; 657 iteratePromises(Constructor, arr, function resolver(idx, msg) { 658 msgs[idx] = msg; 659 660 if (++count === len) { 661 resolve(msgs); 662 } 663 }, reject); 664 }); 665 }); 666 builtInProp(Promise, "race", function Promise$race(arr) { 667 var Constructor = this; // spec mandated checks 668 669 if (ToString.call(arr) != "[object Array]") { 670 return Constructor.reject(TypeError("Not an array")); 671 } 672 673 return new Constructor(function executor(resolve, reject) { 674 if (typeof resolve != "function" || typeof reject != "function") { 675 throw TypeError("Not a function"); 676 } 677 678 iteratePromises(Constructor, arr, function resolver(idx, msg) { 679 resolve(msg); 680 }, reject); 681 }); 682 }); 683 return Promise; 684}); 685}); 686 687/** 688 * @module lib/callbacks 689 */ 690var callbackMap = new WeakMap(); 691/** 692 * Store a callback for a method or event for a player. 693 * 694 * @param {Player} player The player object. 695 * @param {string} name The method or event name. 696 * @param {(function(this:Player, *): void|{resolve: function, reject: function})} callback 697 * The callback to call or an object with resolve and reject functions for a promise. 698 * @return {void} 699 */ 700 701function storeCallback(player, name, callback) { 702 var playerCallbacks = callbackMap.get(player.element) || {}; 703 704 if (!(name in playerCallbacks)) { 705 playerCallbacks[name] = []; 706 } 707 708 playerCallbacks[name].push(callback); 709 callbackMap.set(player.element, playerCallbacks); 710} 711/** 712 * Get the callbacks for a player and event or method. 713 * 714 * @param {Player} player The player object. 715 * @param {string} name The method or event name 716 * @return {function[]} 717 */ 718 719function getCallbacks(player, name) { 720 var playerCallbacks = callbackMap.get(player.element) || {}; 721 return playerCallbacks[name] || []; 722} 723/** 724 * Remove a stored callback for a method or event for a player. 725 * 726 * @param {Player} player The player object. 727 * @param {string} name The method or event name 728 * @param {function} [callback] The specific callback to remove. 729 * @return {boolean} Was this the last callback? 730 */ 731 732function removeCallback(player, name, callback) { 733 var playerCallbacks = callbackMap.get(player.element) || {}; 734 735 if (!playerCallbacks[name]) { 736 return true; 737 } // If no callback is passed, remove all callbacks for the event 738 739 740 if (!callback) { 741 playerCallbacks[name] = []; 742 callbackMap.set(player.element, playerCallbacks); 743 return true; 744 } 745 746 var index = playerCallbacks[name].indexOf(callback); 747 748 if (index !== -1) { 749 playerCallbacks[name].splice(index, 1); 750 } 751 752 callbackMap.set(player.element, playerCallbacks); 753 return playerCallbacks[name] && playerCallbacks[name].length === 0; 754} 755/** 756 * Return the first stored callback for a player and event or method. 757 * 758 * @param {Player} player The player object. 759 * @param {string} name The method or event name. 760 * @return {function} The callback, or false if there were none 761 */ 762 763function shiftCallbacks(player, name) { 764 var playerCallbacks = getCallbacks(player, name); 765 766 if (playerCallbacks.length < 1) { 767 return false; 768 } 769 770 var callback = playerCallbacks.shift(); 771 removeCallback(player, name, callback); 772 return callback; 773} 774/** 775 * Move callbacks associated with an element to another element. 776 * 777 * @param {HTMLElement} oldElement The old element. 778 * @param {HTMLElement} newElement The new element. 779 * @return {void} 780 */ 781 782function swapCallbacks(oldElement, newElement) { 783 var playerCallbacks = callbackMap.get(oldElement); 784 callbackMap.set(newElement, playerCallbacks); 785 callbackMap.delete(oldElement); 786} 787 788/** 789 * @module lib/
vendor: 4,011 bytes, lines 789-911
789embed 790 */ 791var oEmbedParameters = ['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']; 792/** 793 * Get the 'data-vimeo'-prefixed attributes from an element as an object. 794 * 795 * @param {HTMLElement} element The element. 796 * @param {Object} [defaults={}] The default values to use. 797 * @return {Object<string, string>} 798 */ 799 800function getOEmbedParameters(element) { 801 var defaults = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 802 return oEmbedParameters.reduce(function (params, param) { 803 var value = element.getAttribute("data-vimeo-".concat(param)); 804 805 if (value || value === '') { 806 params[param] = value === '' ? 1 : value; 807 } 808 809 return params; 810 }, defaults); 811} 812/** 813 * Create an embed from oEmbed data inside an element. 814 * 815 * @param {object} data The oEmbed data. 816 * @param {HTMLElement} element The element to put the iframe in. 817 * @return {HTMLIFrameElement} The iframe embed. 818 */ 819 820function createEmbed(_ref, element) { 821 var html = _ref.html; 822 823 if (!element) { 824 throw new TypeError('An element must be provided'); 825 } 826 827 if (element.getAttribute('data-vimeo-initialized') !== null) { 828 return element.querySelector('iframe'); 829 } 830 831 var div = document.createElement('div'); 832 div.innerHTML = html; 833 element.appendChild(div.firstChild); 834 element.setAttribute('data-vimeo-initialized', 'true'); 835 return element.querySelector('iframe'); 836} 837/** 838 * Make an oEmbed call for the specified URL. 839 * 840 * @param {string} videoUrl The vimeo.com url for the video. 841 * @param {Object} [params] Parameters to pass to oEmbed. 842 * @param {HTMLElement} element The element. 843 * @return {Promise} 844 */ 845 846function getOEmbedData(videoUrl) { 847 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 848 var element = arguments.length > 2 ? arguments[2] : undefined; 849 return new Promise(function (resolve, reject) { 850 if (!isVimeoUrl(videoUrl)) { 851 throw new TypeError("\u201C".concat(videoUrl, "\u201D is not a vimeo.com url.")); 852 } 853 854 var url = "https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(videoUrl)); 855 856 for (var param in params) { 857 if (params.hasOwnProperty(param)) { 858 url += "&".concat(param, "=").concat(encodeURIComponent(params[param])); 859 } 860 } 861 862 var xhr = 'XDomainRequest' in window ? new XDomainRequest() : new XMLHttpRequest(); 863 xhr.open('GET', url, true); 864 865 xhr.onload = function () { 866 if (xhr.status === 404) { 867 reject(new Error("\u201C".concat(videoUrl, "\u201D was not found."))); 868 return; 869 } 870 871 if (xhr.status === 403) { 872 reject(new Error("\u201C".concat(videoUrl, "\u201D is not embeddable."))); 873 return; 874 } 875 876 try { 877 var json = JSON.parse(xhr.responseText); // Check api response for 403 on oembed 878 879 if (json.domain_status_code === 403) { 880 // We still want to create the embed to give users visual feedback 881 createEmbed(json, element); 882 reject(new Error("\u201C".concat(videoUrl, "\u201D is not embeddable."))); 883 return; 884 } 885 886 resolve(json); 887 } catch (error) { 888 reject(error); 889 } 890 }; 891 892 xhr.onerror = function () { 893 var status = xhr.status ? " (".concat(xhr.status, ")") : ''; 894 reject(new Error("There was an error fetching the embed code from Vimeo".concat(status, "."))); 895 }; 896 897 xhr.send(); 898 }); 899} 900/** 901 * Initialize all embeds within a specific element 902 * 903 * @param {HTMLElement} [parent=document] The parent element. 904 * @return {void} 905 */ 906 907function initializeEmbeds() { 908 var parent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; 909 var elements = [].slice.call(parent.querySelectorAll('[data-vimeo-id], [data-vimeo-url]')); 910 911 var handleError = function handleError(error) {
vendor: 6,478 bytes, lines 912-1113
912 if ('console' in window && console.error) { 913 console.error("There was an error creating an embed: ".concat(error)); 914 } 915 }; 916 917 elements.forEach(function (element) { 918 try { 919 // Skip any that have data-vimeo-defer 920 if (element.getAttribute('data-vimeo-defer') !== null) { 921 return; 922 } 923 924 var params = getOEmbedParameters(element); 925 var url = getVimeoUrl(params); 926 getOEmbedData(url, params, element).then(function (data) { 927 return createEmbed(data, element); 928 }).catch(handleError); 929 } catch (error) { 930 handleError(error); 931 } 932 }); 933} 934/** 935 * Resize embeds when messaged by the player. 936 * 937 * @param {HTMLElement} [parent=document] The parent element. 938 * @return {void} 939 */ 940 941function resizeEmbeds() { 942 var parent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; 943 944 // Prevent execution if users include the player.js script multiple times. 945 if (window.VimeoPlayerResizeEmbeds_) { 946 return; 947 } 948 949 window.VimeoPlayerResizeEmbeds_ = true; 950 951 var onMessage = function onMessage(event) { 952 if (!isVimeoUrl(event.origin)) { 953 return; 954 } // 'spacechange' is fired only on embeds with cards 955 956 957 if (!event.data || event.data.event !== 'spacechange') { 958 return; 959 } 960 961 var iframes = parent.querySelectorAll('iframe'); 962 963 for (var i = 0; i < iframes.length; i++) { 964 if (iframes[i].contentWindow !== event.source) { 965 continue; 966 } // Change padding-bottom of the enclosing div to accommodate 967 // card carousel without distorting aspect ratio 968 969 970 var space = iframes[i].parentElement; 971 space.style.paddingBottom = "".concat(event.data.data[0].bottom, "px"); 972 break; 973 } 974 }; 975 976 window.addEventListener('message', onMessage); 977} 978 979/** 980 * @module lib/postmessage 981 */ 982/** 983 * Parse a message received from postMessage. 984 * 985 * @param {*} data The data received from postMessage. 986 * @return {object} 987 */ 988 989function parseMessageData(data) { 990 if (typeof data === 'string') { 991 try { 992 data = JSON.parse(data); 993 } catch (error) { 994 // If the message cannot be parsed, throw the error as a warning 995 console.warn(error); 996 return {}; 997 } 998 } 999 1000 return data; 1001} 1002/** 1003 * Post a message to the specified target. 1004 * 1005 * @param {Player} player The player object to use. 1006 * @param {string} method The API method to call. 1007 * @param {object} params The parameters to send to the player. 1008 * @return {void} 1009 */ 1010 1011function postMessage(player, method, params) { 1012 if (!player.element.contentWindow || !player.element.contentWindow.postMessage) { 1013 return; 1014 } 1015 1016 var message = { 1017 method: method 1018 }; 1019 1020 if (params !== undefined) { 1021 message.value = params; 1022 } // IE 8 and 9 do not support passing messages, so stringify them 1023 1024 1025 var ieVersion = parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/, '$1')); 1026 1027 if (ieVersion >= 8 && ieVersion < 10) { 1028 message = JSON.stringify(message); 1029 } 1030 1031 player.element.contentWindow.postMessage(message, player.origin); 1032} 1033/** 1034 * Parse the data received from a message event. 1035 * 1036 * @param {Player} player The player that received the message. 1037 * @param {(Object|string)} data The message data. Strings will be parsed into JSON. 1038 * @return {void} 1039 */ 1040 1041function processData(player, data) { 1042 data = parseMessageData(data); 1043 var callbacks = []; 1044 var param; 1045 1046 if (data.event) { 1047 if (data.event === 'error') { 1048 var promises = getCallbacks(player, data.data.method); 1049 promises.forEach(function (promise) { 1050 var error = new Error(data.data.message); 1051 error.name = data.data.name; 1052 promise.reject(error); 1053 removeCallback(player, data.data.method, promise); 1054 }); 1055 } 1056 1057 callbacks = getCallbacks(player, "event:".concat(data.event)); 1058 param = data.data; 1059 } else if (data.method) { 1060 var callback = shiftCallbacks(player, data.method); 1061 1062 if (callback) { 1063 callbacks.push(callback); 1064 param = data.value; 1065 } 1066 } 1067 1068 callbacks.forEach(function (callback) { 1069 try { 1070 if (typeof callback === 'function') { 1071 callback.call(player, param); 1072 return; 1073 } 1074 1075 callback.resolve(param); 1076 } catch (e) {// empty 1077 } 1078 }); 1079} 1080 1081/* MIT License 1082 1083Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) 1084 1085Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 1086 1087The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 1088 1089THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1090Terms */ 1091function initializeScreenfull() { 1092 var fn = function () { 1093 var val; 1094 var fnMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], // New WebKit 1095 ['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Old WebKit 1096 ['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']]; 1097 var i = 0; 1098 var l = fnMap.length; 1099 var ret = {}; 1100 1101 for (; i < l; i++) { 1102 val = fnMap[i]; 1103 1104 if (val && val[1] in document) { 1105 for (i = 0; i < val.length; i++) { 1106 ret[fnMap[0][i]] = val[i]; 1107 } 1108 1109 return ret; 1110 } 1111 } 1112 1113 return false;
vendor: 2,850 bytes, lines 1114-1216
1114 }(); 1115 1116 var eventNameMap = { 1117 fullscreenchange: fn.fullscreenchange, 1118 fullscreenerror: fn.fullscreenerror 1119 }; 1120 var screenfull = { 1121 request: function request(element) { 1122 return new Promise(function (resolve, reject) { 1123 var onFullScreenEntered = function onFullScreenEntered() { 1124 screenfull.off('fullscreenchange', onFullScreenEntered); 1125 resolve(); 1126 }; 1127 1128 screenfull.on('fullscreenchange', onFullScreenEntered); 1129 element = element || document.documentElement; 1130 var returnPromise = element[fn.requestFullscreen](); 1131 1132 if (returnPromise instanceof Promise) { 1133 returnPromise.then(onFullScreenEntered).catch(reject); 1134 } 1135 }); 1136 }, 1137 exit: function exit() { 1138 return new Promise(function (resolve, reject) { 1139 if (!screenfull.isFullscreen) { 1140 resolve(); 1141 return; 1142 } 1143 1144 var onFullScreenExit = function onFullScreenExit() { 1145 screenfull.off('fullscreenchange', onFullScreenExit); 1146 resolve(); 1147 }; 1148 1149 screenfull.on('fullscreenchange', onFullScreenExit); 1150 var returnPromise = document[fn.exitFullscreen](); 1151 1152 if (returnPromise instanceof Promise) { 1153 returnPromise.then(onFullScreenExit).catch(reject); 1154 } 1155 }); 1156 }, 1157 on: function on(event, callback) { 1158 var eventName = eventNameMap[event]; 1159 1160 if (eventName) { 1161 document.addEventListener(eventName, callback); 1162 } 1163 }, 1164 off: function off(event, callback) { 1165 var eventName = eventNameMap[event]; 1166 1167 if (eventName) { 1168 document.removeEventListener(eventName, callback); 1169 } 1170 } 1171 }; 1172 Object.defineProperties(screenfull, { 1173 isFullscreen: { 1174 get: function get() { 1175 return Boolean(document[fn.fullscreenElement]); 1176 } 1177 }, 1178 element: { 1179 enumerable: true, 1180 get: function get() { 1181 return document[fn.fullscreenElement]; 1182 } 1183 }, 1184 isEnabled: { 1185 enumerable: true, 1186 get: function get() { 1187 // Coerce to boolean in case of old WebKit 1188 return Boolean(document[fn.fullscreenEnabled]); 1189 } 1190 } 1191 }); 1192 return screenfull; 1193} 1194 1195var playerMap = new WeakMap(); 1196var readyMap = new WeakMap(); 1197var screenfull = {}; 1198 1199var Player = /*#__PURE__*/function () { 1200 /** 1201 * Create a Player. 1202 * 1203 * @param {(HTMLIFrameElement|HTMLElement|string|jQuery)} element A reference to the Vimeo 1204 * player iframe, and id, or a jQuery object. 1205 * @param {object} [options] oEmbed parameters to use when creating an embed in the element. 1206 * @return {Player} 1207 */ 1208 function Player(element) { 1209 var _this = this; 1210 1211 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1212 1213 _classCallCheck(this, Player); 1214 1215 /* global jQuery */ 1216 if (__webpack_provided_window_dot_
vendor: 37,333 bytes, lines 1216-2578
1216jQuery && element instanceof jQuery) { 1217 if (element.length > 1 && window.console && console.warn) { 1218 console.warn('A jQuery object with multiple elements was passed, using the first element.'); 1219 } 1220 1221 element = element[0]; 1222 } // Find an element by ID 1223 1224 1225 if (typeof document !== 'undefined' && typeof element === 'string') { 1226 element = document.getElementById(element); 1227 } // Not an element! 1228 1229 1230 if (!isDomElement(element)) { 1231 throw new TypeError('You must pass either a valid element or a valid id.'); 1232 } // Already initialized an embed in this div, so grab the iframe 1233 1234 1235 if (element.nodeName !== 'IFRAME') { 1236 var iframe = element.querySelector('iframe'); 1237 1238 if (iframe) { 1239 element = iframe; 1240 } 1241 } // iframe url is not a Vimeo url 1242 1243 1244 if (element.nodeName === 'IFRAME' && !isVimeoUrl(element.getAttribute('src') || '')) { 1245 throw new Error('The player element passed isnât a Vimeo embed.'); 1246 } // If there is already a player object in the map, return that 1247 1248 1249 if (playerMap.has(element)) { 1250 return playerMap.get(element); 1251 } 1252 1253 this._window = element.ownerDocument.defaultView; 1254 this.element = element; 1255 this.origin = '*'; 1256 var readyPromise = new npo_src(function (resolve, reject) { 1257 _this._onMessage = function (event) { 1258 if (!isVimeoUrl(event.origin) || _this.element.contentWindow !== event.source) { 1259 return; 1260 } 1261 1262 if (_this.origin === '*') { 1263 _this.origin = event.origin; 1264 } 1265 1266 var data = parseMessageData(event.data); 1267 var isError = data && data.event === 'error'; 1268 var isReadyError = isError && data.data && data.data.method === 'ready'; 1269 1270 if (isReadyError) { 1271 var error = new Error(data.data.message); 1272 error.name = data.data.name; 1273 reject(error); 1274 return; 1275 } 1276 1277 var isReadyEvent = data && data.event === 'ready'; 1278 var isPingResponse = data && data.method === 'ping'; 1279 1280 if (isReadyEvent || isPingResponse) { 1281 _this.element.setAttribute('data-ready', 'true'); 1282 1283 resolve(); 1284 return; 1285 } 1286 1287 processData(_this, data); 1288 }; 1289 1290 _this._window.addEventListener('message', _this._onMessage); 1291 1292 if (_this.element.nodeName !== 'IFRAME') { 1293 var params = getOEmbedParameters(element, options); 1294 var url = getVimeoUrl(params); 1295 getOEmbedData(url, params, element).then(function (data) { 1296 var iframe = createEmbed(data, element); // Overwrite element with the new iframe, 1297 // but store reference to the original element 1298 1299 _this.element = iframe; 1300 _this._originalElement = element; 1301 swapCallbacks(element, iframe); 1302 playerMap.set(_this.element, _this); 1303 return data; 1304 }).catch(reject); 1305 } 1306 }); // Store a copy of this Player in the map 1307 1308 readyMap.set(this, readyPromise); 1309 playerMap.set(this.element, this); // Send a ping to the iframe so the ready promise will be resolved if 1310 // the player is already ready. 1311 1312 if (this.element.nodeName === 'IFRAME') { 1313 postMessage(this, 'ping'); 1314 } 1315 1316 if (screenfull.isEnabled) { 1317 var exitFullscreen = function exitFullscreen() { 1318 return screenfull.exit(); 1319 }; 1320 1321 this.fullscreenchangeHandler = function () { 1322 if (screenfull.isFullscreen) { 1323 storeCallback(_this, 'event:exitFullscreen', exitFullscreen); 1324 } else { 1325 removeCallback(_this, 'event:exitFullscreen', exitFullscreen); 1326 } // eslint-disable-next-line 1327 1328 1329 _this.ready().then(function () { 1330 postMessage(_this, 'fullscreenchange', screenfull.isFullscreen); 1331 }); 1332 }; 1333 1334 screenfull.on('fullscreenchange', this.fullscreenchangeHandler); 1335 } 1336 1337 return this; 1338 } 1339 /** 1340 * Get a promise for a method. 1341 * 1342 * @param {string} name The API method to call. 1343 * @param {Object} [args={}] Arguments to send via postMessage. 1344 * @return {Promise} 1345 */ 1346 1347 1348 _createClass(Player, [{ 1349 key: "callMethod", 1350 value: function callMethod(name) { 1351 var _this2 = this; 1352 1353 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1354 return new npo_src(function (resolve, reject) { 1355 // We are storing the resolve/reject handlers to call later, so we 1356 // canât return here. 1357 // eslint-disable-next-line promise/always-return 1358 return _this2.ready().then(function () { 1359 storeCallback(_this2, name, { 1360 resolve: resolve, 1361 reject: reject 1362 }); 1363 postMessage(_this2, name, args); 1364 }).catch(reject); 1365 }); 1366 } 1367 /** 1368 * Get a promise for the value of a player property. 1369 * 1370 * @param {string} name The property name 1371 * @return {Promise} 1372 */ 1373 1374 }, { 1375 key: "get", 1376 value: function get(name) { 1377 var _this3 = this; 1378 1379 return new npo_src(function (resolve, reject) { 1380 name = getMethodName(name, 'get'); // We are storing the resolve/reject handlers to call later, so we 1381 // canât return here. 1382 // eslint-disable-next-line promise/always-return 1383 1384 return _this3.ready().then(function () { 1385 storeCallback(_this3, name, { 1386 resolve: resolve, 1387 reject: reject 1388 }); 1389 postMessage(_this3, name); 1390 }).catch(reject); 1391 }); 1392 } 1393 /** 1394 * Get a promise for setting the value of a player property. 1395 * 1396 * @param {string} name The API method to call. 1397 * @param {mixed} value The value to set. 1398 * @return {Promise} 1399 */ 1400 1401 }, { 1402 key: "set", 1403 value: function set(name, value) { 1404 var _this4 = this; 1405 1406 return new npo_src(function (resolve, reject) { 1407 name = getMethodName(name, 'set'); 1408 1409 if (value === undefined || value === null) { 1410 throw new TypeError('There must be a value to set.'); 1411 } // We are storing the resolve/reject handlers to call later, so we 1412 // canât return here. 1413 // eslint-disable-next-line promise/always-return 1414 1415 1416 return _this4.ready().then(function () { 1417 storeCallback(_this4, name, { 1418 resolve: resolve, 1419 reject: reject 1420 }); 1421 postMessage(_this4, name, value); 1422 }).catch(reject); 1423 }); 1424 } 1425 /** 1426 * Add an event listener for the specified event. Will call the 1427 * callback with a single parameter, `data`, that contains the data for 1428 * that event. 1429 * 1430 * @param {string} eventName The name of the event. 1431 * @param {function(*)} callback The function to call when the event fires. 1432 * @return {void} 1433 */ 1434 1435 }, { 1436 key: "on", 1437 value: function on(eventName, callback) { 1438 if (!eventName) { 1439 throw new TypeError('You must pass an event name.'); 1440 } 1441 1442 if (!callback) { 1443 throw new TypeError('You must pass a callback function.'); 1444 } 1445 1446 if (typeof callback !== 'function') { 1447 throw new TypeError('The callback must be a function.'); 1448 } 1449 1450 var callbacks = getCallbacks(this, "event:".concat(eventName)); 1451 1452 if (callbacks.length === 0) { 1453 this.callMethod('addEventListener', eventName).catch(function () {// Ignore the error. There will be an error event fired that 1454 // will trigger the error callback if they are listening. 1455 }); 1456 } 1457 1458 storeCallback(this, "event:".concat(eventName), callback); 1459 } 1460 /** 1461 * Remove an event listener for the specified event. Will remove all 1462 * listeners for that event if a `callback` isnât passed, or only that 1463 * specific callback if it is passed. 1464 * 1465 * @param {string} eventName The name of the event. 1466 * @param {function} [callback] The specific callback to remove. 1467 * @return {void} 1468 */ 1469 1470 }, { 1471 key: "off", 1472 value: function off(eventName, callback) { 1473 if (!eventName) { 1474 throw new TypeError('You must pass an event name.'); 1475 } 1476 1477 if (callback && typeof callback !== 'function') { 1478 throw new TypeError('The callback must be a function.'); 1479 } 1480 1481 var lastCallback = removeCallback(this, "event:".concat(eventName), callback); // If there are no callbacks left, remove the listener 1482 1483 if (lastCallback) { 1484 this.callMethod('removeEventListener', eventName).catch(function (e) {// Ignore the error. There will be an error event fired that 1485 // will trigger the error callback if they are listening. 1486 }); 1487 } 1488 } 1489 /** 1490 * A promise to load a new video. 1491 * 1492 * @promise LoadVideoPromise 1493 * @fulfill {number} The video with this id or url successfully loaded. 1494 * @reject {TypeError} The id was not a number. 1495 */ 1496 1497 /** 1498 * Load a new video into this embed. The promise will be resolved if 1499 * the video is successfully loaded, or it will be rejected if it could 1500 * not be loaded. 1501 * 1502 * @param {number|string|object} options The id of the video, the url of the video, or an object with embed options. 1503 * @return {LoadVideoPromise} 1504 */ 1505 1506 }, { 1507 key: "loadVideo", 1508 value: function loadVideo(options) { 1509 return this.callMethod('loadVideo', options); 1510 } 1511 /** 1512 * A promise to perform an action when the Player is ready. 1513 * 1514 * @todo document errors 1515 * @promise LoadVideoPromise 1516 * @fulfill {void} 1517 */ 1518 1519 /** 1520 * Trigger a function when the player iframe has initialized. You do not 1521 * need to wait for `ready` to trigger to begin adding event listeners 1522 * or calling other methods. 1523 * 1524 * @return {ReadyPromise} 1525 */ 1526 1527 }, { 1528 key: "ready", 1529 value: function ready() { 1530 var readyPromise = readyMap.get(this) || new npo_src(function (resolve, reject) { 1531 reject(new Error('Unknown player. Probably unloaded.')); 1532 }); 1533 return npo_src.resolve(readyPromise); 1534 } 1535 /** 1536 * A promise to add a cue point to the player. 1537 * 1538 * @promise AddCuePointPromise 1539 * @fulfill {string} The id of the cue point to use for removeCuePoint. 1540 * @reject {RangeError} the time was less than 0 or greater than the 1541 * videoâs duration. 1542 * @reject {UnsupportedError} Cue points are not supported with the current 1543 * player or browser. 1544 */ 1545 1546 /** 1547 * Add a cue point to the player. 1548 * 1549 * @param {number} time The time for the cue point. 1550 * @param {object} [data] Arbitrary data to be returned with the cue point. 1551 * @return {AddCuePointPromise} 1552 */ 1553 1554 }, { 1555 key: "addCuePoint", 1556 value: function addCuePoint(time) { 1557 var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1558 return this.callMethod('addCuePoint', { 1559 time: time, 1560 data: data 1561 }); 1562 } 1563 /** 1564 * A promise to remove a cue point from the player. 1565 * 1566 * @promise AddCuePointPromise 1567 * @fulfill {string} The id of the cue point that was removed. 1568 * @reject {InvalidCuePoint} The cue point with the specified id was not 1569 * found. 1570 * @reject {UnsupportedError} Cue points are not supported with the current 1571 * player or browser. 1572 */ 1573 1574 /** 1575 * Remove a cue point from the video. 1576 * 1577 * @param {string} id The id of the cue point to remove. 1578 * @return {RemoveCuePointPromise} 1579 */ 1580 1581 }, { 1582 key: "removeCuePoint", 1583 value: function removeCuePoint(id) { 1584 return this.callMethod('removeCuePoint', id); 1585 } 1586 /** 1587 * A representation of a text track on a video. 1588 * 1589 * @typedef {Object} VimeoTextTrack 1590 * @property {string} language The ISO language code. 1591 * @property {string} kind The kind of track it is (captions or subtitles). 1592 * @property {string} label The humanâreadable label for the track. 1593 */ 1594 1595 /** 1596 * A promise to enable a text track. 1597 * 1598 * @promise EnableTextTrackPromise 1599 * @fulfill {VimeoTextTrack} The text track that was enabled. 1600 * @reject {InvalidTrackLanguageError} No track was available with the 1601 * specified language. 1602 * @reject {InvalidTrackError} No track was available with the specified 1603 * language and kind. 1604 */ 1605 1606 /** 1607 * Enable the text track with the specified language, and optionally the 1608 * specified kind (captions or subtitles). 1609 * 1610 * When set via the API, the track language will not change the viewerâs 1611 * stored preference. 1612 * 1613 * @param {string} language The twoâletter language code. 1614 * @param {string} [kind] The kind of track to enable (captions or subtitles). 1615 * @return {EnableTextTrackPromise} 1616 */ 1617 1618 }, { 1619 key: "enableTextTrack", 1620 value: function enableTextTrack(language, kind) { 1621 if (!language) { 1622 throw new TypeError('You must pass a language.'); 1623 } 1624 1625 return this.callMethod('enableTextTrack', { 1626 language: language, 1627 kind: kind 1628 }); 1629 } 1630 /** 1631 * A promise to disable the active text track. 1632 * 1633 * @promise DisableTextTrackPromise 1634 * @fulfill {void} The track was disabled. 1635 */ 1636 1637 /** 1638 * Disable the currently-active text track. 1639 * 1640 * @return {DisableTextTrackPromise} 1641 */ 1642 1643 }, { 1644 key: "disableTextTrack", 1645 value: function disableTextTrack() { 1646 return this.callMethod('disableTextTrack'); 1647 } 1648 /** 1649 * A promise to pause the video. 1650 * 1651 * @promise PausePromise 1652 * @fulfill {void} The video was paused. 1653 */ 1654 1655 /** 1656 * Pause the video if itâs playing. 1657 * 1658 * @return {PausePromise} 1659 */ 1660 1661 }, { 1662 key: "pause", 1663 value: function pause() { 1664 return this.callMethod('pause'); 1665 } 1666 /** 1667 * A promise to play the video. 1668 * 1669 * @promise PlayPromise 1670 * @fulfill {void} The video was played. 1671 */ 1672 1673 /** 1674 * Play the video if itâs paused. **Note:** on iOS and some other 1675 * mobile devices, you cannot programmatically trigger play. Once the 1676 * viewer has tapped on the play button in the player, however, you 1677 * will be able to use this function. 1678 * 1679 * @return {PlayPromise} 1680 */ 1681 1682 }, { 1683 key: "play", 1684 value: function play() { 1685 return this.callMethod('play'); 1686 } 1687 /** 1688 * Request that the player enters fullscreen. 1689 * @return {Promise} 1690 */ 1691 1692 }, { 1693 key: "requestFullscreen", 1694 value: function requestFullscreen() { 1695 if (screenfull.isEnabled) { 1696 return screenfull.request(this.element); 1697 } 1698 1699 return this.callMethod('requestFullscreen'); 1700 } 1701 /** 1702 * Request that the player exits fullscreen. 1703 * @return {Promise} 1704 */ 1705 1706 }, { 1707 key: "exitFullscreen", 1708 value: function exitFullscreen() { 1709 if (screenfull.isEnabled) { 1710 return screenfull.exit(); 1711 } 1712 1713 return this.callMethod('exitFullscreen'); 1714 } 1715 /** 1716 * Returns true if the player is currently fullscreen. 1717 * @return {Promise} 1718 */ 1719 1720 }, { 1721 key: "getFullscreen", 1722 value: function getFullscreen() { 1723 if (screenfull.isEnabled) { 1724 return npo_src.resolve(screenfull.isFullscreen); 1725 } 1726 1727 return this.get('fullscreen'); 1728 } 1729 /** 1730 * Request that the player enters picture-in-picture. 1731 * @return {Promise} 1732 */ 1733 1734 }, { 1735 key: "requestPictureInPicture", 1736 value: function requestPictureInPicture() { 1737 return this.callMethod('requestPictureInPicture'); 1738 } 1739 /** 1740 * Request that the player exits picture-in-picture. 1741 * @return {Promise} 1742 */ 1743 1744 }, { 1745 key: "exitPictureInPicture", 1746 value: function exitPictureInPicture() { 1747 return this.callMethod('exitPictureInPicture'); 1748 } 1749 /** 1750 * Returns true if the player is currently picture-in-picture. 1751 * @return {Promise} 1752 */ 1753 1754 }, { 1755 key: "getPictureInPicture", 1756 value: function getPictureInPicture() { 1757 return this.get('pictureInPicture'); 1758 } 1759 /** 1760 * A promise to unload the video. 1761 * 1762 * @promise UnloadPromise 1763 * @fulfill {void} The video was unloaded. 1764 */ 1765 1766 /** 1767 * Return the player to its initial state. 1768 * 1769 * @return {UnloadPromise} 1770 */ 1771 1772 }, { 1773 key: "unload", 1774 value: function unload() { 1775 return this.callMethod('unload'); 1776 } 1777 /** 1778 * Cleanup the player and remove it from the DOM 1779 * 1780 * It won't be usable and a new one should be constructed 1781 * in order to do any operations. 1782 * 1783 * @return {Promise} 1784 */ 1785 1786 }, { 1787 key: "destroy", 1788 value: function destroy() { 1789 var _this5 = this; 1790 1791 return new npo_src(function (resolve) { 1792 readyMap.delete(_this5); 1793 playerMap.delete(_this5.element); 1794 1795 if (_this5._originalElement) { 1796 playerMap.delete(_this5._originalElement); 1797 1798 _this5._originalElement.removeAttribute('data-vimeo-initialized'); 1799 } 1800 1801 if (_this5.element && _this5.element.nodeName === 'IFRAME' && _this5.element.parentNode) { 1802 // If we've added an additional wrapper div, remove that from the DOM. 1803 // If not, just remove the iframe element. 1804 if (_this5.element.parentNode.parentNode && _this5._originalElement && _this5._originalElement !== _this5.element.parentNode) { 1805 _this5.element.parentNode.parentNode.removeChild(_this5.element.parentNode); 1806 } else { 1807 _this5.element.parentNode.removeChild(_this5.element); 1808 } 1809 } // If the clip is private there is a case where the element stays the 1810 // div element. Destroy should reset the div and remove the iframe child. 1811 1812 1813 if (_this5.element && _this5.element.nodeName === 'DIV' && _this5.element.parentNode) { 1814 _this5.element.removeAttribute('data-vimeo-initialized'); 1815 1816 var iframe = _this5.element.querySelector('iframe'); 1817 1818 if (iframe && iframe.parentNode) { 1819 // If we've added an additional wrapper div, remove that from the DOM. 1820 // If not, just remove the iframe element. 1821 if (iframe.parentNode.parentNode && _this5._originalElement && _this5._originalElement !== iframe.parentNode) { 1822 iframe.parentNode.parentNode.removeChild(iframe.parentNode); 1823 } else { 1824 iframe.parentNode.removeChild(iframe); 1825 } 1826 } 1827 } 1828 1829 _this5._window.removeEventListener('message', _this5._onMessage); 1830 1831 if (screenfull.isEnabled) { 1832 screenfull.off('fullscreenchange', _this5.fullscreenchangeHandler); 1833 } 1834 1835 resolve(); 1836 }); 1837 } 1838 /** 1839 * A promise to get the autopause behavior of the video. 1840 * 1841 * @promise GetAutopausePromise 1842 * @fulfill {boolean} Whether autopause is turned on or off. 1843 * @reject {UnsupportedError} Autopause is not supported with the current 1844 * player or browser. 1845 */ 1846 1847 /** 1848 * Get the autopause behavior for this player. 1849 * 1850 * @return {GetAutopausePromise} 1851 */ 1852 1853 }, { 1854 key: "getAutopause", 1855 value: function getAutopause() { 1856 return this.get('autopause'); 1857 } 1858 /** 1859 * A promise to set the autopause behavior of the video. 1860 * 1861 * @promise SetAutopausePromise 1862 * @fulfill {boolean} Whether autopause is turned on or off. 1863 * @reject {UnsupportedError} Autopause is not supported with the current 1864 * player or browser. 1865 */ 1866 1867 /** 1868 * Enable or disable the autopause behavior of this player. 1869 * 1870 * By default, when another video is played in the same browser, this 1871 * player will automatically pause. Unless you have a specific reason 1872 * for doing so, we recommend that you leave autopause set to the 1873 * default (`true`). 1874 * 1875 * @param {boolean} autopause 1876 * @return {SetAutopausePromise} 1877 */ 1878 1879 }, { 1880 key: "setAutopause", 1881 value: function setAutopause(autopause) { 1882 return this.set('autopause', autopause); 1883 } 1884 /** 1885 * A promise to get the buffered property of the video. 1886 * 1887 * @promise GetBufferedPromise 1888 * @fulfill {Array} Buffered Timeranges converted to an Array. 1889 */ 1890 1891 /** 1892 * Get the buffered property of the video. 1893 * 1894 * @return {GetBufferedPromise} 1895 */ 1896 1897 }, { 1898 key: "getBuffered", 1899 value: function getBuffered() { 1900 return this.get('buffered'); 1901 } 1902 /** 1903 * @typedef {Object} CameraProperties 1904 * @prop {number} props.yaw - Number between 0 and 360. 1905 * @prop {number} props.pitch - Number between -90 and 90. 1906 * @prop {number} props.roll - Number between -180 and 180. 1907 * @prop {number} props.fov - The field of view in degrees. 1908 */ 1909 1910 /** 1911 * A promise to get the camera properties of the player. 1912 * 1913 * @promise GetCameraPromise 1914 * @fulfill {CameraProperties} The camera properties. 1915 */ 1916 1917 /** 1918 * For 360° videos get the camera properties for this player. 1919 * 1920 * @return {GetCameraPromise} 1921 */ 1922 1923 }, { 1924 key: "getCameraProps", 1925 value: function getCameraProps() { 1926 return this.get('cameraProps'); 1927 } 1928 /** 1929 * A promise to set the camera properties of the player. 1930 * 1931 * @promise SetCameraPromise 1932 * @fulfill {Object} The camera was successfully set. 1933 * @reject {RangeError} The range was out of bounds. 1934 */ 1935 1936 /** 1937 * For 360° videos set the camera properties for this player. 1938 * 1939 * @param {CameraProperties} camera The camera properties 1940 * @return {SetCameraPromise} 1941 */ 1942 1943 }, { 1944 key: "setCameraProps", 1945 value: function setCameraProps(camera) { 1946 return this.set('cameraProps', camera); 1947 } 1948 /** 1949 * A representation of a chapter. 1950 * 1951 * @typedef {Object} VimeoChapter 1952 * @property {number} startTime The start time of the chapter. 1953 * @property {object} title The title of the chapter. 1954 * @property {number} index The place in the order of Chapters. Starts at 1. 1955 */ 1956 1957 /** 1958 * A promise to get chapters for the video. 1959 * 1960 * @promise GetChaptersPromise 1961 * @fulfill {VimeoChapter[]} The chapters for the video. 1962 */ 1963 1964 /** 1965 * Get an array of all the chapters for the video. 1966 * 1967 * @return {GetChaptersPromise} 1968 */ 1969 1970 }, { 1971 key: "getChapters", 1972 value: function getChapters() { 1973 return this.get('chapters'); 1974 } 1975 /** 1976 * A promise to get the currently active chapter. 1977 * 1978 * @promise GetCurrentChaptersPromise 1979 * @fulfill {VimeoChapter|undefined} The current chapter for the video. 1980 */ 1981 1982 /** 1983 * Get the currently active chapter for the video. 1984 * 1985 * @return {GetCurrentChaptersPromise} 1986 */ 1987 1988 }, { 1989 key: "getCurrentChapter", 1990 value: function getCurrentChapter() { 1991 return this.get('currentChapter'); 1992 } 1993 /** 1994 * A promise to get the color of the player. 1995 * 1996 * @promise GetColorPromise 1997 * @fulfill {string} The hex color of the player. 1998 */ 1999 2000 /** 2001 * Get the color for this player. 2002 * 2003 * @return {GetColorPromise} 2004 */ 2005 2006 }, { 2007 key: "getColor", 2008 value: function getColor() { 2009 return this.get('color'); 2010 } 2011 /** 2012 * A promise to set the color of the player. 2013 * 2014 * @promise SetColorPromise 2015 * @fulfill {string} The color was successfully set. 2016 * @reject {TypeError} The string was not a valid hex or rgb color. 2017 * @reject {ContrastError} The color was set, but the contrast is 2018 * outside of the acceptable range. 2019 * @reject {EmbedSettingsError} The owner of the player has chosen to 2020 * use a specific color. 2021 */ 2022 2023 /** 2024 * Set the color of this player to a hex or rgb string. Setting the 2025 * color may fail if the owner of the video has set their embed 2026 * preferences to force a specific color. 2027 * 2028 * @param {string} color The hex or rgb color string to set. 2029 * @return {SetColorPromise} 2030 */ 2031 2032 }, { 2033 key: "setColor", 2034 value: function setColor(color) { 2035 return this.set('color', color); 2036 } 2037 /** 2038 * A representation of a cue point. 2039 * 2040 * @typedef {Object} VimeoCuePoint 2041 * @property {number} time The time of the cue point. 2042 * @property {object} data The data passed when adding the cue point. 2043 * @property {string} id The unique id for use with removeCuePoint. 2044 */ 2045 2046 /** 2047 * A promise to get the cue points of a video. 2048 * 2049 * @promise GetCuePointsPromise 2050 * @fulfill {VimeoCuePoint[]} The cue points added to the video. 2051 * @reject {UnsupportedError} Cue points are not supported with the current 2052 * player or browser. 2053 */ 2054 2055 /** 2056 * Get an array of the cue points added to the video. 2057 * 2058 * @return {GetCuePointsPromise} 2059 */ 2060 2061 }, { 2062 key: "getCuePoints", 2063 value: function getCuePoints() { 2064 return this.get('cuePoints'); 2065 } 2066 /** 2067 * A promise to get the current time of the video. 2068 * 2069 * @promise GetCurrentTimePromise 2070 * @fulfill {number} The current time in seconds. 2071 */ 2072 2073 /** 2074 * Get the current playback position in seconds. 2075 * 2076 * @return {GetCurrentTimePromise} 2077 */ 2078 2079 }, { 2080 key: "getCurrentTime", 2081 value: function getCurrentTime() { 2082 return this.get('currentTime'); 2083 } 2084 /** 2085 * A promise to set the current time of the video. 2086 * 2087 * @promise SetCurrentTimePromise 2088 * @fulfill {number} The actual current time that was set. 2089 * @reject {RangeError} the time was less than 0 or greater than the 2090 * videoâs duration. 2091 */ 2092 2093 /** 2094 * Set the current playback position in seconds. If the player was 2095 * paused, it will remain paused. Likewise, if the player was playing, 2096 * it will resume playing once the video has buffered. 2097 * 2098 * You can provide an accurate time and the player will attempt to seek 2099 * to as close to that time as possible. The exact time will be the 2100 * fulfilled value of the promise. 2101 * 2102 * @param {number} currentTime 2103 * @return {SetCurrentTimePromise} 2104 */ 2105 2106 }, { 2107 key: "setCurrentTime", 2108 value: function setCurrentTime(currentTime) { 2109 return this.set('currentTime', currentTime); 2110 } 2111 /** 2112 * A promise to get the duration of the video. 2113 * 2114 * @promise GetDurationPromise 2115 * @fulfill {number} The duration in seconds. 2116 */ 2117 2118 /** 2119 * Get the duration of the video in seconds. It will be rounded to the 2120 * nearest second before playback begins, and to the nearest thousandth 2121 * of a second after playback begins. 2122 * 2123 * @return {GetDurationPromise} 2124 */ 2125 2126 }, { 2127 key: "getDuration", 2128 value: function getDuration() { 2129 return this.get('duration'); 2130 } 2131 /** 2132 * A promise to get the ended state of the video. 2133 * 2134 * @promise GetEndedPromise 2135 * @fulfill {boolean} Whether or not the video has ended. 2136 */ 2137 2138 /** 2139 * Get the ended state of the video. The video has ended if 2140 * `currentTime === duration`. 2141 * 2142 * @return {GetEndedPromise} 2143 */ 2144 2145 }, { 2146 key: "getEnded", 2147 value: function getEnded() { 2148 return this.get('ended'); 2149 } 2150 /** 2151 * A promise to get the loop state of the player. 2152 * 2153 * @promise GetLoopPromise 2154 * @fulfill {boolean} Whether or not the player is set to loop. 2155 */ 2156 2157 /** 2158 * Get the loop state of the player. 2159 * 2160 * @return {GetLoopPromise} 2161 */ 2162 2163 }, { 2164 key: "getLoop", 2165 value: function getLoop() { 2166 return this.get('loop'); 2167 } 2168 /** 2169 * A promise to set the loop state of the player. 2170 * 2171 * @promise SetLoopPromise 2172 * @fulfill {boolean} The loop state that was set. 2173 */ 2174 2175 /** 2176 * Set the loop state of the player. When set to `true`, the player 2177 * will start over immediately once playback ends. 2178 * 2179 * @param {boolean} loop 2180 * @return {SetLoopPromise} 2181 */ 2182 2183 }, { 2184 key: "setLoop", 2185 value: function setLoop(loop) { 2186 return this.set('loop', loop); 2187 } 2188 /** 2189 * A promise to set the muted state of the player. 2190 * 2191 * @promise SetMutedPromise 2192 * @fulfill {boolean} The muted state that was set. 2193 */ 2194 2195 /** 2196 * Set the muted state of the player. When set to `true`, the player 2197 * volume will be muted. 2198 * 2199 * @param {boolean} muted 2200 * @return {SetMutedPromise} 2201 */ 2202 2203 }, { 2204 key: "setMuted", 2205 value: function setMuted(muted) { 2206 return this.set('muted', muted); 2207 } 2208 /** 2209 * A promise to get the muted state of the player. 2210 * 2211 * @promise GetMutedPromise 2212 * @fulfill {boolean} Whether or not the player is muted. 2213 */ 2214 2215 /** 2216 * Get the muted state of the player. 2217 * 2218 * @return {GetMutedPromise} 2219 */ 2220 2221 }, { 2222 key: "getMuted", 2223 value: function getMuted() { 2224 return this.get('muted'); 2225 } 2226 /** 2227 * A promise to get the paused state of the player. 2228 * 2229 * @promise GetLoopPromise 2230 * @fulfill {boolean} Whether or not the video is paused. 2231 */ 2232 2233 /** 2234 * Get the paused state of the player. 2235 * 2236 * @return {GetLoopPromise} 2237 */ 2238 2239 }, { 2240 key: "getPaused", 2241 value: function getPaused() { 2242 return this.get('paused'); 2243 } 2244 /** 2245 * A promise to get the playback rate of the player. 2246 * 2247 * @promise GetPlaybackRatePromise 2248 * @fulfill {number} The playback rate of the player on a scale from 0.5 to 2. 2249 */ 2250 2251 /** 2252 * Get the playback rate of the player on a scale from `0.5` to `2`. 2253 * 2254 * @return {GetPlaybackRatePromise} 2255 */ 2256 2257 }, { 2258 key: "getPlaybackRate", 2259 value: function getPlaybackRate() { 2260 return this.get('playbackRate'); 2261 } 2262 /** 2263 * A promise to set the playbackrate of the player. 2264 * 2265 * @promise SetPlaybackRatePromise 2266 * @fulfill {number} The playback rate was set. 2267 * @reject {RangeError} The playback rate was less than 0.5 or greater than 2. 2268 */ 2269 2270 /** 2271 * Set the playback rate of the player on a scale from `0.5` to `2`. When set 2272 * via the API, the playback rate will not be synchronized to other 2273 * players or stored as the viewer's preference. 2274 * 2275 * @param {number} playbackRate 2276 * @return {SetPlaybackRatePromise} 2277 */ 2278 2279 }, { 2280 key: "setPlaybackRate", 2281 value: function setPlaybackRate(playbackRate) { 2282 return this.set('playbackRate', playbackRate); 2283 } 2284 /** 2285 * A promise to get the played property of the video. 2286 * 2287 * @promise GetPlayedPromise 2288 * @fulfill {Array} Played Timeranges converted to an Array. 2289 */ 2290 2291 /** 2292 * Get the played property of the video. 2293 * 2294 * @return {GetPlayedPromise} 2295 */ 2296 2297 }, { 2298 key: "getPlayed", 2299 value: function getPlayed() { 2300 return this.get('played'); 2301 } 2302 /** 2303 * A promise to get the qualities available of the current video. 2304 * 2305 * @promise GetQualitiesPromise 2306 * @fulfill {Array} The qualities of the video. 2307 */ 2308 2309 /** 2310 * Get the qualities of the current video. 2311 * 2312 * @return {GetQualitiesPromise} 2313 */ 2314 2315 }, { 2316 key: "getQualities", 2317 value: function getQualities() { 2318 return this.get('qualities'); 2319 } 2320 /** 2321 * A promise to get the current set quality of the video. 2322 * 2323 * @promise GetQualityPromise 2324 * @fulfill {string} The current set quality. 2325 */ 2326 2327 /** 2328 * Get the current set quality of the video. 2329 * 2330 * @return {GetQualityPromise} 2331 */ 2332 2333 }, { 2334 key: "getQuality", 2335 value: function getQuality() { 2336 return this.get('quality'); 2337 } 2338 /** 2339 * A promise to set the video quality. 2340 * 2341 * @promise SetQualityPromise 2342 * @fulfill {number} The quality was set. 2343 * @reject {RangeError} The quality is not available. 2344 */ 2345 2346 /** 2347 * Set a video quality. 2348 * 2349 * @param {string} quality 2350 * @return {SetQualityPromise} 2351 */ 2352 2353 }, { 2354 key: "setQuality", 2355 value: function setQuality(quality) { 2356 return this.set('quality', quality); 2357 } 2358 /** 2359 * A promise to get the seekable property of the video. 2360 * 2361 * @promise GetSeekablePromise 2362 * @fulfill {Array} Seekable Timeranges converted to an Array. 2363 */ 2364 2365 /** 2366 * Get the seekable property of the video. 2367 * 2368 * @return {GetSeekablePromise} 2369 */ 2370 2371 }, { 2372 key: "getSeekable", 2373 value: function getSeekable() { 2374 return this.get('seekable'); 2375 } 2376 /** 2377 * A promise to get the seeking property of the player. 2378 * 2379 * @promise GetSeekingPromise 2380 * @fulfill {boolean} Whether or not the player is currently seeking. 2381 */ 2382 2383 /** 2384 * Get if the player is currently seeking. 2385 * 2386 * @return {GetSeekingPromise} 2387 */ 2388 2389 }, { 2390 key: "getSeeking", 2391 value: function getSeeking() { 2392 return this.get('seeking'); 2393 } 2394 /** 2395 * A promise to get the text tracks of a video. 2396 * 2397 * @promise GetTextTracksPromise 2398 * @fulfill {VimeoTextTrack[]} The text tracks associated with the video. 2399 */ 2400 2401 /** 2402 * Get an array of the text tracks that exist for the video. 2403 * 2404 * @return {GetTextTracksPromise} 2405 */ 2406 2407 }, { 2408 key: "getTextTracks", 2409 value: function getTextTracks() { 2410 return this.get('textTracks'); 2411 } 2412 /** 2413 * A promise to get the embed code for the video. 2414 * 2415 * @promise GetVideoEmbedCodePromise 2416 * @fulfill {string} The `<iframe>` embed code for the video. 2417 */ 2418 2419 /** 2420 * Get the `<iframe>` embed code for the video. 2421 * 2422 * @return {GetVideoEmbedCodePromise} 2423 */ 2424 2425 }, { 2426 key: "getVideoEmbedCode", 2427 value: function getVideoEmbedCode() { 2428 return this.get('videoEmbedCode'); 2429 } 2430 /** 2431 * A promise to get the id of the video. 2432 * 2433 * @promise GetVideoIdPromise 2434 * @fulfill {number} The id of the video. 2435 */ 2436 2437 /** 2438 * Get the id of the video. 2439 * 2440 * @return {GetVideoIdPromise} 2441 */ 2442 2443 }, { 2444 key: "getVideoId", 2445 value: function getVideoId() { 2446 return this.get('videoId'); 2447 } 2448 /** 2449 * A promise to get the title of the video. 2450 * 2451 * @promise GetVideoTitlePromise 2452 * @fulfill {number} The title of the video. 2453 */ 2454 2455 /** 2456 * Get the title of the video. 2457 * 2458 * @return {GetVideoTitlePromise} 2459 */ 2460 2461 }, { 2462 key: "getVideoTitle", 2463 value: function getVideoTitle() { 2464 return this.get('videoTitle'); 2465 } 2466 /** 2467 * A promise to get the native width of the video. 2468 * 2469 * @promise GetVideoWidthPromise 2470 * @fulfill {number} The native width of the video. 2471 */ 2472 2473 /** 2474 * Get the native width of the currentlyâplaying video. The width of 2475 * the highestâresolution available will be used before playback begins. 2476 * 2477 * @return {GetVideoWidthPromise} 2478 */ 2479 2480 }, { 2481 key: "getVideoWidth", 2482 value: function getVideoWidth() { 2483 return this.get('videoWidth'); 2484 } 2485 /** 2486 * A promise to get the native height of the video. 2487 * 2488 * @promise GetVideoHeightPromise 2489 * @fulfill {number} The native height of the video. 2490 */ 2491 2492 /** 2493 * Get the native height of the currentlyâplaying video. The height of 2494 * the highestâresolution available will be used before playback begins. 2495 * 2496 * @return {GetVideoHeightPromise} 2497 */ 2498 2499 }, { 2500 key: "getVideoHeight", 2501 value: function getVideoHeight() { 2502 return this.get('videoHeight'); 2503 } 2504 /** 2505 * A promise to get the vimeo.com url for the video. 2506 * 2507 * @promise GetVideoUrlPromise 2508 * @fulfill {number} The vimeo.com url for the video. 2509 * @reject {PrivacyError} The url isnât available because of the videoâs privacy setting. 2510 */ 2511 2512 /** 2513 * Get the vimeo.com url for the video. 2514 * 2515 * @return {GetVideoUrlPromise} 2516 */ 2517 2518 }, { 2519 key: "getVideoUrl", 2520 value: function getVideoUrl() { 2521 return this.get('videoUrl'); 2522 } 2523 /** 2524 * A promise to get the volume level of the player. 2525 * 2526 * @promise GetVolumePromise 2527 * @fulfill {number} The volume level of the player on a scale from 0 to 1. 2528 */ 2529 2530 /** 2531 * Get the current volume level of the player on a scale from `0` to `1`. 2532 * 2533 * Most mobile devices do not support an independent volume from the 2534 * system volume. In those cases, this method will always return `1`. 2535 * 2536 * @return {GetVolumePromise} 2537 */ 2538 2539 }, { 2540 key: "getVolume", 2541 value: function getVolume() { 2542 return this.get('volume'); 2543 } 2544 /** 2545 * A promise to set the volume level of the player. 2546 * 2547 * @promise SetVolumePromise 2548 * @fulfill {number} The volume was set. 2549 * @reject {RangeError} The volume was less than 0 or greater than 1. 2550 */ 2551 2552 /** 2553 * Set the volume of the player on a scale from `0` to `1`. When set 2554 * via the API, the volume level will not be synchronized to other 2555 * players or stored as the viewerâs preference. 2556 * 2557 * Most mobile devices do not support setting the volume. An error will 2558 * *not* be triggered in that situation. 2559 * 2560 * @param {number} volume 2561 * @return {SetVolumePromise} 2562 */ 2563 2564 }, { 2565 key: "setVolume", 2566 value: function setVolume(volume) { 2567 return this.set('volume', volume); 2568 } 2569 }]); 2570 2571 return Player; 2572}(); // Setup embed only if this is not a node environment 2573 2574 2575if (!isNode) { 2576 screenfull = initializeScreenfull(); 2577 initializeEmbeds(); 2578 resizeEmbeds();
vendor: 2,813 bytes, lines 2579-2670
2579} 2580 2581/* harmony default export */ __webpack_exports__["a"] = (Player); 2582 2583/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(9), __webpack_require__(15).setImmediate, __webpack_require__(3), __webpack_require__(3))) 2584 2585/***/ }), 2586 2587/***/ 15: 2588/***/ (function(module, exports, __webpack_require__) { 2589 2590/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) || 2591 (typeof self !== "undefined" && self) || 2592 window; 2593var apply = Function.prototype.apply; 2594 2595// DOM APIs, for completeness 2596 2597exports.setTimeout = function() { 2598 return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); 2599}; 2600exports.setInterval = function() { 2601 return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); 2602}; 2603exports.clearTimeout = 2604exports.clearInterval = function(timeout) { 2605 if (timeout) { 2606 timeout.close(); 2607 } 2608}; 2609 2610function Timeout(id, clearFn) { 2611 this._id = id; 2612 this._clearFn = clearFn; 2613} 2614Timeout.prototype.unref = Timeout.prototype.ref = function() {}; 2615Timeout.prototype.close = function() { 2616 this._clearFn.call(scope, this._id); 2617}; 2618 2619// Does not start the time, just sets up the members needed. 2620exports.enroll = function(item, msecs) { 2621 clearTimeout(item._idleTimeoutId); 2622 item._idleTimeout = msecs; 2623}; 2624 2625exports.unenroll = function(item) { 2626 clearTimeout(item._idleTimeoutId); 2627 item._idleTimeout = -1; 2628}; 2629 2630exports._unrefActive = exports.active = function(item) { 2631 clearTimeout(item._idleTimeoutId); 2632 2633 var msecs = item._idleTimeout; 2634 if (msecs >= 0) { 2635 item._idleTimeoutId = setTimeout(function onTimeout() { 2636 if (item._onTimeout) 2637 item._onTimeout(); 2638 }, msecs); 2639 } 2640}; 2641 2642// setimmediate attaches itself to the global object 2643__webpack_require__(16); 2644// On some exotic environments, it's not clear which object `setimmediate` was 2645// able to install onto. Search each possibility in the same order as the 2646// `setimmediate` library. 2647exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || 2648 (typeof global !== "undefined" && global.setImmediate) || 2649 (this && this.setImmediate); 2650exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || 2651 (typeof global !== "undefined" && global.clearImmediate) || 2652 (this && this.clearImmediate); 2653 2654/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9))) 2655 2656/***/ }), 2657 2658/***/ 16: 2659/***/ (function(module, exports, __webpack_require__) { 2660 2661/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { 2662 "use strict"; 2663 2664 if (global.setImmediate) { 2665 return; 2666 } 2667 2668 var nextHandle = 1; // Spec says greater than zero 2669 var tasksByHandle = {}; 2670 var currentlyRunningATask = false;
vendor: 5,701 bytes, lines 2671-2831
2671 var doc = global.document; 2672 var registerImmediate; 2673 2674 function setImmediate(callback) { 2675 // Callback can either be a function or a string 2676 if (typeof callback !== "function") { 2677 callback = new Function("" + callback); 2678 } 2679 // Copy function arguments 2680 var args = new Array(arguments.length - 1); 2681 for (var i = 0; i < args.length; i++) { 2682 args[i] = arguments[i + 1]; 2683 } 2684 // Store and register the task 2685 var task = { callback: callback, args: args }; 2686 tasksByHandle[nextHandle] = task; 2687 registerImmediate(nextHandle); 2688 return nextHandle++; 2689 } 2690 2691 function clearImmediate(handle) { 2692 delete tasksByHandle[handle]; 2693 } 2694 2695 function run(task) { 2696 var callback = task.callback; 2697 var args = task.args; 2698 switch (args.length) { 2699 case 0: 2700 callback(); 2701 break; 2702 case 1: 2703 callback(args[0]); 2704 break; 2705 case 2: 2706 callback(args[0], args[1]); 2707 break; 2708 case 3: 2709 callback(args[0], args[1], args[2]); 2710 break; 2711 default: 2712 callback.apply(undefined, args); 2713 break; 2714 } 2715 } 2716 2717 function runIfPresent(handle) { 2718 // From the spec: "Wait until any invocations of this algorithm started before this one have completed." 2719 // So if we're currently running a task, we'll need to delay this invocation. 2720 if (currentlyRunningATask) { 2721 // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a 2722 // "too much recursion" error. 2723 setTimeout(runIfPresent, 0, handle); 2724 } else { 2725 var task = tasksByHandle[handle]; 2726 if (task) { 2727 currentlyRunningATask = true; 2728 try { 2729 run(task); 2730 } finally { 2731 clearImmediate(handle); 2732 currentlyRunningATask = false; 2733 } 2734 } 2735 } 2736 } 2737 2738 function installNextTickImplementation() { 2739 registerImmediate = function(handle) { 2740 process.nextTick(function () { runIfPresent(handle); }); 2741 }; 2742 } 2743 2744 function canUsePostMessage() { 2745 // The test against `importScripts` prevents this implementation from being installed inside a web worker, 2746 // where `global.postMessage` means something completely different and can't be used for this purpose. 2747 if (global.postMessage && !global.importScripts) { 2748 var postMessageIsAsynchronous = true; 2749 var oldOnMessage = global.onmessage; 2750 global.onmessage = function() { 2751 postMessageIsAsynchronous = false; 2752 }; 2753 global.postMessage("", "*"); 2754 global.onmessage = oldOnMessage; 2755 return postMessageIsAsynchronous; 2756 } 2757 } 2758 2759 function installPostMessageImplementation() { 2760 // Installs an event handler on `global` for the `message` event: see 2761 // * https://developer.mozilla.org/en/DOM/window.postMessage 2762 // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages 2763 2764 var messagePrefix = "setImmediate$" + Math.random() + "$"; 2765 var onGlobalMessage = function(event) { 2766 if (event.source === global && 2767 typeof event.data === "string" && 2768 event.data.indexOf(messagePrefix) === 0) { 2769 runIfPresent(+event.data.slice(messagePrefix.length)); 2770 } 2771 }; 2772 2773 if (global.addEventListener) { 2774 global.addEventListener("message", onGlobalMessage, false); 2775 } else { 2776 global.attachEvent("onmessage", onGlobalMessage); 2777 } 2778 2779 registerImmediate = function(handle) { 2780 global.postMessage(messagePrefix + handle, "*"); 2781 }; 2782 } 2783 2784 function installMessageChannelImplementation() { 2785 var channel = new MessageChannel(); 2786 channel.port1.onmessage = function(event) { 2787 var handle = event.data; 2788 runIfPresent(handle); 2789 }; 2790 2791 registerImmediate = function(handle) { 2792 channel.port2.postMessage(handle); 2793 }; 2794 } 2795 2796 function installReadyStateChangeImplementation() { 2797 var html = doc.documentElement; 2798 registerImmediate = function(handle) { 2799 // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted 2800 // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. 2801 var script = doc.createElement("script"); 2802 script.onreadystatechange = function () { 2803 runIfPresent(handle); 2804 script.onreadystatechange = null; 2805 html.removeChild(script); 2806 script = null; 2807 }; 2808 html.appendChild(script); 2809 }; 2810 } 2811 2812 function installSetTimeoutImplementation() { 2813 registerImmediate = function(handle) { 2814 setTimeout(runIfPresent, 0, handle); 2815 }; 2816 } 2817 2818 // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. 2819 var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); 2820 attachTo = attachTo && attachTo.setTimeout ? attachTo : global; 2821 2822 // Don't get fooled by e.g. browserify environments. 2823 if ({}.toString.call(global.process) === "[object process]") { 2824 // For Node.js before 0.9 2825 installNextTickImplementation(); 2826 2827 } else if (canUsePostMessage()) { 2828 // For non-IE10 modern browsers 2829 installPostMessageImplementation(); 2830 2831 }
vendor: 4,144 bytes, lines 2831-2953
2831 else if (global.MessageChannel) { 2832 // For web workers, where supported 2833 installMessageChannelImplementation(); 2834 2835 } else if (doc && "onreadystatechange" in doc.createElement("script")) { 2836 // For IE 6â8 2837 installReadyStateChangeImplementation(); 2838 2839 } else { 2840 // For older browsers 2841 installSetTimeoutImplementation(); 2842 } 2843 2844 attachTo.setImmediate = setImmediate; 2845 attachTo.clearImmediate = clearImmediate; 2846}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); 2847 2848/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9), __webpack_require__(17))) 2849 2850/***/ }), 2851 2852/***/ 17: 2853/***/ (function(module, exports) { 2854 2855// shim for using process in browser 2856var process = module.exports = {}; 2857 2858// cached from whatever global is present so that test runners that stub it 2859// don't break things. But we need to wrap it in a try catch in case it is 2860// wrapped in strict mode code which doesn't define any globals. It's inside a 2861// function because try/catches deoptimize in certain engines. 2862 2863var cachedSetTimeout; 2864var cachedClearTimeout; 2865 2866function defaultSetTimout() { 2867 throw new Error('setTimeout has not been defined'); 2868} 2869function defaultClearTimeout () { 2870 throw new Error('clearTimeout has not been defined'); 2871} 2872(function () { 2873 try { 2874 if (typeof setTimeout === 'function') { 2875 cachedSetTimeout = setTimeout; 2876 } else { 2877 cachedSetTimeout = defaultSetTimout; 2878 } 2879 } catch (e) { 2880 cachedSetTimeout = defaultSetTimout; 2881 } 2882 try { 2883 if (typeof clearTimeout === 'function') { 2884 cachedClearTimeout = clearTimeout; 2885 } else { 2886 cachedClearTimeout = defaultClearTimeout; 2887 } 2888 } catch (e) { 2889 cachedClearTimeout = defaultClearTimeout; 2890 } 2891} ()) 2892function runTimeout(fun) { 2893 if (cachedSetTimeout === setTimeout) { 2894 //normal enviroments in sane situations 2895 return setTimeout(fun, 0); 2896 } 2897 // if setTimeout wasn't available but was latter defined 2898 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 2899 cachedSetTimeout = setTimeout; 2900 return setTimeout(fun, 0); 2901 } 2902 try { 2903 // when when somebody has screwed with setTimeout but no I.E. maddness 2904 return cachedSetTimeout(fun, 0); 2905 } catch(e){ 2906 try { 2907 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 2908 return cachedSetTimeout.call(null, fun, 0); 2909 } catch(e){ 2910 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 2911 return cachedSetTimeout.call(this, fun, 0); 2912 } 2913 } 2914 2915 2916} 2917function runClearTimeout(marker) { 2918 if (cachedClearTimeout === clearTimeout) { 2919 //normal enviroments in sane situations 2920 return clearTimeout(marker); 2921 } 2922 // if clearTimeout wasn't available but was latter defined 2923 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 2924 cachedClearTimeout = clearTimeout; 2925 return clearTimeout(marker); 2926 } 2927 try { 2928 // when when somebody has screwed with setTimeout but no I.E. maddness 2929 return cachedClearTimeout(marker); 2930 } catch (e){ 2931 try { 2932 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 2933 return cachedClearTimeout.call(null, marker); 2934 } catch (e){ 2935 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 2936 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 2937 return cachedClearTimeout.call(this, marker); 2938 } 2939 } 2940 2941 2942 2943} 2944var queue = []; 2945var draining = false; 2946var currentQueue; 2947var queueIndex = -1; 2948 2949function cleanUpNextTick() { 2950 if (!draining || !currentQueue) { 2951 return; 2952 } 2953 draining = false;
2954 if (currentQueue.length) { 2955 queue = currentQueue.concat(queue); 2956 } else { 2957 queueIndex = -1; 2958 } 2959 if (queue.length) { 2960 drainQueue(); 2961 } 2962} 2963 2964function drainQueue() { 2965 if (draining) { 2966 return; 2967 } 2968 var timeout = runTimeout(cleanUpNextTick); 2969 draining = true; 2970 2971 var len = queue.length; 2972 while(len) { 2973 currentQueue = queue; 2974 queue = []; 2975 while (++queueIndex < len) { 2976 if (currentQueue) { 2977 currentQueue[queueIndex].run(); 2978 } 2979 } 2980 queueIndex = -1; 2981 len = queue.length; 2982 } 2983 currentQueue = null; 2984 draining = false; 2985 runClearTimeout(timeout); 2986} 2987 2988process.nextTick = function (fun) { 2989 var args = new Array(arguments.length - 1); 2990 if (arguments.length > 1) { 2991 for (var i = 1; i < arguments.length; i++) { 2992 args[i - 1] = arguments[i]; 2993 } 2994 } 2995 queue.push(new Item(fun, args)); 2996 if (queue.length === 1 && !draining) { 2997 runTimeout(drainQueue); 2998 } 2999}; 3000 3001// v8 likes predictible objects 3002function Item(fun, array) { 3003 this.fun = fun; 3004 this.array = array; 3005} 3006Item.prototype.run = function () { 3007 this.fun.apply(null, this.array); 3008}; 3009process.title = 'browser'; 3010process.browser = true; 3011process.env = {}; 3012process.argv = []; 3013process.version = ''; // empty string to avoid regexp issues 3014process.versions = {}; 3015 3016function noop() {} 3017 3018process.on = noop; 3019process.addListener = noop; 3020process.once = noop; 3021process.off = noop; 3022process.removeListener = noop; 3023process.removeAllListeners = noop; 3024process.emit = noop; 3025process.prependListener = noop; 3026process.prependOnceListener = noop; 3027 3028process.listeners = function (name) { return [] } 3029 3030process.binding = function (name) { 3031 throw new Error('process.binding is not supported'); 3032}; 3033 3034process.cwd = function () { return '/' }; 3035process.chdir = function (dir) { 3036 throw new Error('process.chdir is not supported'); 3037}; 3038process.umask = function() { return 0; }; 3039 3040 3041/***/ }), 3042 3043/***/ 171: 3044/***/ (function(module, exports, __webpack_require__) { 3045 3046module.exports = __webpack_require__(172); 3047 3048 3049/***/ }), 3050 3051/***/ 172: 3052/***/ (function(module, __webpack_exports__, __webpack_require__) { 3053 3054"use strict"; 3055Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3056/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__vimeo_player__ = __webpack_require__(14); 3057 3058 3059// let player = ''; 3060// let options = ''; 3061// let iframe = ''; 3062 3063$('.vimeo-hover').each(function() { 3064 var iframe = $(this).find('iframe'); 3065 var options = { 3066 muted: true, 3067 loop: true, 3068 autoplay: true, 3069 }; 3070 3071 var player = new __WEBPACK_IMPORTED_MODULE_0__vimeo_player__["a" /* default */](iframe, options); 3072 3073 player.pause().then(function() { 3074 // the video was paused 3075 3076 iframe.mouseover(function() { 3077 player.play().then(function() { 3078 // the video was played 3079 }).catch(function(error) { 3080 switch (error.name) { 3081 case 'PasswordError': 3082 // the video is password-protected and the viewer needs to enter the 3083 // password first 3084 break; 3085 3086 case 'PrivacyError': 3087 // the video is private 3088 break; 3089 3090 default: 3091 // some other error occurred 3092 break; 3093 } 3094 }); 3095 }).mouseout(function() { 3096 player.unload().then(function() { 3097 // the video was unloaded 3098 }).catch(function(error) { 3099 console.log(error); 3100 // an error occurred 3101 }); 3102 }); 3103 3104 }).catch(function(error) { 3105 switch (error.name) { 3106 case 'PasswordError': 3107 // the video is password-protected and the viewer needs to enter the 3108 // password first 3109 break; 3110 3111 case 'PrivacyError': 3112 // the video is private 3113 break; 3114 3115 default: 3116 // some other error occurred 3117 break; 3118 } 3119 }); 3120}); 3121 3122// $('.vimeo-hover').hover(function() { 3123// iframe = $(this).find('iframe'); 3124// options = { 3125// loop: true, 3126// }; 3127// player = new Vimeo(iframe, options); 3128// player.play().then(function() { 3129// // the video was played 3130// }).catch(function(error) { 3131// switch (error.name) { 3132// case 'PasswordError': 3133// // the video is password-protected and the viewer needs to enter the 3134// // password first 3135// break; 3136 3137// case 'PrivacyError': 3138// // the video is private 3139// break; 3140 3141// default: 3142// // some other error occurred 3143// break; 3144// } 3145// }); 3146// }, function() { 3147// player.unload().then(function() { 3148// // the video was unloaded 3149// }).catch(function(error) { 3150// console.log(error); 3151// // an error occurred 3152// }); 3153// }); 3154 3155/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3))) 3156 3157/***/ }), 3158 3159/***/ 3:
3160/***/ (function(module, exports) { 3161 3162module.exports = jQuery; 3163 3164/***/ }), 3165 3166/***/ 9: 3167/***/ (function(module, exports) { 3168 3169var g; 3170 3171// This works in non-strict mode 3172g = (function() { 3173 return this; 3174})(); 3175 3176try { 3177 // This works if eval is allowed (see CSP) 3178 g = g || Function("return this")() || (1,eval)("this"); 3179} catch(e) { 3180 // This works if the window reference is available 3181 if(typeof window === "object") 3182 g = window; 3183} 3184 3185// g can still be undefined, but nothing to do about it... 3186// We return undefined, instead of nothing here, so it's 3187// easier to handle this case. if(!global) { ...} 3188 3189module.exports = g; 3190 3191 3192/***/ }) 3193 3194/******/ }); 3195//# sourceMappingURL=video-hover.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.