@wistia/wistia-player 0.0.82 → 0.0.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import { JSX, Ref } from 'preact';
2
2
  export declare const BASE_BUTTON_WIDTH = 125;
3
3
  export declare const BASE_BUTTON_HEIGHT = 80;
4
4
  interface BigPlayButtonProps {
5
+ backgroundGradientCss?: string;
5
6
  baseHeight?: number;
6
7
  baseWidth?: number;
7
8
  borderRadius: number;
@@ -23,8 +24,10 @@ interface BigPlayButtonProps {
23
24
  scale: number;
24
25
  showBpbTime: boolean;
25
26
  topNudgeFraction?: number;
27
+ videoHeight: number;
26
28
  videoName: string;
29
+ videoWidth: number;
27
30
  }
28
- export declare const BigPlayButton: ({ baseHeight, baseWidth, borderRadius, buttonTabIndex, color, controlBarDistance, duration, elemRef, hasNewRoundedIcons, isLiveMedia, isLoading, isVisible, leftNudgeFraction, noMixBlendMode, onClick, playerLanguage, scale, showBpbTime, topNudgeFraction, videoName, }: BigPlayButtonProps) => JSX.Element;
31
+ export declare const BigPlayButton: ({ backgroundGradientCss, baseHeight, baseWidth, borderRadius, buttonTabIndex, color, controlBarDistance, duration, elemRef, hasNewRoundedIcons, isLiveMedia, isLoading, isVisible, leftNudgeFraction, noMixBlendMode, onClick, playerLanguage, scale, showBpbTime, topNudgeFraction, videoName, videoWidth, videoHeight, }: BigPlayButtonProps) => JSX.Element;
29
32
  export {};
30
33
  //# sourceMappingURL=BigPlayButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BigPlayButton.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/embeds/media/players/vulcanV2Player/shared/ui_components/BigPlayButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAK,GAAG,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAarC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAQrC,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,+QAqBvB,kBAAkB,KAAG,GAAG,CAAC,OAyH3B,CAAC"}
1
+ {"version":3,"file":"BigPlayButton.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/embeds/media/players/vulcanV2Player/shared/ui_components/BigPlayButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAK,GAAG,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAarC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAQrC,UAAU,kBAAkB;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,+TAwBvB,kBAAkB,KAAG,GAAG,CAAC,OAwI3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PreloadThumbnail.d.ts","sourceRoot":"","sources":["../../../../../../../src/embeds/wistiaPlayer/components/PreloadThumbnail.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAmB5E,UAAU,qBAAqB;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,yDAK1B,qBAAqB,KAAG,GAAG,CAAC,OA6H9B,CAAC"}
1
+ {"version":3,"file":"PreloadThumbnail.d.ts","sourceRoot":"","sources":["../../../../../../../src/embeds/wistiaPlayer/components/PreloadThumbnail.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAmB5E,UAAU,qBAAqB;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,yDAK1B,qBAAqB,KAAG,GAAG,CAAC,OA+H9B,CAAC"}
@@ -95,6 +95,11 @@ __webpack_unused_export__ = hasKey;
95
95
  /* harmony import */ var _utilities_detect_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7231);
96
96
  /* harmony import */ var _utilities_duration_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1341);
97
97
  /* harmony import */ var _utilities_interFontFamily_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8213);
98
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
99
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
100
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
101
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
102
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
98
103
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
99
104
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
100
105
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -119,7 +124,8 @@ var BASE_LINE_HEIGHT = 30;
119
124
  var ALPHA_MIX_BLEND_MODE = 0.7;
120
125
  var ALPHA_NO_MIX_BLEND_MODE = 0.85;
