@wistia/wistia-player 0.7.23 → 0.7.25
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.
- package/CHANGELOG.md +17 -0
- package/dist/types/embeds/media/modules/publicApiHelpers/languageHelpers.d.ts +44 -0
- package/dist/types/embeds/media/modules/publicApiHelpers/languageHelpers.d.ts.map +1 -0
- package/dist/types/embeds/wistiaPlayer/WistiaPlayer.d.ts.map +1 -1
- package/dist/types/embeds/wistiaPlayer/utilities/PlayerDataHandler.d.ts +7 -0
- package/dist/types/embeds/wistiaPlayer/utilities/PlayerDataHandler.d.ts.map +1 -1
- package/dist/types/types/player-api-types.d.ts +6 -1
- package/dist/types/types/player-api-types.d.ts.map +1 -1
- package/dist/types/utilities/roundedPlayerDefaults.d.ts +6 -0
- package/dist/types/utilities/roundedPlayerDefaults.d.ts.map +1 -1
- package/dist/wistia-player.js +384 -102
- package/dist/wistia-player.js.map +1 -1
- package/package.json +1 -1
package/dist/wistia-player.js
CHANGED
|
@@ -192,7 +192,7 @@ const hasPerformanceMeasureSupport = () => {
|
|
|
192
192
|
/* harmony export */ $F: () => (/* binding */ choosePlayer),
|
|
193
193
|
/* harmony export */ gC: () => (/* binding */ buildContext)
|
|
194
194
|
/* harmony export */ });
|
|
195
|
-
/* unused harmony exports HLS_ENGINE_PATH, NATIVE_HLS_ENGINE_PATH, SIMPLE_AUDIO_ENGINE_PATH, MANUAL_QUALITY_ENGINE_PATH, SPHERICAL_VIDEO_ENGINE_PATH, PLUGIN_CONFIGS, bestPlayer, bestUsableEngine, bestUsableEngineClass, canPlayInline, canUsePlayer, determinePlayerPreferenceFromInput, doesBrowserSupportHlsTools, enginesToLoad, getDefaultContext, hasAssetsForPlayer, hasEnoughReadyMp4Assets, hasSupportedHlsAssets, isBrowserInNativeAndroid, isBrowserOldChrome, isHlsEnabled, isMobile, isNotPlayable, isPasswordProtected, isSupportedPlayer, isValidPlayer, logWarnings, playerPlugins, report, shouldServeHls, supportedPlayers, usablePlayers, urlHasBeenTamperedWith, xhrHasBeenTamperedWith */
|
|
195
|
+
/* unused harmony exports HLS_ENGINE_PATH, NATIVE_HLS_ENGINE_PATH, SIMPLE_AUDIO_ENGINE_PATH, MANUAL_QUALITY_ENGINE_PATH, SPHERICAL_VIDEO_ENGINE_PATH, ALPHA_VIDEO_ENGINE_PATH, PLUGIN_CONFIGS, bestPlayer, bestUsableEngine, bestUsableEngineClass, canPlayInline, canUsePlayer, determinePlayerPreferenceFromInput, doesBrowserSupportHlsTools, enginesToLoad, getDefaultContext, hasAssetsForPlayer, hasEnoughReadyMp4Assets, hasSupportedHlsAssets, isBrowserInNativeAndroid, isBrowserOldChrome, isHlsEnabled, isMobile, isNotPlayable, isPasswordProtected, isSupportedPlayer, isValidPlayer, logWarnings, playerPlugins, report, shouldServeHls, supportedPlayers, usablePlayers, urlHasBeenTamperedWith, xhrHasBeenTamperedWith */
|
|
196
196
|
/* harmony import */ var utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(731);
|
|
197
197
|
/* harmony import */ var utilities_detect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7231);
|
|
198
198
|
/* harmony import */ var utilities_metrics_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(655);
|
|
@@ -201,6 +201,8 @@ const hasPerformanceMeasureSupport = () => {
|
|
|
201
201
|
/* harmony import */ var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6637);
|
|
202
202
|
/* harmony import */ var _assets_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7209);
|
|
203
203
|
/* harmony import */ var _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5509);
|
|
204
|
+
/* harmony import */ var _stackedAlphaAssets_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9563);
|
|
205
|
+
|
|
204
206
|
|
|
205
207
|
|
|
206
208
|
|
|
@@ -210,6 +212,7 @@ const hasPerformanceMeasureSupport = () => {
|
|
|
210
212
|
|
|
211
213
|
|
|
212
214
|
const wlog = utilities_wlog_js__WEBPACK_IMPORTED_MODULE_5__/* .wlog */ .ct.getPrefixedFunctions('judy');
|
|
215
|
+
const ALPHA_VIDEO = 'alphaVideo';
|
|
213
216
|
const AUTO = 'auto';
|
|
214
217
|
const CAROUSEL_HARD_WALL = 'carouselHardWall';
|
|
215
218
|
const EXTERNAL = 'external';
|
|
@@ -228,6 +231,7 @@ const NATIVE_HLS_ENGINE_PATH = 'engines/native_hls_video.js';
|
|
|
228
231
|
const SIMPLE_AUDIO_ENGINE_PATH = 'engines/simple_audio.js';
|
|
229
232
|
const MANUAL_QUALITY_ENGINE_PATH = 'engines/manual_quality_video.js';
|
|
230
233
|
const SPHERICAL_VIDEO_ENGINE_PATH = 'engines/spherical_video.js';
|
|
234
|
+
const ALPHA_VIDEO_ENGINE_PATH = 'engines/alpha_video.js';
|
|
231
235
|
const PLUGIN_CONFIGS = {
|
|
232
236
|
notPlayableVideo: {
|
|
233
237
|
on: true,
|
|
@@ -340,6 +344,12 @@ const bestUsableEngine = (context, mediaData, options = {}) => {
|
|
|
340
344
|
return NATIVE_HLS_ENGINE_PATH;
|
|
341
345
|
}
|
|
342
346
|
if (allowHls) {
|
|
347
|
+
// A transparent rendition is composited over hls.js playback, so it needs everything
|
|
348
|
+
// hls.js needs plus WebGL. Without WebGL the opaque renditions play as usual.
|
|
349
|
+
if (readyStackedAlphaAssets(mediaData.assets).length > 0 && detect.webgl) {
|
|
350
|
+
logger.info(ALPHA_VIDEO);
|
|
351
|
+
return ALPHA_VIDEO_ENGINE_PATH;
|
|
352
|
+
}
|
|
343
353
|
logger.info(HLS_VIDEO);
|
|
344
354
|
return HLS_ENGINE_PATH;
|
|
345
355
|
}
|
|
@@ -1027,6 +1037,7 @@ const sample = (key, val, extraData) => {
|
|
|
1027
1037
|
/* harmony export */ G0: () => (/* binding */ unsetDeep),
|
|
1028
1038
|
/* harmony export */ Im: () => (/* binding */ isEmpty),
|
|
1029
1039
|
/* harmony export */ Lt: () => (/* binding */ select),
|
|
1040
|
+
/* harmony export */ Up: () => (/* binding */ pick),
|
|
1030
1041
|
/* harmony export */ b$: () => (/* binding */ getDeep),
|
|
1031
1042
|
/* harmony export */ cy: () => (/* binding */ isArray),
|
|
1032
1043
|
/* harmony export */ di: () => (/* binding */ sort),
|
|
@@ -1040,7 +1051,7 @@ const sample = (key, val, extraData) => {
|
|
|
1040
1051
|
/* harmony export */ vd: () => (/* binding */ setDeep),
|
|
1041
1052
|
/* harmony export */ wg: () => (/* binding */ cast)
|
|
1042
1053
|
/* harmony export */ });
|
|
1043
|
-
/* unused harmony exports mergeOne, identityFunc, legacyShouldDeleteFromMerge, exists, castDeep, filter, values, isObject, isFunction, isRegExp, isBasicType, isSubsetDeep, equalsDeep, eachDeep,
|
|
1054
|
+
/* unused harmony exports mergeOne, identityFunc, legacyShouldDeleteFromMerge, exists, castDeep, filter, values, isObject, isFunction, isRegExp, isBasicType, isSubsetDeep, equalsDeep, eachDeep, keys */
|
|
1044
1055
|
/* harmony import */ var utilities_assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9025);
|
|
1045
1056
|
var _objectHasOwn = function (object, property) {
|
|
1046
1057
|
if (typeof object === 'undefined' || object === null) {
|
|
@@ -3766,9 +3777,10 @@ const fetchMediaData = async (hashedId, options = {}) => {
|
|
|
3766
3777
|
/* harmony export */ Ru: () => (/* binding */ getDefaultControlBarDistance),
|
|
3767
3778
|
/* harmony export */ gl: () => (/* binding */ getDefaultBigPlayButtonBorderRadius)
|
|
3768
3779
|
/* harmony export */ });
|
|
3769
|
-
/* unused harmony exports CONTROL_BAR_DISTANCE_RATIO, getDefaultControlBarBorderRadius */
|
|
3780
|
+
/* unused harmony exports CONTROL_BAR_DISTANCE_RATIO, getDefaultControlBarBorderRadius, getDefaultCaptionsBorderRadius */
|
|
3770
3781
|
const BIG_PLAY_BUTTON_RADIUS_RATIO = 0.75;
|
|
3771
3782
|
const CONTROL_BAR_DISTANCE_RATIO = 0.75;
|
|
3783
|
+
const CAPTIONS_RADIUS_RATIO = 0.5;
|
|
3772
3784
|
const FLOATING_CONTROL_BAR_RADIUS = 18;
|
|
3773
3785
|
const FLOATING_CONTROL_BAR_DISTANCE = 6;
|
|
3774
3786
|
|
|
@@ -3845,6 +3857,24 @@ const getDefaultControlBarBorderRadius = ({
|
|
|
3845
3857
|
return 0;
|
|
3846
3858
|
};
|
|
3847
3859
|
|
|
3860
|
+
/**
|
|
3861
|
+
* Takes rounded player embed options and returns the calculated captions border radius.
|
|
3862
|
+
* @param {EmbedOptions} embedOptions
|
|
3863
|
+
* @returns {number}
|
|
3864
|
+
*/
|
|
3865
|
+
const getDefaultCaptionsBorderRadius = ({
|
|
3866
|
+
captionsBorderRadius,
|
|
3867
|
+
roundedPlayer
|
|
3868
|
+
}) => {
|
|
3869
|
+
if (captionsBorderRadius !== undefined) {
|
|
3870
|
+
return captionsBorderRadius;
|
|
3871
|
+
}
|
|
3872
|
+
if (roundedPlayer !== undefined) {
|
|
3873
|
+
return roundedPlayer * CAPTIONS_RADIUS_RATIO;
|
|
3874
|
+
}
|
|
3875
|
+
return 0;
|
|
3876
|
+
};
|
|
3877
|
+
|
|
3848
3878
|
/**
|
|
3849
3879
|
* Takes rounded player embed options and returns the calculated control bar distance.
|
|
3850
3880
|
* @param {EmbedOptions} embedOptions
|
|
@@ -4668,6 +4698,114 @@ const wRemoveData = key => {
|
|
|
4668
4698
|
|
|
4669
4699
|
/***/ },
|
|
4670
4700
|
|
|
4701
|
+
/***/ 4138
|
|
4702
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
4703
|
+
|
|
4704
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4705
|
+
/* harmony export */ RJ: () => (/* binding */ getCaptionsLanguages),
|
|
4706
|
+
/* harmony export */ kG: () => (/* binding */ getLanguages),
|
|
4707
|
+
/* harmony export */ my: () => (/* binding */ getMediaLanguages),
|
|
4708
|
+
/* harmony export */ rK: () => (/* binding */ languageToLocalization)
|
|
4709
|
+
/* harmony export */ });
|
|
4710
|
+
/* unused harmony export limitedLanguageProperties */
|
|
4711
|
+
/* harmony import */ var _utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(731);
|
|
4712
|
+
// Behavior-preserving extraction of the language helpers from
|
|
4713
|
+
// _public_api.coffee. Everything here is derived from mediaData alone, so
|
|
4714
|
+
// both PublicApi and <wistia-player> can use it directly.
|
|
4715
|
+
|
|
4716
|
+
|
|
4717
|
+
const LIMITED_LANGUAGE_PROPERTIES = ['bcp47LanguageTag', 'familyName', 'hasCaptions', 'hasVideoStream', 'isOriginal', 'name', 'familyNativeName', 'nativeName', 'wistiaLanguageCode'];
|
|
4718
|
+
// What media languages fall back to when the media has no localizations.
|
|
4719
|
+
const DEFAULT_LANGUAGE = {
|
|
4720
|
+
bcp47LanguageTag: 'en',
|
|
4721
|
+
familyName: 'English',
|
|
4722
|
+
familyNativeName: 'English',
|
|
4723
|
+
name: 'English',
|
|
4724
|
+
nativeName: 'English',
|
|
4725
|
+
wistiaLanguageCode: 'eng'
|
|
4726
|
+
};
|
|
4727
|
+
|
|
4728
|
+
/**
|
|
4729
|
+
* Returns a copy of the language with only the properties we expose publicly.
|
|
4730
|
+
* Properties that are undefined on the language are omitted.
|
|
4731
|
+
*
|
|
4732
|
+
* @param language - A language, localization, or transcript language object
|
|
4733
|
+
*/
|
|
4734
|
+
const limitedLanguageProperties = language => (0,_utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__/* .pick */ .Up)(language, LIMITED_LANGUAGE_PROPERTIES);
|
|
4735
|
+
|
|
4736
|
+
// The language lists are cached per mediaData object so that repeated reads
|
|
4737
|
+
// return the same frozen array until the media data is replaced.
|
|
4738
|
+
const memoizeByMediaData = buildLanguages => {
|
|
4739
|
+
const cache = new WeakMap();
|
|
4740
|
+
return mediaData => {
|
|
4741
|
+
const cachedLanguages = cache.get(mediaData);
|
|
4742
|
+
if (cachedLanguages) {
|
|
4743
|
+
return cachedLanguages;
|
|
4744
|
+
}
|
|
4745
|
+
const languages = buildLanguages(mediaData);
|
|
4746
|
+
Object.freeze(languages);
|
|
4747
|
+
cache.set(mediaData, languages);
|
|
4748
|
+
return languages;
|
|
4749
|
+
};
|
|
4750
|
+
};
|
|
4751
|
+
|
|
4752
|
+
/**
|
|
4753
|
+
* Returns the languages the media itself is available in, one per
|
|
4754
|
+
* localization. Falls back to English when the media has no localizations.
|
|
4755
|
+
*
|
|
4756
|
+
* @param mediaData - The media data to read localizations from
|
|
4757
|
+
*/
|
|
4758
|
+
const getMediaLanguages = memoizeByMediaData(mediaData => {
|
|
4759
|
+
const localizations = mediaData.localizations ?? [];
|
|
4760
|
+
if (localizations.length === 0) {
|
|
4761
|
+
return [{
|
|
4762
|
+
...DEFAULT_LANGUAGE
|
|
4763
|
+
}];
|
|
4764
|
+
}
|
|
4765
|
+
return localizations.map(localization => limitedLanguageProperties(localization));
|
|
4766
|
+
});
|
|
4767
|
+
|
|
4768
|
+
/**
|
|
4769
|
+
* Returns the languages the media has captions in.
|
|
4770
|
+
*
|
|
4771
|
+
* @param mediaData - The media data to read available transcripts from
|
|
4772
|
+
*/
|
|
4773
|
+
const getCaptionsLanguages = memoizeByMediaData(mediaData => (mediaData.availableTranscripts ?? []).map(transcript => limitedLanguageProperties(transcript)));
|
|
4774
|
+
|
|
4775
|
+
/**
|
|
4776
|
+
* Returns every language the media is available in, whether as media or as
|
|
4777
|
+
* captions, without duplicates.
|
|
4778
|
+
*
|
|
4779
|
+
* It's meaningful that media languages come first; we prefer to report that
|
|
4780
|
+
* we have those over captions languages because we typically also have
|
|
4781
|
+
* captions for localizations.
|
|
4782
|
+
*
|
|
4783
|
+
* @param mediaData - The media data to read languages from
|
|
4784
|
+
*/
|
|
4785
|
+
const getLanguages = mediaData => {
|
|
4786
|
+
const uniqueLanguages = [];
|
|
4787
|
+
[...getMediaLanguages(mediaData), ...getCaptionsLanguages(mediaData)].forEach(language => {
|
|
4788
|
+
const isKnown = uniqueLanguages.some(uniqueLanguage => uniqueLanguage.wistiaLanguageCode === language.wistiaLanguageCode);
|
|
4789
|
+
if (!isKnown) {
|
|
4790
|
+
uniqueLanguages.push({
|
|
4791
|
+
...language
|
|
4792
|
+
});
|
|
4793
|
+
}
|
|
4794
|
+
});
|
|
4795
|
+
Object.freeze(uniqueLanguages);
|
|
4796
|
+
return uniqueLanguages;
|
|
4797
|
+
};
|
|
4798
|
+
|
|
4799
|
+
/**
|
|
4800
|
+
* Returns the media's localization for the given language, if it has one.
|
|
4801
|
+
*
|
|
4802
|
+
* @param mediaData - The media data to read localizations from
|
|
4803
|
+
* @param language - The language to find the localization for
|
|
4804
|
+
*/
|
|
4805
|
+
const languageToLocalization = (mediaData, language) => (mediaData.localizations ?? []).find(localization => localization.wistiaLanguageCode === language.wistiaLanguageCode);
|
|
4806
|
+
|
|
4807
|
+
/***/ },
|
|
4808
|
+
|
|
4671
4809
|
/***/ 4271
|
|
4672
4810
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
4673
4811
|
|
|
@@ -6838,8 +6976,8 @@ const PROD_EMBED_HOST = 'embed.wistia.com';
|
|
|
6838
6976
|
const PROD_SSL_EMBED_HOST = 'embed-ssl.wistia.com';
|
|
6839
6977
|
const PROD_FASTLY_SSL_HOST = 'embed-fastly.wistia.com';
|
|
6840
6978
|
const SSL_EMBED_HOST = "embed-ssl.wistia.com";
|
|
6841
|
-
const TAGGED_VERSION = "0.7.
|
|
6842
|
-
const CURRENT_SHA = "
|
|
6979
|
+
const TAGGED_VERSION = "0.7.25" || 0;
|
|
6980
|
+
const CURRENT_SHA = "9e29f407538a0fc839d41924796ff738d163651d" || 0;
|
|
6843
6981
|
const DEFAULT_PROTOCOL = (() => {
|
|
6844
6982
|
if (typeof window !== 'undefined' && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z.location) {
|
|
6845
6983
|
return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z.location.protocol;
|
|
@@ -7077,6 +7215,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
|
|
|
7077
7215
|
|
|
7078
7216
|
var _embedOptionOverrides = /*#__PURE__*/new WeakMap();
|
|
7079
7217
|
var _embedOptions = /*#__PURE__*/new WeakMap();
|
|
7218
|
+
var _hasMediaData = /*#__PURE__*/new WeakMap();
|
|
7080
7219
|
var _mediaData = /*#__PURE__*/new WeakMap();
|
|
7081
7220
|
var _sourceEmbedOptions = /*#__PURE__*/new WeakMap();
|
|
7082
7221
|
var _sourceMediaData = /*#__PURE__*/new WeakMap();
|
|
@@ -7094,6 +7233,8 @@ class PlayerDataHandler {
|
|
|
7094
7233
|
_classPrivateFieldInitSpec(this, _embedOptionOverrides, {});
|
|
7095
7234
|
// Merged embed options gathered from source data
|
|
7096
7235
|
_classPrivateFieldInitSpec(this, _embedOptions, {});
|
|
7236
|
+
// Whether a media data source has been set yet
|
|
7237
|
+
_classPrivateFieldInitSpec(this, _hasMediaData, false);
|
|
7097
7238
|
// Merged media data gathered from source data
|
|
7098
7239
|
_classPrivateFieldInitSpec(this, _mediaData, {});
|
|
7099
7240
|
// Source data which is used to create the final embed options
|
|
@@ -7115,6 +7256,16 @@ class PlayerDataHandler {
|
|
|
7115
7256
|
return _classPrivateFieldGet(_embedOptions, this);
|
|
7116
7257
|
}
|
|
7117
7258
|
|
|
7259
|
+
/**
|
|
7260
|
+
* Returns whether media data has been set, as opposed to still being the
|
|
7261
|
+
* empty initial value
|
|
7262
|
+
* @returns {boolean}
|
|
7263
|
+
* @readonly
|
|
7264
|
+
*/
|
|
7265
|
+
get hasMediaData() {
|
|
7266
|
+
return _classPrivateFieldGet(_hasMediaData, this);
|
|
7267
|
+
}
|
|
7268
|
+
|
|
7118
7269
|
/**
|
|
7119
7270
|
* Returns the final media data which is a merge of all the source data
|
|
7120
7271
|
* @returns {MediaData}
|
|
@@ -7153,6 +7304,7 @@ class PlayerDataHandler {
|
|
|
7153
7304
|
*/
|
|
7154
7305
|
setMediaDataSource(data) {
|
|
7155
7306
|
_classPrivateFieldSet(_sourceMediaData, this, data);
|
|
7307
|
+
_classPrivateFieldSet(_hasMediaData, this, true);
|
|
7156
7308
|
_classPrivateFieldSet(_mediaData, this, (0,_utilities_obj_js__WEBPACK_IMPORTED_MODULE_2__/* .cast */ .wg)(lodash_clonedeep__WEBPACK_IMPORTED_MODULE_1___default()(_classPrivateFieldGet(_sourceMediaData, this))));
|
|
7157
7309
|
// Sometimes the hashedId has no alpha characters, so cast() will convert it to a number.
|
|
7158
7310
|
// Our api expects hashedId to be a string, so we need to convert it back.
|
|
@@ -7924,13 +8076,15 @@ const dynamicImport = async (filePath, options = {}) => {
|
|
|
7924
8076
|
/* harmony export */ x4: () => (/* binding */ readyPublicM3u8s),
|
|
7925
8077
|
/* harmony export */ yE: () => (/* binding */ READY)
|
|
7926
8078
|
/* harmony export */ });
|
|
7927
|
-
/* unused harmony exports FAILED, QUEUED, PROCESSING, one, filterOver400, withinQualityRange, numericSizeSnapped, still, channelArtworkStill, getStillWidth, BAKERY_HOSTS, isBakeryUrl, onePublicReadyWithContainer, hasAnyReadyHdrAssets, mp4, webm, m3u8, original, playable, videoAspect, originalAspect, iphone, smallestNormalMp4, urlWithCorrectHost, nearestOutsideRange, moveToFront */
|
|
8079
|
+
/* unused harmony exports FAILED, QUEUED, PROCESSING, one, filterOver400, withinQualityRange, numericSizeSnapped, still, channelArtworkStill, getStillWidth, BAKERY_HOSTS, isBakeryUrl, assetUrlWithExtension, onePublicReadyWithContainer, hasAnyReadyHdrAssets, mp4, webm, m3u8, original, playable, videoAspect, originalAspect, iphone, smallestNormalMp4, urlWithCorrectHost, nearestOutsideRange, moveToFront */
|
|
7928
8080
|
/* harmony import */ var utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(731);
|
|
7929
8081
|
/* harmony import */ var utilities_url_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2671);
|
|
7930
8082
|
/* harmony import */ var utilities_detect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7231);
|
|
7931
8083
|
/* harmony import */ var utilities_hosts_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5857);
|
|
7932
8084
|
/* harmony import */ var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6637);
|
|
7933
8085
|
/* harmony import */ var _appHostname_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(787);
|
|
8086
|
+
/* harmony import */ var _stackedAlphaAssets_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9563);
|
|
8087
|
+
|
|
7934
8088
|
|
|
7935
8089
|
|
|
7936
8090
|
|
|
@@ -7960,6 +8114,14 @@ const filter = (assets, options = {}) => {
|
|
|
7960
8114
|
assets = assets.assets;
|
|
7961
8115
|
}
|
|
7962
8116
|
|
|
8117
|
+
// Transparent (stacked alpha) renditions only make sense to the alpha video engine, which
|
|
8118
|
+
// asks for them by name. Keep them out of every other asset query so they never show up
|
|
8119
|
+
// in quality menus, downloads, fallbacks or the public `assets()` API.
|
|
8120
|
+
if (!options.includeStackedAlpha) {
|
|
8121
|
+
assets = assets.filter(asset => !(0,_stackedAlphaAssets_ts__WEBPACK_IMPORTED_MODULE_6__/* .isStackedAlphaAsset */ .Yw)(asset));
|
|
8122
|
+
}
|
|
8123
|
+
options = (0,utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__/* .except */ .iu)(options, ['includeStackedAlpha']);
|
|
8124
|
+
|
|
7963
8125
|
// If qualityMin/qualityMax are specified, filtered the assets with those
|
|
7964
8126
|
// before doing anything else. That's because those aren't set directly on
|
|
7965
8127
|
// the assets; rather, it is a computed value for each asset.
|
|
@@ -8313,6 +8475,18 @@ const isBakeryUrl = rawUrl => {
|
|
|
8313
8475
|
}
|
|
8314
8476
|
return BAKERY_HOSTS.join(',').indexOf(url.host) >= 0;
|
|
8315
8477
|
};
|
|
8478
|
+
|
|
8479
|
+
// Asset urls in media data end in `.bin`; the same delivery is also served under other
|
|
8480
|
+
// extensions as siblings, e.g. `deliveries/<id>.m3u8` is the rendition's own HLS manifest
|
|
8481
|
+
// and `deliveries/<id>.jpg` a still. (Not to be confused with the `/file.<ext>` download
|
|
8482
|
+
// form the engines' properAssetUrl helpers build.) Urls that don't end in `.bin` are
|
|
8483
|
+
// returned untouched.
|
|
8484
|
+
const assetUrlWithExtension = (assetUrl, extension) => {
|
|
8485
|
+
if (assetUrl == null) {
|
|
8486
|
+
return assetUrl;
|
|
8487
|
+
}
|
|
8488
|
+
return assetUrl.replace(/\.bin$/, `.${extension}`);
|
|
8489
|
+
};
|
|
8316
8490
|
const onePublicReadyWithContainer = (assets, type, options) => {
|
|
8317
8491
|
options = (0,utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__/* .merge */ .h1)({
|
|
8318
8492
|
container: type,
|
|
@@ -8698,6 +8872,12 @@ const ipad = () => {
|
|
|
8698
8872
|
const safari = () => {
|
|
8699
8873
|
return rwebkit.test(na) && !/chrome/i.test(na) && !ipad() && !iphone();
|
|
8700
8874
|
};
|
|
8875
|
+
|
|
8876
|
+
// Real WebKit: Safari, or any browser on iPhone/iPad. `browser.webkit` is the UA
|
|
8877
|
+
// engine token, which Chrome also carries.
|
|
8878
|
+
const actualWebkit = () => {
|
|
8879
|
+
return Boolean(safari() || iphone() || ipad());
|
|
8880
|
+
};
|
|
8701
8881
|
const chrome = () => {
|
|
8702
8882
|
if (/Chrome/.test(na) && /Google Inc/.test(navigator.vendor)) {
|
|
8703
8883
|
return {
|
|
@@ -8854,6 +9034,23 @@ const webp = () => {
|
|
|
8854
9034
|
const isOperaSupported = operaBrowser && browserVersion() >= 19;
|
|
8855
9035
|
return isChromeDesktopSupported || isChromeAndroidSupported || isFirefoxDesktopSupported || isFirefoxAndroidSupported || isEdgeSupported || isOperaSupported;
|
|
8856
9036
|
};
|
|
9037
|
+
|
|
9038
|
+
// Whether a WebGL context can be created (transparent video is composited with one). The
|
|
9039
|
+
// probe releases its context straight away: contexts are scarce (browsers cap them at
|
|
9040
|
+
// around 16 per page), and this runs once per page like every other capability here.
|
|
9041
|
+
const webgl = () => {
|
|
9042
|
+
try {
|
|
9043
|
+
const canvas = document.createElement('canvas');
|
|
9044
|
+
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
|
9045
|
+
if (!gl) {
|
|
9046
|
+
return false;
|
|
9047
|
+
}
|
|
9048
|
+
gl.getExtension('WEBGL_lose_context')?.loseContext();
|
|
9049
|
+
return true;
|
|
9050
|
+
} catch (e) {
|
|
9051
|
+
return false;
|
|
9052
|
+
}
|
|
9053
|
+
};
|
|
8857
9054
|
const cachedDetect = () => {
|
|
8858
9055
|
if (_playerDetectCache) {
|
|
8859
9056
|
// Allow this to be cached globally so it's not executed once every time
|
|
@@ -8878,6 +9075,7 @@ const uncachedDetect = () => {
|
|
|
8878
9075
|
iphone: iphone(),
|
|
8879
9076
|
ipad: ipad(),
|
|
8880
9077
|
safari: safari(),
|
|
9078
|
+
actualWebkit: actualWebkit(),
|
|
8881
9079
|
chrome: chrome(),
|
|
8882
9080
|
winphone: {
|
|
8883
9081
|
version: windowsPhone()[2]
|
|
@@ -8901,6 +9099,7 @@ const uncachedDetect = () => {
|
|
|
8901
9099
|
callingPlayRequiresEventContext: callingPlayRequiresEventContext(),
|
|
8902
9100
|
passiveSupported: passiveSupported(),
|
|
8903
9101
|
webp: webp(),
|
|
9102
|
+
webgl: webgl(),
|
|
8904
9103
|
performanceMeasure: (0,_performance_ts__WEBPACK_IMPORTED_MODULE_1__/* .hasPerformanceMeasureSupport */ .O)()
|
|
8905
9104
|
};
|
|
8906
9105
|
result.browser[browser()] = true;
|
|
@@ -14301,6 +14500,73 @@ const pageLoaded = (fn, timeout = 4000, doc = document, win = window) => {
|
|
|
14301
14500
|
|
|
14302
14501
|
/***/ },
|
|
14303
14502
|
|
|
14503
|
+
/***/ 9563
|
|
14504
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
14505
|
+
|
|
14506
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14507
|
+
/* harmony export */ Yw: () => (/* binding */ isStackedAlphaAsset)
|
|
14508
|
+
/* harmony export */ });
|
|
14509
|
+
/* unused harmony exports STACKED_ALPHA_ASSET_TYPE, STACKED_ALPHA_ROWS, readyStackedAlphaAssets, chooseStackedAlphaAsset, stackedAlphaPictureHeight, AlphaVideoUnavailableError, isAlphaVideoUnavailableError */
|
|
14510
|
+
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; }
|
|
14511
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14512
|
+
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); }
|
|
14513
|
+
// The transparent ("stacked alpha") rendition is its own media file class on the backend
|
|
14514
|
+
// (StackedAlphaVideoFile), which reaches us as this asset type.
|
|
14515
|
+
const STACKED_ALPHA_ASSET_TYPE = 'stacked_alpha_video';
|
|
14516
|
+
|
|
14517
|
+
// A stacked frame is the colour picture with its alpha matte drawn underneath it, so the
|
|
14518
|
+
// encoded frame is twice the height of the picture the viewer sees.
|
|
14519
|
+
const STACKED_ALPHA_ROWS = 2;
|
|
14520
|
+
const MAX_PIXEL_RATIO = 2;
|
|
14521
|
+
// Mirrors READY in assets.js, which imports this module.
|
|
14522
|
+
const READY_STATUS = 2;
|
|
14523
|
+
const isStackedAlphaAsset = asset => {
|
|
14524
|
+
return asset?.type === STACKED_ALPHA_ASSET_TYPE;
|
|
14525
|
+
};
|
|
14526
|
+
const readyStackedAlphaAssets = assets => {
|
|
14527
|
+
return (assets ?? []).filter(asset => {
|
|
14528
|
+
return isStackedAlphaAsset(asset) && asset.status === READY_STATUS && asset.public && typeof asset.url === 'string';
|
|
14529
|
+
});
|
|
14530
|
+
};
|
|
14531
|
+
|
|
14532
|
+
/**
|
|
14533
|
+
* Picks the stacked-alpha rendition to play: the smallest ready one that still covers the
|
|
14534
|
+
* rendered width at the device pixel ratio (capped at 2x), or the largest when none does.
|
|
14535
|
+
*/
|
|
14536
|
+
const chooseStackedAlphaAsset = (assets, target) => {
|
|
14537
|
+
const candidates = readyStackedAlphaAssets(assets).sort((left, right) => left.width - right.width);
|
|
14538
|
+
if (candidates.length === 0) {
|
|
14539
|
+
return undefined;
|
|
14540
|
+
}
|
|
14541
|
+
const pixelRatio = Math.min(target.devicePixelRatio ?? 1, MAX_PIXEL_RATIO);
|
|
14542
|
+
const neededWidth = Math.max(1, target.width) * pixelRatio;
|
|
14543
|
+
return candidates.find(asset => asset.width >= neededWidth) ?? candidates[candidates.length - 1];
|
|
14544
|
+
};
|
|
14545
|
+
const stackedAlphaPictureHeight = asset => {
|
|
14546
|
+
return asset.height / STACKED_ALPHA_ROWS;
|
|
14547
|
+
};
|
|
14548
|
+
const ALPHA_VIDEO_UNAVAILABLE = 'AlphaVideoUnavailableError';
|
|
14549
|
+
|
|
14550
|
+
// Thrown by the alpha video engine's constructor when it cannot composite after all (no
|
|
14551
|
+
// usable rendition, or the browser refused a WebGL context). EmbedBehavior catches it and
|
|
14552
|
+
// initializes the ordinary hls engine on the opaque renditions instead.
|
|
14553
|
+
class AlphaVideoUnavailableError extends Error {
|
|
14554
|
+
constructor(reason) {
|
|
14555
|
+
super(`AlphaVideo cannot play this media: ${reason}`);
|
|
14556
|
+
_defineProperty(this, "reason", void 0);
|
|
14557
|
+
this.name = ALPHA_VIDEO_UNAVAILABLE;
|
|
14558
|
+
this.reason = reason;
|
|
14559
|
+
}
|
|
14560
|
+
}
|
|
14561
|
+
|
|
14562
|
+
// The engine lives in its own chunk with its own copy of this module, so an `instanceof`
|
|
14563
|
+
// check in E-v1 would never match; recognise the error by name instead.
|
|
14564
|
+
const isAlphaVideoUnavailableError = error => {
|
|
14565
|
+
return error instanceof Error && error.name === ALPHA_VIDEO_UNAVAILABLE;
|
|
14566
|
+
};
|
|
14567
|
+
|
|
14568
|
+
/***/ },
|
|
14569
|
+
|
|
14304
14570
|
/***/ 9804
|
|
14305
14571
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
14306
14572
|
|
|
@@ -14633,35 +14899,36 @@ var __webpack_exports__ = {};
|
|
|
14633
14899
|
/* harmony import */ var _hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2721);
|
|
14634
14900
|
/* harmony import */ var _utilities_constants_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1512);
|
|
14635
14901
|
/* harmony import */ var _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6462);
|
|
14636
|
-
/* harmony import */ var
|
|
14637
|
-
/* harmony import */ var
|
|
14638
|
-
/* harmony import */ var
|
|
14639
|
-
/* harmony import */ var
|
|
14640
|
-
/* harmony import */ var
|
|
14641
|
-
/* harmony import */ var
|
|
14642
|
-
/* harmony import */ var
|
|
14643
|
-
/* harmony import */ var
|
|
14644
|
-
/* harmony import */ var
|
|
14645
|
-
/* harmony import */ var
|
|
14646
|
-
/* harmony import */ var
|
|
14647
|
-
/* harmony import */ var
|
|
14648
|
-
/* harmony import */ var
|
|
14649
|
-
/* harmony import */ var
|
|
14650
|
-
/* harmony import */ var
|
|
14651
|
-
/* harmony import */ var
|
|
14652
|
-
/* harmony import */ var
|
|
14653
|
-
/* harmony import */ var
|
|
14654
|
-
/* harmony import */ var
|
|
14655
|
-
/* harmony import */ var
|
|
14656
|
-
/* harmony import */ var
|
|
14657
|
-
/* harmony import */ var
|
|
14658
|
-
/* harmony import */ var
|
|
14659
|
-
/* harmony import */ var
|
|
14660
|
-
/* harmony import */ var
|
|
14661
|
-
/* harmony import */ var
|
|
14662
|
-
/* harmony import */ var
|
|
14663
|
-
/* harmony import */ var
|
|
14664
|
-
/* harmony import */ var
|
|
14902
|
+
/* harmony import */ var _media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4138);
|
|
14903
|
+
/* harmony import */ var _appHostname_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(787);
|
|
14904
|
+
/* harmony import */ var _utilities_assets_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7209);
|
|
14905
|
+
/* harmony import */ var _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7323);
|
|
14906
|
+
/* harmony import */ var _utilities_detect_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7231);
|
|
14907
|
+
/* harmony import */ var _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7157);
|
|
14908
|
+
/* harmony import */ var _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3280);
|
|
14909
|
+
/* harmony import */ var _utilities_elem_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7715);
|
|
14910
|
+
/* harmony import */ var _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(2760);
|
|
14911
|
+
/* harmony import */ var _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(3832);
|
|
14912
|
+
/* harmony import */ var _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(5857);
|
|
14913
|
+
/* harmony import */ var _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(5393);
|
|
14914
|
+
/* harmony import */ var _utilities_judy_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(438);
|
|
14915
|
+
/* harmony import */ var _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(3123);
|
|
14916
|
+
/* harmony import */ var _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(1248);
|
|
14917
|
+
/* harmony import */ var _utilities_seqid_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(1224);
|
|
14918
|
+
/* harmony import */ var _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(7211);
|
|
14919
|
+
/* harmony import */ var _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(1161);
|
|
14920
|
+
/* harmony import */ var _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(4755);
|
|
14921
|
+
/* harmony import */ var _utilities_url_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2671);
|
|
14922
|
+
/* harmony import */ var _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(4997);
|
|
14923
|
+
/* harmony import */ var _utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(9392);
|
|
14924
|
+
/* harmony import */ var _utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(541);
|
|
14925
|
+
/* harmony import */ var _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(6637);
|
|
14926
|
+
/* harmony import */ var _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(2147);
|
|
14927
|
+
/* harmony import */ var _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(5833);
|
|
14928
|
+
/* harmony import */ var _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(959);
|
|
14929
|
+
/* harmony import */ var _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(3411);
|
|
14930
|
+
/* harmony import */ var _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(4989);
|
|
14931
|
+
/* harmony import */ var _types_gradient_ts__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(7350);
|
|
14665
14932
|
var _WistiaPlayer;
|
|
14666
14933
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
14667
14934
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
@@ -14709,6 +14976,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
|
|
|
14709
14976
|
|
|
14710
14977
|
|
|
14711
14978
|
|
|
14979
|
+
|
|
14712
14980
|
|
|
14713
14981
|
|
|
14714
14982
|
// The component will not run without these attributes.
|
|
@@ -14783,7 +15051,7 @@ const defaultEmbedOptions = {
|
|
|
14783
15051
|
* @returns {string}
|
|
14784
15052
|
*/
|
|
14785
15053
|
const getSwatchUrl = (mediaId, embedHost = '') => {
|
|
14786
|
-
const fastHost = (0,
|
|
15054
|
+
const fastHost = (0,_utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__/* .cdnFastWistiaComHost */ .CX)(embedHost);
|
|
14787
15055
|
return `https://${fastHost}/embed/medias/${mediaId}/swatch`;
|
|
14788
15056
|
};
|
|
14789
15057
|
const PRELOAD_CLICK_OPTIONS = {
|
|
@@ -14851,11 +15119,11 @@ class WistiaPlayer extends HTMLElement {
|
|
|
14851
15119
|
_classPrivateFieldInitSpec(this, _playPending, false);
|
|
14852
15120
|
_classPrivateFieldInitSpec(this, _preactRoot, null);
|
|
14853
15121
|
_classPrivateFieldInitSpec(this, _preloadThumbnailRoot, null);
|
|
14854
|
-
_classPrivateFieldInitSpec(this, _publicApiScript, (0,
|
|
15122
|
+
_classPrivateFieldInitSpec(this, _publicApiScript, (0,_utilities_runScript_js__WEBPACK_IMPORTED_MODULE_22__/* .runScript */ .j)(`${(0,_utilities_url_js__WEBPACK_IMPORTED_MODULE_27__/* .proto */ .ff)()}//${(0,_appHostname_js__WEBPACK_IMPORTED_MODULE_9__/* .appHostname */ .Ni)('fast')}/assets/external/publicApi.js`));
|
|
14855
15123
|
_classPrivateFieldInitSpec(this, _resizeObserver, null);
|
|
14856
15124
|
_classPrivateFieldInitSpec(this, _handleAfterReplace, () => {
|
|
14857
15125
|
_assertClassBrand(_WistiaPlayer_brand, this, _maybeInjectJsonLd).call(this);
|
|
14858
|
-
(0,
|
|
15126
|
+
(0,_utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__/* .setEmbedOptionStore */ .gY)(`__${this.uniqueId}_dom_options__`, _classPrivateFieldGet(_playerData, this).embedOptions);
|
|
14859
15127
|
});
|
|
14860
15128
|
_classPrivateFieldInitSpec(this, _handleBeforeReplace, event => {
|
|
14861
15129
|
/**
|
|
@@ -14910,7 +15178,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
14910
15178
|
this.paddingTop = getComputedStyle(this).paddingTop;
|
|
14911
15179
|
|
|
14912
15180
|
// Set up a prefixed logger
|
|
14913
|
-
_classPrivateFieldSet(_logger, this,
|
|
15181
|
+
_classPrivateFieldSet(_logger, this, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_31__/* .wlog */ .ct.getPrefixedFunctions('WistiaPlayer'));
|
|
14914
15182
|
_classPrivateFieldSet(_playerData, this, new _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_7__/* .PlayerDataHandler */ .I());
|
|
14915
15183
|
|
|
14916
15184
|
// Wistia global setup if this is the first time we've seen a Wistia player
|
|
@@ -14978,7 +15246,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
14978
15246
|
_assertClassBrand(_WistiaPlayer_brand, this, _setSyncedEmbedOption).call(this, 'aspect', newAspect);
|
|
14979
15247
|
|
|
14980
15248
|
// By re-setting width to the same value, we trigger the aspect ratio to be recalculated.
|
|
14981
|
-
_classPrivateFieldGet(_impl, this)?.width((0,
|
|
15249
|
+
_classPrivateFieldGet(_impl, this)?.width((0,_utilities_elem_js__WEBPACK_IMPORTED_MODULE_15__/* .elemWidth */ .cG)(this), {
|
|
14982
15250
|
constrain: true
|
|
14983
15251
|
});
|
|
14984
15252
|
}
|
|
@@ -15121,7 +15389,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15121
15389
|
return _classPrivateFieldGet(_api, this)?.captionsLanguageCode() ?? _assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this).wistiaLanguageCode;
|
|
15122
15390
|
}
|
|
15123
15391
|
get captionsLanguages() {
|
|
15124
|
-
|
|
15392
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
15393
|
+
return [_assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this)];
|
|
15394
|
+
}
|
|
15395
|
+
return (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .getCaptionsLanguages */ .RJ)(_classPrivateFieldGet(_playerData, this).mediaData);
|
|
15125
15396
|
}
|
|
15126
15397
|
|
|
15127
15398
|
/**
|
|
@@ -15307,7 +15578,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15307
15578
|
// the public api doesn't allow for unsetting an email, so we don't wan to allow the setter
|
|
15308
15579
|
// eslint-disable-next-line @typescript-eslint/related-getter-setter-pairs
|
|
15309
15580
|
get email() {
|
|
15310
|
-
return (0,
|
|
15581
|
+
return (0,_utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_17__/* .extractEmailFromParams */ .i)(_classPrivateGetter(_WistiaPlayer_brand, this, _get_pageUrl)) ?? (0,_utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_28__/* .getWistiaLocalStorage */ .y1)()[_classPrivateGetter(_WistiaPlayer_brand, this, _get_pageUrl)]?.trackEmail ?? this.embedOptions.email ?? undefined;
|
|
15311
15582
|
}
|
|
15312
15583
|
|
|
15313
15584
|
/**
|
|
@@ -15477,7 +15748,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15477
15748
|
_classPrivateFieldGet(_api, this)?.language(language);
|
|
15478
15749
|
}
|
|
15479
15750
|
get languages() {
|
|
15480
|
-
|
|
15751
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
15752
|
+
return [_assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this)];
|
|
15753
|
+
}
|
|
15754
|
+
return (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .getLanguages */ .kG)(_classPrivateFieldGet(_playerData, this).mediaData);
|
|
15481
15755
|
}
|
|
15482
15756
|
|
|
15483
15757
|
/**
|
|
@@ -15539,7 +15813,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15539
15813
|
* @returns {Localization[]}
|
|
15540
15814
|
*/
|
|
15541
15815
|
get mediaLanguages() {
|
|
15542
|
-
|
|
15816
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
15817
|
+
return [_assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this)];
|
|
15818
|
+
}
|
|
15819
|
+
return (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .getMediaLanguages */ .my)(_classPrivateFieldGet(_playerData, this).mediaData);
|
|
15543
15820
|
}
|
|
15544
15821
|
|
|
15545
15822
|
/**
|
|
@@ -15721,7 +15998,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15721
15998
|
*/
|
|
15722
15999
|
get playerColorGradient() {
|
|
15723
16000
|
const value = _assertClassBrand(_WistiaPlayer_brand, this, _getSyncedEmbedOption).call(this, 'playerColorGradient');
|
|
15724
|
-
if ((0,
|
|
16001
|
+
if ((0,_types_gradient_ts__WEBPACK_IMPORTED_MODULE_37__/* .isGradient */ .b)(value)) {
|
|
15725
16002
|
return value;
|
|
15726
16003
|
}
|
|
15727
16004
|
return undefined;
|
|
@@ -15733,7 +16010,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15733
16010
|
* @returns {void}
|
|
15734
16011
|
*/
|
|
15735
16012
|
set playerColorGradient(gradient) {
|
|
15736
|
-
if (!(0,
|
|
16013
|
+
if (!(0,_types_gradient_ts__WEBPACK_IMPORTED_MODULE_37__/* .isGradient */ .b)(gradient)) {
|
|
15737
16014
|
throw new Error('playerColorGradient must be a valid gradient object');
|
|
15738
16015
|
}
|
|
15739
16016
|
_classPrivateFieldGet(_impl, this)?.playerColorGradient(gradient);
|
|
@@ -16712,9 +16989,9 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16712
16989
|
if (detail.context === context) {
|
|
16713
16990
|
resolve();
|
|
16714
16991
|
}
|
|
16715
|
-
this.removeEventListener(
|
|
16992
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INPUT_CONTEXT_CHANGE_EVENT */ .ve, handler);
|
|
16716
16993
|
};
|
|
16717
|
-
this.addEventListener(
|
|
16994
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INPUT_CONTEXT_CHANGE_EVENT */ .ve, handler);
|
|
16718
16995
|
_classPrivateFieldGet(_impl, this)?.enterInputContext(context);
|
|
16719
16996
|
});
|
|
16720
16997
|
}
|
|
@@ -16735,7 +17012,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16735
17012
|
* @returns {Promise<MediaData | MediaDataServerErrorResponse>} The media data or error response
|
|
16736
17013
|
*/
|
|
16737
17014
|
async getInitialMediaData(mediaId, options) {
|
|
16738
|
-
return (0,
|
|
17015
|
+
return (0,_utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_33__/* .getInitialMediaData */ .n)(mediaId, options);
|
|
16739
17016
|
}
|
|
16740
17017
|
|
|
16741
17018
|
/**
|
|
@@ -16766,7 +17043,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16766
17043
|
_classPrivateFieldSet(_cachedRemapTime, this, (_fromLanguage, _toLanguage, fromTime) => fromTime);
|
|
16767
17044
|
return _classPrivateFieldGet(_cachedRemapTime, this);
|
|
16768
17045
|
}
|
|
16769
|
-
_classPrivateFieldGet(_cachedRemapTime, this) ?? _classPrivateFieldSet(_cachedRemapTime, this, await (0,
|
|
17046
|
+
_classPrivateFieldGet(_cachedRemapTime, this) ?? _classPrivateFieldSet(_cachedRemapTime, this, await (0,_utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_13__/* .dynamicImport */ .$)('assets/external/timeMapping.js').then(({
|
|
16770
17047
|
remapTime
|
|
16771
17048
|
}) => (fromLanguage, toLanguage, fromTime) => {
|
|
16772
17049
|
const fromTimeInMilliseconds = fromTime * 1000;
|
|
@@ -16808,10 +17085,15 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16808
17085
|
});
|
|
16809
17086
|
}
|
|
16810
17087
|
languagesToLocalizations(languages) {
|
|
16811
|
-
|
|
17088
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
17089
|
+
return [];
|
|
17090
|
+
}
|
|
17091
|
+
|
|
17092
|
+
// As in PublicApi, languages without a localization map to undefined
|
|
17093
|
+
return languages.map(language => (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .languageToLocalization */ .rK)(_classPrivateFieldGet(_playerData, this).mediaData, language));
|
|
16812
17094
|
}
|
|
16813
17095
|
languageToLocalization(language) {
|
|
16814
|
-
return _classPrivateFieldGet(
|
|
17096
|
+
return (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .languageToLocalization */ .rK)(_classPrivateFieldGet(_playerData, this).mediaData, language) ?? _assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this);
|
|
16815
17097
|
}
|
|
16816
17098
|
|
|
16817
17099
|
/**
|
|
@@ -16894,12 +17176,12 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16894
17176
|
if (!_classPrivateFieldGet(_api, this)) {
|
|
16895
17177
|
reject(new Error('api not ready to replace'));
|
|
16896
17178
|
}
|
|
16897
|
-
(0,
|
|
17179
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .removeInjectedJsonLd */ .Z)(_classPrivateFieldGet(_jsonLdId, this));
|
|
16898
17180
|
const handleAfterReplace = () => {
|
|
16899
|
-
this.removeEventListener(
|
|
17181
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, handleAfterReplace);
|
|
16900
17182
|
resolve();
|
|
16901
17183
|
};
|
|
16902
|
-
this.addEventListener(
|
|
17184
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, handleAfterReplace);
|
|
16903
17185
|
_classPrivateFieldGet(_api, this)?.replaceWith(mediaId, options);
|
|
16904
17186
|
});
|
|
16905
17187
|
}
|
|
@@ -16969,10 +17251,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16969
17251
|
});
|
|
16970
17252
|
}
|
|
16971
17253
|
const handler = () => {
|
|
16972
|
-
this.removeEventListener(
|
|
17254
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .API_READY_EVENT */ .c5, handler);
|
|
16973
17255
|
resolve();
|
|
16974
17256
|
};
|
|
16975
|
-
this.addEventListener(
|
|
17257
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .API_READY_EVENT */ .c5, handler);
|
|
16976
17258
|
});
|
|
16977
17259
|
}
|
|
16978
17260
|
async whenControlMounted(handle) {
|
|
@@ -17030,7 +17312,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17030
17312
|
|
|
17031
17313
|
// Attribute names must match their corresponding property names (kebab-case -> camelCase)
|
|
17032
17314
|
// So the player-color attribute maps to the playerColor property
|
|
17033
|
-
this[(0,
|
|
17315
|
+
this[(0,_utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_36__/* .kebabCaseToCamelCase */ .b)(name)] = finalValue;
|
|
17034
17316
|
}
|
|
17035
17317
|
connectedCallback() {
|
|
17036
17318
|
if (_classPrivateFieldGet(_hasElementConnectedToDOM, this)) {
|
|
@@ -17039,27 +17321,27 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17039
17321
|
_classPrivateFieldSet(_hasElementConnectedToDOM, this, true);
|
|
17040
17322
|
const mediaId = this.getAttribute('media-id');
|
|
17041
17323
|
if (mediaId == null) {
|
|
17042
|
-
(0,
|
|
17324
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/failure/init-failed');
|
|
17043
17325
|
throw new Error('media-id attribute is required');
|
|
17044
17326
|
}
|
|
17045
17327
|
|
|
17046
17328
|
// Allows for all bulk setting of embed options and mediaData
|
|
17047
17329
|
window.wistiaOptions = window.wistiaOptions ?? {};
|
|
17048
|
-
const opts = (0,
|
|
17330
|
+
const opts = (0,_utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_29__/* .getWistiaOptions */ .C)(this.mediaId);
|
|
17049
17331
|
_classPrivateFieldGet(_playerData, this).setWistiaWindowEmbedOptionSource(opts);
|
|
17050
17332
|
|
|
17051
17333
|
// Add the media id to the logger now that we have it
|
|
17052
|
-
_classPrivateFieldSet(_logger, this,
|
|
17053
|
-
_classPrivateFieldSet(_judyContext, this, (0,
|
|
17334
|
+
_classPrivateFieldSet(_logger, this, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_31__/* .wlog */ .ct.getPrefixedFunctions(`WistiaPlayer ${mediaId}`));
|
|
17335
|
+
_classPrivateFieldSet(_judyContext, this, (0,_utilities_judy_js__WEBPACK_IMPORTED_MODULE_20__/* .buildContext */ .gC)());
|
|
17054
17336
|
|
|
17055
17337
|
// If the player was created from our React wrapper component, send a tracking event
|
|
17056
17338
|
if (this.getAttribute('react') === 'true') {
|
|
17057
|
-
(0,
|
|
17339
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/initembed.react');
|
|
17058
17340
|
}
|
|
17059
17341
|
_assertClassBrand(_WistiaPlayer_brand, this, _setupEventListeners).call(this);
|
|
17060
17342
|
_classPrivateFieldGet(_logger, this).info('initialize embed');
|
|
17061
17343
|
if (!this.useWebComponent) {
|
|
17062
|
-
(0,
|
|
17344
|
+
(0,_utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_30__/* .maybeStartWistiaQueue */ .z)();
|
|
17063
17345
|
}
|
|
17064
17346
|
|
|
17065
17347
|
// Generate a unique id for this embed in case there are
|
|
@@ -17083,9 +17365,9 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17083
17365
|
overrideMediaLanguage: this.embedOptions.language
|
|
17084
17366
|
};
|
|
17085
17367
|
this.getInitialMediaData(mediaId, optsForFetch).then(mediaDataOrError => {
|
|
17086
|
-
if ((0,
|
|
17368
|
+
if ((0,_utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__/* .isMediaDataError */ .V)(mediaDataOrError)) {
|
|
17087
17369
|
if (mediaDataOrError.iframe === true || mediaDataOrError.iframe === 'true') {
|
|
17088
|
-
const baseUrl = `${(0,
|
|
17370
|
+
const baseUrl = `${(0,_utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__/* .eV1Protocol */ .v9)()}//${(0,_utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__/* .eV1HostWithPort */ .aY)()}`;
|
|
17089
17371
|
this.style.display = 'block';
|
|
17090
17372
|
|
|
17091
17373
|
// Check if width is already set via CSS or attributes
|
|
@@ -17104,7 +17386,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17104
17386
|
const mediaData = mediaDataOrError;
|
|
17105
17387
|
this.mediaId = mediaData.hashedId ?? this.mediaId;
|
|
17106
17388
|
_classPrivateFieldGet(_playerData, this).setMediaDataSource(mediaData);
|
|
17107
|
-
this.dispatchEvent(new CustomEvent(
|
|
17389
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .LOADED_MEDIA_DATA_EVENT */ .rO, {
|
|
17108
17390
|
detail: {
|
|
17109
17391
|
mediaData: _classPrivateFieldGet(_playerData, this).mediaData
|
|
17110
17392
|
}
|
|
@@ -17117,7 +17399,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17117
17399
|
mediaData: _classPrivateFieldGet(_playerData, this).mediaData
|
|
17118
17400
|
});
|
|
17119
17401
|
}).catch(error => {
|
|
17120
|
-
(0,
|
|
17402
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/failure/init-failed');
|
|
17121
17403
|
throw new Error(error.message);
|
|
17122
17404
|
});
|
|
17123
17405
|
|
|
@@ -17142,11 +17424,11 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17142
17424
|
_classPrivateFieldGet(_removeEventListeners, this).forEach(removeListener => removeListener());
|
|
17143
17425
|
this.removeAllEventListeners();
|
|
17144
17426
|
_classPrivateFieldSet(_eventListeners, this, {});
|
|
17145
|
-
(0,
|
|
17146
|
-
(0,
|
|
17427
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .removeInjectedJsonLd */ .Z)(_classPrivateFieldGet(_jsonLdId, this));
|
|
17428
|
+
(0,_utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_35__/* .uncacheMediaData */ .s3)(this.mediaId);
|
|
17147
17429
|
_classPrivateFieldGet(_resizeObserver, this)?.disconnect();
|
|
17148
17430
|
_classPrivateFieldSet(_resizeObserver, this, null);
|
|
17149
|
-
(0,
|
|
17431
|
+
(0,_utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__/* .removeEmbedOptionStore */ .iU)(`__${this.uniqueId}_dom_options__`);
|
|
17150
17432
|
_classPrivateFieldGet(_api, this)?.remove();
|
|
17151
17433
|
_classPrivateFieldSet(_api, this, null);
|
|
17152
17434
|
_assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
|
|
@@ -17167,7 +17449,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17167
17449
|
*/
|
|
17168
17450
|
_WistiaPlayer = WistiaPlayer;
|
|
17169
17451
|
function _get_pageUrl(_this) {
|
|
17170
|
-
return _this.getAttribute('page-url') ?? (0,
|
|
17452
|
+
return _this.getAttribute('page-url') ?? (0,_utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_19__/* .inferPageUrl */ .H)();
|
|
17171
17453
|
}
|
|
17172
17454
|
function _defaultLocalization() {
|
|
17173
17455
|
return {
|
|
@@ -17241,7 +17523,7 @@ function _findLocalizationByLanguage(language) {
|
|
|
17241
17523
|
*/
|
|
17242
17524
|
function _generateUniqueId(mediaId) {
|
|
17243
17525
|
const prefix = `wistia-${mediaId}-`;
|
|
17244
|
-
return (0,
|
|
17526
|
+
return (0,_utilities_seqid_js__WEBPACK_IMPORTED_MODULE_23__/* .seqId */ .h)(prefix);
|
|
17245
17527
|
}
|
|
17246
17528
|
/**
|
|
17247
17529
|
* Returns either the value of an embed option from the public api
|
|
@@ -17262,7 +17544,7 @@ function _getSyncedEmbedOption(key) {
|
|
|
17262
17544
|
|
|
17263
17545
|
// Otherwise check this element's embed config for a value and fallback
|
|
17264
17546
|
// to the default embed options as a last resort
|
|
17265
|
-
return this.embedOptions[key] ?? _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, (0,
|
|
17547
|
+
return this.embedOptions[key] ?? _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, (0,_utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_36__/* .camelCaseToKebabCase */ .$)(key)) ?? defaultEmbedOptions[key];
|
|
17266
17548
|
}
|
|
17267
17549
|
/**
|
|
17268
17550
|
* Gets the value of an attribute if it exists, returns null if not
|
|
@@ -17303,8 +17585,8 @@ function _initPlayerEmbed({
|
|
|
17303
17585
|
_classPrivateFieldGet(_playerData, this).updateEmbedOptionOverrides({
|
|
17304
17586
|
videoFoam: true
|
|
17305
17587
|
});
|
|
17306
|
-
if (mediaData && !(0,
|
|
17307
|
-
_classPrivateFieldSet(_playerType, this, (0,
|
|
17588
|
+
if (mediaData && !(0,_utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__/* .isMediaDataError */ .V)(mediaData)) {
|
|
17589
|
+
_classPrivateFieldSet(_playerType, this, (0,_utilities_judy_js__WEBPACK_IMPORTED_MODULE_20__/* .choosePlayer */ .$F)(_classPrivateFieldGet(_judyContext, this), _classPrivateFieldGet(_playerData, this).mediaData, _classPrivateFieldGet(_playerData, this).embedOptions));
|
|
17308
17590
|
_assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
|
|
17309
17591
|
_assertClassBrand(_WistiaPlayer_brand, this, _maybeInjectJsonLd).call(this);
|
|
17310
17592
|
}
|
|
@@ -17328,7 +17610,7 @@ async function _initPublicApi(mediaId, options) {
|
|
|
17328
17610
|
// Import the public api script
|
|
17329
17611
|
await _classPrivateFieldGet(_publicApiScript, this);
|
|
17330
17612
|
if (!_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__/* .Wistia */ .s.PublicApi) {
|
|
17331
|
-
(0,
|
|
17613
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/failure/init-failed');
|
|
17332
17614
|
throw new Error('Wistia.PublicApi is not defined');
|
|
17333
17615
|
}
|
|
17334
17616
|
const embeddedCallback = () => {
|
|
@@ -17346,16 +17628,16 @@ async function _initPublicApi(mediaId, options) {
|
|
|
17346
17628
|
// Initialize!
|
|
17347
17629
|
_classPrivateFieldSet(_api, this, new _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__/* .Wistia */ .s.PublicApi(mediaId, options));
|
|
17348
17630
|
// internal: lets the TranslationApi attach legacy bindings made before the api existed
|
|
17349
|
-
this.dispatchEvent(new CustomEvent(
|
|
17631
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INTERNAL_API_CREATED_EVENT */ .jQ, {
|
|
17350
17632
|
detail: {
|
|
17351
17633
|
mediaId
|
|
17352
17634
|
}
|
|
17353
17635
|
}));
|
|
17354
|
-
this.addEventListener(
|
|
17355
|
-
this.addEventListener(
|
|
17636
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .BEFORE_REPLACE_EVENT */ .kY, _classPrivateFieldGet(_handleBeforeReplace, this));
|
|
17637
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, _classPrivateFieldGet(_handleAfterReplace, this));
|
|
17356
17638
|
_classPrivateFieldGet(_removeEventListeners, this).push(() => {
|
|
17357
|
-
this.removeEventListener(
|
|
17358
|
-
this.removeEventListener(
|
|
17639
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .BEFORE_REPLACE_EVENT */ .kY, _classPrivateFieldGet(_handleBeforeReplace, this));
|
|
17640
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, _classPrivateFieldGet(_handleAfterReplace, this));
|
|
17359
17641
|
});
|
|
17360
17642
|
_classPrivateFieldGet(_api, this).ready(() => {
|
|
17361
17643
|
_classPrivateFieldGet(_resizeObserver, this)?.disconnect();
|
|
@@ -17363,14 +17645,14 @@ async function _initPublicApi(mediaId, options) {
|
|
|
17363
17645
|
_assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
|
|
17364
17646
|
this.removeEventListener('click', _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
|
|
17365
17647
|
// event for public consumption, exposed on our event types
|
|
17366
|
-
this.dispatchEvent(new CustomEvent(
|
|
17648
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .API_READY_EVENT */ .c5, {
|
|
17367
17649
|
detail: {
|
|
17368
17650
|
mediaId
|
|
17369
17651
|
}
|
|
17370
17652
|
}));
|
|
17371
17653
|
|
|
17372
17654
|
// event for internal consumption, not exposed on our event types
|
|
17373
|
-
this.dispatchEvent(new CustomEvent(
|
|
17655
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INTERNAL_API_ON_FIND_EVENT */ .iP, {
|
|
17374
17656
|
detail: {
|
|
17375
17657
|
mediaId,
|
|
17376
17658
|
api: _classPrivateFieldGet(_api, this)
|
|
@@ -17407,12 +17689,12 @@ async function _maybeInitializeMux() {
|
|
|
17407
17689
|
if (!_classPrivateFieldGet(_api, this)) {
|
|
17408
17690
|
return;
|
|
17409
17691
|
}
|
|
17410
|
-
const shouldRandomEnableMux = (0,
|
|
17411
|
-
const shouldEnableMuxForPlayer = (0,
|
|
17692
|
+
const shouldRandomEnableMux = (0,_utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_11__/* .didWinCoinFlip */ .k)(_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_24__/* .MUX_PERCENTAGE_TO_ENABLE */ ._);
|
|
17693
|
+
const shouldEnableMuxForPlayer = (0,_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_24__/* .shouldEnableMux */ .J)(_classPrivateFieldGet(_api, this), shouldRandomEnableMux) && (0,_utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_26__/* .isVisitorTrackingEnabled */ .D5)();
|
|
17412
17694
|
const embedType = this.useWebComponent ? 'translated-web-component' : 'web-component';
|
|
17413
17695
|
if (shouldEnableMuxForPlayer) {
|
|
17414
17696
|
try {
|
|
17415
|
-
const mux = await (0,
|
|
17697
|
+
const mux = await (0,_utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_13__/* .dynamicImport */ .$)('assets/external/wistia-mux.js');
|
|
17416
17698
|
mux.init(_classPrivateFieldGet(_api, this), {
|
|
17417
17699
|
embedType
|
|
17418
17700
|
});
|
|
@@ -17435,8 +17717,8 @@ async function _maybeInitializeMux() {
|
|
|
17435
17717
|
function _maybeInjectJsonLd() {
|
|
17436
17718
|
if (this.seo && _classPrivateFieldGet(_playerType, this) !== 'notplayable' && _classPrivateFieldGet(_playerType, this) !== 'passwordprotected' && _classPrivateFieldGet(_playerType, this) !== 'carouselHardWall') {
|
|
17437
17719
|
_classPrivateFieldSet(_jsonLdId, this, `w-json-ld-${this.uniqueId}`);
|
|
17438
|
-
(0,
|
|
17439
|
-
(0,
|
|
17720
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .removeInjectedJsonLd */ .Z)(_classPrivateFieldGet(_jsonLdId, this));
|
|
17721
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .injectJsonLd */ .g)(_classPrivateFieldGet(_jsonLdId, this), _classPrivateFieldGet(_playerData, this).mediaData, {
|
|
17440
17722
|
embedOptions: _classPrivateFieldGet(_playerData, this).embedOptions,
|
|
17441
17723
|
videoHeight: this.offsetHeight,
|
|
17442
17724
|
videoWidth: this.offsetWidth
|
|
@@ -17463,7 +17745,7 @@ function _maybeSetupLLMOptimizedEmbed() {
|
|
|
17463
17745
|
if (!preloadTranscriptForLLMEmbed) {
|
|
17464
17746
|
return;
|
|
17465
17747
|
}
|
|
17466
|
-
(0,
|
|
17748
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/initembed.llm-optimized', 1, {
|
|
17467
17749
|
href: window.location.href,
|
|
17468
17750
|
mediaId: this.mediaId
|
|
17469
17751
|
});
|
|
@@ -17486,7 +17768,7 @@ function _renderEmbedTemplate() {
|
|
|
17486
17768
|
if (parseFloat(_classPrivateFieldGet(_paddingTop, this)) !== 0 && _classPrivateFieldGet(_paddingTop, this) !== '') {
|
|
17487
17769
|
swatchHeight = `${parseFloat(_classPrivateFieldGet(_paddingTop, this))}px`;
|
|
17488
17770
|
}
|
|
17489
|
-
const playerBorderRadius = (0,
|
|
17771
|
+
const playerBorderRadius = (0,_utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_21__/* .getDefaultPlayerBorderRadius */ .JA)({
|
|
17490
17772
|
playerBorderRadius: this.playerBorderRadius,
|
|
17491
17773
|
roundedPlayer: this.roundedPlayer
|
|
17492
17774
|
});
|
|
@@ -17559,7 +17841,7 @@ function _renderPreloadThumbnail() {
|
|
|
17559
17841
|
if (carouselHardWall) {
|
|
17560
17842
|
return;
|
|
17561
17843
|
}
|
|
17562
|
-
const thumbnailAssets = (0,
|
|
17844
|
+
const thumbnailAssets = (0,_utilities_assets_js__WEBPACK_IMPORTED_MODULE_10__/* .thumbnailAssets */ .Q0)(assets, {});
|
|
17563
17845
|
const shouldRenderThumbnail = (!this.wistiaPopover || _assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this)) && mediaType !== 'Audio' && thumbnailAssets.length > 0;
|
|
17564
17846
|
if (!shouldRenderThumbnail) {
|
|
17565
17847
|
return;
|
|
@@ -17601,7 +17883,7 @@ function _runMethodsFromAttributes() {
|
|
|
17601
17883
|
this.whenApiReady().then(() => {
|
|
17602
17884
|
const newTime = Number(_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, 'current-time'));
|
|
17603
17885
|
const isClosedPopover = (_classPrivateFieldGet(_api, this)?.popover && !_classPrivateFieldGet(_api, this).popover.isVisible()) ?? false;
|
|
17604
|
-
const isMobile = (0,
|
|
17886
|
+
const isMobile = (0,_utilities_detect_js__WEBPACK_IMPORTED_MODULE_12__/* .detectIsMobile */ .GS)();
|
|
17605
17887
|
const shouldDelayUntilPlay = this.state !== 'playing' && (isMobile || isClosedPopover);
|
|
17606
17888
|
void _classPrivateFieldGet(_impl, this)?.time(newTime, {
|
|
17607
17889
|
lazy: shouldDelayUntilPlay
|
|
@@ -17630,11 +17912,11 @@ function _runMethodsFromAttributes() {
|
|
|
17630
17912
|
* @private
|
|
17631
17913
|
*/
|
|
17632
17914
|
function _saveInitialAttributesFromDomOptions() {
|
|
17633
|
-
const domOptions = Object.fromEntries(Object.entries(this.attributes).map(([, value]) => [(0,
|
|
17915
|
+
const domOptions = Object.fromEntries(Object.entries(this.attributes).map(([, value]) => [(0,_utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_36__/* .kebabCaseToCamelCase */ .b)(value.name), _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, value.name)]));
|
|
17634
17916
|
_classPrivateFieldGet(_playerData, this).setDomEmbedOptionSource(domOptions);
|
|
17635
17917
|
|
|
17636
17918
|
// The public api uses this store when it gathers options from our many different sources
|
|
17637
|
-
(0,
|
|
17919
|
+
(0,_utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__/* .setEmbedOptionStore */ .gY)(`__${this.uniqueId}_dom_options__`, _classPrivateFieldGet(_playerData, this).embedOptions);
|
|
17638
17920
|
}
|
|
17639
17921
|
/**
|
|
17640
17922
|
* Takes an object of embed options and sets both the value of an
|
|
@@ -17700,8 +17982,8 @@ function _setupEventListeners() {
|
|
|
17700
17982
|
const implCreatedCallback = event => {
|
|
17701
17983
|
_classPrivateFieldSet(_impl, this, event.detail.impl);
|
|
17702
17984
|
};
|
|
17703
|
-
this.addEventListener(
|
|
17704
|
-
this.addEventListener(
|
|
17985
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .LOADED_MEDIA_DATA_EVENT */ .rO, loadedMediaDataCallback);
|
|
17986
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .IMPL_CREATED_EVENT */ .dp, implCreatedCallback);
|
|
17705
17987
|
|
|
17706
17988
|
// Dispatched on this host by the legacy popover code each time the popover
|
|
17707
17989
|
// dialog closes. See #returnFocusToPopoverTrigger.
|
|
@@ -17711,9 +17993,9 @@ function _setupEventListeners() {
|
|
|
17711
17993
|
};
|
|
17712
17994
|
this.addEventListener('popover-thumbnail-ready', popoverThumbnailReadyCallback);
|
|
17713
17995
|
_classPrivateFieldGet(_removeEventListeners, this).push(() => {
|
|
17714
|
-
this.removeEventListener(
|
|
17996
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .LOADED_MEDIA_DATA_EVENT */ .rO, loadedMediaDataCallback);
|
|
17715
17997
|
}, () => {
|
|
17716
|
-
this.removeEventListener(
|
|
17998
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .IMPL_CREATED_EVENT */ .dp, implCreatedCallback);
|
|
17717
17999
|
}, () => {
|
|
17718
18000
|
this.removeEventListener('popover-hide', _classPrivateFieldGet(_returnFocusToPopoverTrigger, this));
|
|
17719
18001
|
}, () => {
|
|
@@ -17737,7 +18019,7 @@ function _shouldDisplaySwatch() {
|
|
|
17737
18019
|
* @private
|
|
17738
18020
|
*/
|
|
17739
18021
|
function _updateEmail(email) {
|
|
17740
|
-
(0,
|
|
18022
|
+
(0,_utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_28__/* .updateWistiaLocalStorage */ .$B)(localStorage => {
|
|
17741
18023
|
// eslint-disable-next-line no-param-reassign
|
|
17742
18024
|
localStorage[_classPrivateGetter(_WistiaPlayer_brand, this, _get_pageUrl)] = {
|
|
17743
18025
|
...localStorage[_classPrivateGetter(_WistiaPlayer_brand, this, _get_pageUrl)],
|
|
@@ -17757,13 +18039,13 @@ function _updateEmail(email) {
|
|
|
17757
18039
|
* @private
|
|
17758
18040
|
*/
|
|
17759
18041
|
function _updateMediaData(mediaData) {
|
|
17760
|
-
if ((0,
|
|
18042
|
+
if ((0,_utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__/* .isMediaDataError */ .V)(mediaData)) {
|
|
17761
18043
|
// Return early to avoid errors since the rest of the code assumes a
|
|
17762
18044
|
// MediaData object.
|
|
17763
18045
|
return;
|
|
17764
18046
|
}
|
|
17765
18047
|
_classPrivateFieldGet(_playerData, this).setMediaDataSource(mediaData);
|
|
17766
|
-
_classPrivateFieldSet(_playerType, this, (0,
|
|
18048
|
+
_classPrivateFieldSet(_playerType, this, (0,_utilities_judy_js__WEBPACK_IMPORTED_MODULE_20__/* .choosePlayer */ .$F)(_classPrivateFieldGet(_judyContext, this), _classPrivateFieldGet(_playerData, this).mediaData, _classPrivateFieldGet(_playerData, this).embedOptions));
|
|
17767
18049
|
_assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
|
|
17768
18050
|
}
|
|
17769
18051
|
const getSwatchMetaData = async url => {
|