121
126
  var BigPlayButton = function BigPlayButton(_ref) {
122
- var _ref$baseHeight = _ref.baseHeight,
127
+ var backgroundGradientCss = _ref.backgroundGradientCss,
128
+ _ref$baseHeight = _ref.baseHeight,
123
129
  baseHeight = _ref$baseHeight === void 0 ? BASE_BUTTON_HEIGHT : _ref$baseHeight,
124
130
  _ref$baseWidth = _ref.baseWidth,
125
131
  baseWidth = _ref$baseWidth === void 0 ? BASE_BUTTON_WIDTH : _ref$baseWidth,
@@ -146,7 +152,9 @@ var BigPlayButton = function BigPlayButton(_ref) {
146
152
  showBpbTime = _ref.showBpbTime,
147
153
  _ref$topNudgeFraction = _ref.topNudgeFraction,
148
154
  topNudgeFraction = _ref$topNudgeFraction === void 0 ? 0 : _ref$topNudgeFraction,
149
- videoName = _ref.videoName;
155
+ videoName = _ref.videoName,
156
+ videoWidth = _ref.videoWidth,
157
+ videoHeight = _ref.videoHeight;
150
158
  var _useState = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__/* .useState */ .J0)(false),
151
159
  _useState2 = _slicedToArray(_useState, 2),
152
160
  isFocused = _useState2[0],
@@ -195,15 +203,27 @@ var BigPlayButton = function BigPlayButton(_ref) {
195
203
  if (isFocused) {
196
204
  overlayColor.lighten('15%');
197
205
  }
198
- var overlayStyle = {
199
- backgroundColor: overlayColor.toRgba(),
206
+ var gradientStyles = function gradientStyles() {
207
+ var shouldUseGradient = backgroundGradientCss != null;
208
+ if (!shouldUseGradient) {
209
+ return {};
210
+ }
211
+ return {
212
+ background: backgroundGradientCss,
213
+ backgroundSize: "".concat(videoWidth, "px ").concat(videoHeight, "px"),
214
+ backgroundPositionX: 'center'
215
+ };
216
+ };
217
+ var overlayStyle = _objectSpread(_objectSpread({
218
+ backgroundColor: overlayColor.toRgba()
219
+ }, gradientStyles()), {}, {
200
220
  height: "".concat(scaledHeight, "px"),
201
221
  left: 0,
202
222
  position: 'absolute',
203
223
  top: 0,
204
224
  transition: 'background-color 150ms',
205
225
  width: "".concat(scaledWidth, "px")
206
- };
226
+ });
207
227
  var shouldDisplayDuration = showBpbTime && !isLiveMedia;
208
228
  var timeStyle = {
209
229
  background: 'rgba(0,0,0,.4)',
@@ -938,7 +958,9 @@ var PreloadThumbnail = function PreloadThumbnail(_ref) {
938
958
  playerLanguage: calculatedPlayerLanguage,
939
959
  scale: scale,
940
960
  showBpbTime: shouldShowBpbTime,
941
- videoName: name !== null && name !== void 0 ? name : ''
961
+ videoName: name !== null && name !== void 0 ? name : '',
962
+ videoWidth: playerWidth,
963
+ videoHeight: height
942
964
  }));
943
965
  };
944
966
 
@@ -9986,7 +10008,7 @@ var PROD_EMBED_HOST = 'embed.wistia.com';
9986
10008
  var PROD_SSL_EMBED_HOST = 'embed-ssl.wistia.com';
9987
10009
  var PROD_FASTLY_SSL_HOST = 'embed-fastly.wistia.com';
9988
10010
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
9989
- var TAGGED_VERSION = "0.0.82" || 0;
10011
+ var TAGGED_VERSION = "0.0.83" || 0;
9990
10012
  var DEFAULT_PROTOCOL = function () {
9991
10013
  if (typeof window !== 'undefined' && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z.location) {
9992
10014
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z.location.protocol;
@@ -13167,8 +13189,8 @@ var parseUrl = Url.parse;
13167
13189
 
13168
13190
  // This is an adaptation on top of bindify that is intended to provide both
13169
13191
  // legacy functionality (returning `this` instead of an "unbind" function) and
13170
- // and "specialBind" functionality, which is what we use for special
13171
- // "composite" bindings like "crosstime" and "betweentimes".
13192
+ // and functionality for "crosstime" and "betweentimes", which are
13193
+ // "composite" bindings that do not have normal event signatures, as they take additional arguments.
13172
13194
  //
13173
13195
  // If you're setting up on/off/trigger for any new things, you should use
13174
13196
  // bindify directly instead.
@@ -13176,10 +13198,12 @@ var parseUrl = Url.parse;
13176
13198
  if (!_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__/* .Wistia */ .s.bindable) {
13177
13199
  _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__/* .Wistia */ .s.bindable = {
13178
13200
  bind: function bind(event, callback) {
13179
- if (this.specialBind && this.specialBind.apply(this, arguments) === true) {
13180
- // Allow the object to define a `specialBind` method which, if it
13181
- // should perform an operation different from the standard `bind`, it
13182
- // does that and returns true.
13201
+ if (event === 'crosstime' && this.crossTime) {
13202
+ this.crossTime.addBinding(arguments[1], arguments[2]);
13203
+ return this;
13204
+ }
13205
+ if (event === 'betweentimes' && this.betweenTimes) {
13206
+ this.betweenTimes.addBinding(arguments[1], arguments[2], arguments[3]);
13183
13207
  return this;
13184
13208
  }
13185
13209
  if (callback) {
@@ -13192,10 +13216,20 @@ if (!_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__/* .Wistia */ .s.bindable)
13192
13216
  },
13193
13217
  // unbind the matching callback and event for this video
13194
13218
  unbind: function unbind(event, callback) {
13195
- if (this.specialUnbind && this.specialUnbind.apply(this, arguments) === true) {
13196
- // Allow the object to define a `specialUnbind` method which, if it
13197
- // should perform an operation different from the standard `bind`, it
13198
- // does that and returns true.
13219
+ if (event === 'crosstime' && this.crossTime) {
13220
+ if (!callback) {
13221
+ this.crossTime.removeAllBindings();
13222
+ } else {
13223
+ this.crossTime.removeBinding(arguments[1], arguments[2]);
13224
+ }
13225
+ return this;
13226
+ }
13227
+ if (event === 'betweentimes' && this.betweenTimes) {
13228
+ if (!callback) {
13229
+ this.betweenTimes.removeAllBindings();
13230
+ } else {
13231
+ this.betweenTimes.removeBinding(arguments[1], arguments[2], arguments[3]);
13232
+ }
13199
13233
  return this;
13200
13234
  }
13201
13235
  if (callback) {
@@ -13213,22 +13247,24 @@ if (!_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__/* .Wistia */ .s.bindable)
13213
13247
  return this;
13214
13248
  },
13215
13249
  on: function on(event, fn) {
13216
- var specialBindResult = this.specialBind && this.specialBind.apply(this, arguments);
13217
- if (typeof specialBindResult === 'function') {
13218
- // Allow the object to define a `specialBind` method which, if it
13219
- // should perform an operation different from the standard `bind`, it
13220
- // does that and returns an unbind function.
13221
- return specialBindResult;
13250
+ if (event === 'crosstime' && this.crossTime) {
13251
+ this.crossTime.addBinding(arguments[1], arguments[2]);
13252
+ return this;
13253
+ }
13254
+ if (event === 'betweentimes' && this.betweenTimes) {
13255
+ this.betweenTimes.addBinding(arguments[1], arguments[2], arguments[3]);
13256
+ return this;
13222
13257
  }
13223
13258
  return utilities_bindify_js__WEBPACK_IMPORTED_MODULE_0__/* .bind */ .oI.call(this, event, fn);
13224
13259
  },
13225
13260
  off: function off(event, fn) {
13226
- var specialUnbindResult = this.specialUnbind && this.specialUnbind.apply(this, arguments);
13227
- if (typeof specialUnbindResult === 'function') {
13228
- // Allow the object to define a `specialUnbind` method which, if it
13229
- // should perform an operation different from the standard `Unbind`, it
13230
- // does that and returns an unUnbind function.
13231
- return specialUnbindResult;
13261
+ if (event === 'crosstime' && this.crossTime) {
13262
+ this.crossTime.removeBinding(arguments[1], arguments[2]);
13263
+ return this;
13264
+ }
13265
+ if (event === 'betweentimes' && this.betweenTimes) {
13266
+ this.betweenTimes.removeBinding(arguments[1], arguments[2], arguments[3]);
13267
+ return this;
13232
13268
  }
13233
13269
  return utilities_bindify_js__WEBPACK_IMPORTED_MODULE_0__/* .unbind */ .Nw.call(this, event, fn);
13234
13270
  },