@wistia/wistia-player 0.7.22 → 0.7.24
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 +16 -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 +4 -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 +377 -102
- package/dist/wistia-player.js.map +1 -1
- package/package.json +2 -2
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.24" || 0;
|
|
6980
|
+
const CURRENT_SHA = "7bf2c72914bff7c399602d4a343526627b21568b" || 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,
|
|
@@ -8854,6 +9028,23 @@ const webp = () => {
|
|
|
8854
9028
|
const isOperaSupported = operaBrowser && browserVersion() >= 19;
|
|
8855
9029
|
return isChromeDesktopSupported || isChromeAndroidSupported || isFirefoxDesktopSupported || isFirefoxAndroidSupported || isEdgeSupported || isOperaSupported;
|
|
8856
9030
|
};
|
|
9031
|
+
|
|
9032
|
+
// Whether a WebGL context can be created (transparent video is composited with one). The
|
|
9033
|
+
// probe releases its context straight away: contexts are scarce (browsers cap them at
|
|
9034
|
+
// around 16 per page), and this runs once per page like every other capability here.
|
|
9035
|
+
const webgl = () => {
|
|
9036
|
+
try {
|
|
9037
|
+
const canvas = document.createElement('canvas');
|
|
9038
|
+
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
|
9039
|
+
if (!gl) {
|
|
9040
|
+
return false;
|
|
9041
|
+
}
|
|
9042
|
+
gl.getExtension('WEBGL_lose_context')?.loseContext();
|
|
9043
|
+
return true;
|
|
9044
|
+
} catch (e) {
|
|
9045
|
+
return false;
|
|
9046
|
+
}
|
|
9047
|
+
};
|
|
8857
9048
|
const cachedDetect = () => {
|
|
8858
9049
|
if (_playerDetectCache) {
|
|
8859
9050
|
// Allow this to be cached globally so it's not executed once every time
|
|
@@ -8901,6 +9092,7 @@ const uncachedDetect = () => {
|
|
|
8901
9092
|
callingPlayRequiresEventContext: callingPlayRequiresEventContext(),
|
|
8902
9093
|
passiveSupported: passiveSupported(),
|
|
8903
9094
|
webp: webp(),
|
|
9095
|
+
webgl: webgl(),
|
|
8904
9096
|
performanceMeasure: (0,_performance_ts__WEBPACK_IMPORTED_MODULE_1__/* .hasPerformanceMeasureSupport */ .O)()
|
|
8905
9097
|
};
|
|
8906
9098
|
result.browser[browser()] = true;
|
|
@@ -14301,6 +14493,73 @@ const pageLoaded = (fn, timeout = 4000, doc = document, win = window) => {
|
|
|
14301
14493
|
|
|
14302
14494
|
/***/ },
|
|
14303
14495
|
|
|
14496
|
+
/***/ 9563
|
|
14497
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
14498
|
+
|
|
14499
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14500
|
+
/* harmony export */ Yw: () => (/* binding */ isStackedAlphaAsset)
|
|
14501
|
+
/* harmony export */ });
|
|
14502
|
+
/* unused harmony exports STACKED_ALPHA_ASSET_TYPE, STACKED_ALPHA_ROWS, readyStackedAlphaAssets, chooseStackedAlphaAsset, stackedAlphaPictureHeight, AlphaVideoUnavailableError, isAlphaVideoUnavailableError */
|
|
14503
|
+
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; }
|
|
14504
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14505
|
+
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); }
|
|
14506
|
+
// The transparent ("stacked alpha") rendition is its own media file class on the backend
|
|
14507
|
+
// (StackedAlphaVideoFile), which reaches us as this asset type.
|
|
14508
|
+
const STACKED_ALPHA_ASSET_TYPE = 'stacked_alpha_video';
|
|
14509
|
+
|
|
14510
|
+
// A stacked frame is the colour picture with its alpha matte drawn underneath it, so the
|
|
14511
|
+
// encoded frame is twice the height of the picture the viewer sees.
|
|
14512
|
+
const STACKED_ALPHA_ROWS = 2;
|
|
14513
|
+
const MAX_PIXEL_RATIO = 2;
|
|
14514
|
+
// Mirrors READY in assets.js, which imports this module.
|
|
14515
|
+
const READY_STATUS = 2;
|
|
14516
|
+
const isStackedAlphaAsset = asset => {
|
|
14517
|
+
return asset?.type === STACKED_ALPHA_ASSET_TYPE;
|
|
14518
|
+
};
|
|
14519
|
+
const readyStackedAlphaAssets = assets => {
|
|
14520
|
+
return (assets ?? []).filter(asset => {
|
|
14521
|
+
return isStackedAlphaAsset(asset) && asset.status === READY_STATUS && asset.public && typeof asset.url === 'string';
|
|
14522
|
+
});
|
|
14523
|
+
};
|
|
14524
|
+
|
|
14525
|
+
/**
|
|
14526
|
+
* Picks the stacked-alpha rendition to play: the smallest ready one that still covers the
|
|
14527
|
+
* rendered width at the device pixel ratio (capped at 2x), or the largest when none does.
|
|
14528
|
+
*/
|
|
14529
|
+
const chooseStackedAlphaAsset = (assets, target) => {
|
|
14530
|
+
const candidates = readyStackedAlphaAssets(assets).sort((left, right) => left.width - right.width);
|
|
14531
|
+
if (candidates.length === 0) {
|
|
14532
|
+
return undefined;
|
|
14533
|
+
}
|
|
14534
|
+
const pixelRatio = Math.min(target.devicePixelRatio ?? 1, MAX_PIXEL_RATIO);
|
|
14535
|
+
const neededWidth = Math.max(1, target.width) * pixelRatio;
|
|
14536
|
+
return candidates.find(asset => asset.width >= neededWidth) ?? candidates[candidates.length - 1];
|
|
14537
|
+
};
|
|
14538
|
+
const stackedAlphaPictureHeight = asset => {
|
|
14539
|
+
return asset.height / STACKED_ALPHA_ROWS;
|
|
14540
|
+
};
|
|
14541
|
+
const ALPHA_VIDEO_UNAVAILABLE = 'AlphaVideoUnavailableError';
|
|
14542
|
+
|
|
14543
|
+
// Thrown by the alpha video engine's constructor when it cannot composite after all (no
|
|
14544
|
+
// usable rendition, or the browser refused a WebGL context). EmbedBehavior catches it and
|
|
14545
|
+
// initializes the ordinary hls engine on the opaque renditions instead.
|
|
14546
|
+
class AlphaVideoUnavailableError extends Error {
|
|
14547
|
+
constructor(reason) {
|
|
14548
|
+
super(`AlphaVideo cannot play this media: ${reason}`);
|
|
14549
|
+
_defineProperty(this, "reason", void 0);
|
|
14550
|
+
this.name = ALPHA_VIDEO_UNAVAILABLE;
|
|
14551
|
+
this.reason = reason;
|
|
14552
|
+
}
|
|
14553
|
+
}
|
|
14554
|
+
|
|
14555
|
+
// The engine lives in its own chunk with its own copy of this module, so an `instanceof`
|
|
14556
|
+
// check in E-v1 would never match; recognise the error by name instead.
|
|
14557
|
+
const isAlphaVideoUnavailableError = error => {
|
|
14558
|
+
return error instanceof Error && error.name === ALPHA_VIDEO_UNAVAILABLE;
|
|
14559
|
+
};
|
|
14560
|
+
|
|
14561
|
+
/***/ },
|
|
14562
|
+
|
|
14304
14563
|
/***/ 9804
|
|
14305
14564
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
14306
14565
|
|
|
@@ -14633,35 +14892,36 @@ var __webpack_exports__ = {};
|
|
|
14633
14892
|
/* harmony import */ var _hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2721);
|
|
14634
14893
|
/* harmony import */ var _utilities_constants_ts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1512);
|
|
14635
14894
|
/* 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
|
|
14895
|
+
/* harmony import */ var _media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4138);
|
|
14896
|
+
/* harmony import */ var _appHostname_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(787);
|
|
14897
|
+
/* harmony import */ var _utilities_assets_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7209);
|
|
14898
|
+
/* harmony import */ var _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7323);
|
|
14899
|
+
/* harmony import */ var _utilities_detect_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7231);
|
|
14900
|
+
/* harmony import */ var _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7157);
|
|
14901
|
+
/* harmony import */ var _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3280);
|
|
14902
|
+
/* harmony import */ var _utilities_elem_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7715);
|
|
14903
|
+
/* harmony import */ var _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(2760);
|
|
14904
|
+
/* harmony import */ var _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(3832);
|
|
14905
|
+
/* harmony import */ var _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(5857);
|
|
14906
|
+
/* harmony import */ var _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(5393);
|
|
14907
|
+
/* harmony import */ var _utilities_judy_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(438);
|
|
14908
|
+
/* harmony import */ var _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(3123);
|
|
14909
|
+
/* harmony import */ var _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(1248);
|
|
14910
|
+
/* harmony import */ var _utilities_seqid_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(1224);
|
|
14911
|
+
/* harmony import */ var _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(7211);
|
|
14912
|
+
/* harmony import */ var _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(1161);
|
|
14913
|
+
/* harmony import */ var _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(4755);
|
|
14914
|
+
/* harmony import */ var _utilities_url_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2671);
|
|
14915
|
+
/* harmony import */ var _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(4997);
|
|
14916
|
+
/* harmony import */ var _utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(9392);
|
|
14917
|
+
/* harmony import */ var _utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(541);
|
|
14918
|
+
/* harmony import */ var _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(6637);
|
|
14919
|
+
/* harmony import */ var _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(2147);
|
|
14920
|
+
/* harmony import */ var _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(5833);
|
|
14921
|
+
/* harmony import */ var _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(959);
|
|
14922
|
+
/* harmony import */ var _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(3411);
|
|
14923
|
+
/* harmony import */ var _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(4989);
|
|
14924
|
+
/* harmony import */ var _types_gradient_ts__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(7350);
|
|
14665
14925
|
var _WistiaPlayer;
|
|
14666
14926
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
14667
14927
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
@@ -14709,6 +14969,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
|
|
|
14709
14969
|
|
|
14710
14970
|
|
|
14711
14971
|
|
|
14972
|
+
|
|
14712
14973
|
|
|
14713
14974
|
|
|
14714
14975
|
// The component will not run without these attributes.
|
|
@@ -14783,7 +15044,7 @@ const defaultEmbedOptions = {
|
|
|
14783
15044
|
* @returns {string}
|
|
14784
15045
|
*/
|
|
14785
15046
|
const getSwatchUrl = (mediaId, embedHost = '') => {
|
|
14786
|
-
const fastHost = (0,
|
|
15047
|
+
const fastHost = (0,_utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__/* .cdnFastWistiaComHost */ .CX)(embedHost);
|
|
14787
15048
|
return `https://${fastHost}/embed/medias/${mediaId}/swatch`;
|
|
14788
15049
|
};
|
|
14789
15050
|
const PRELOAD_CLICK_OPTIONS = {
|
|
@@ -14851,11 +15112,11 @@ class WistiaPlayer extends HTMLElement {
|
|
|
14851
15112
|
_classPrivateFieldInitSpec(this, _playPending, false);
|
|
14852
15113
|
_classPrivateFieldInitSpec(this, _preactRoot, null);
|
|
14853
15114
|
_classPrivateFieldInitSpec(this, _preloadThumbnailRoot, null);
|
|
14854
|
-
_classPrivateFieldInitSpec(this, _publicApiScript, (0,
|
|
15115
|
+
_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
15116
|
_classPrivateFieldInitSpec(this, _resizeObserver, null);
|
|
14856
15117
|
_classPrivateFieldInitSpec(this, _handleAfterReplace, () => {
|
|
14857
15118
|
_assertClassBrand(_WistiaPlayer_brand, this, _maybeInjectJsonLd).call(this);
|
|
14858
|
-
(0,
|
|
15119
|
+
(0,_utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__/* .setEmbedOptionStore */ .gY)(`__${this.uniqueId}_dom_options__`, _classPrivateFieldGet(_playerData, this).embedOptions);
|
|
14859
15120
|
});
|
|
14860
15121
|
_classPrivateFieldInitSpec(this, _handleBeforeReplace, event => {
|
|
14861
15122
|
/**
|
|
@@ -14910,7 +15171,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
14910
15171
|
this.paddingTop = getComputedStyle(this).paddingTop;
|
|
14911
15172
|
|
|
14912
15173
|
// Set up a prefixed logger
|
|
14913
|
-
_classPrivateFieldSet(_logger, this,
|
|
15174
|
+
_classPrivateFieldSet(_logger, this, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_31__/* .wlog */ .ct.getPrefixedFunctions('WistiaPlayer'));
|
|
14914
15175
|
_classPrivateFieldSet(_playerData, this, new _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_7__/* .PlayerDataHandler */ .I());
|
|
14915
15176
|
|
|
14916
15177
|
// Wistia global setup if this is the first time we've seen a Wistia player
|
|
@@ -14978,7 +15239,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
14978
15239
|
_assertClassBrand(_WistiaPlayer_brand, this, _setSyncedEmbedOption).call(this, 'aspect', newAspect);
|
|
14979
15240
|
|
|
14980
15241
|
// By re-setting width to the same value, we trigger the aspect ratio to be recalculated.
|
|
14981
|
-
_classPrivateFieldGet(_impl, this)?.width((0,
|
|
15242
|
+
_classPrivateFieldGet(_impl, this)?.width((0,_utilities_elem_js__WEBPACK_IMPORTED_MODULE_15__/* .elemWidth */ .cG)(this), {
|
|
14982
15243
|
constrain: true
|
|
14983
15244
|
});
|
|
14984
15245
|
}
|
|
@@ -15121,7 +15382,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15121
15382
|
return _classPrivateFieldGet(_api, this)?.captionsLanguageCode() ?? _assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this).wistiaLanguageCode;
|
|
15122
15383
|
}
|
|
15123
15384
|
get captionsLanguages() {
|
|
15124
|
-
|
|
15385
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
15386
|
+
return [_assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this)];
|
|
15387
|
+
}
|
|
15388
|
+
return (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .getCaptionsLanguages */ .RJ)(_classPrivateFieldGet(_playerData, this).mediaData);
|
|
15125
15389
|
}
|
|
15126
15390
|
|
|
15127
15391
|
/**
|
|
@@ -15307,7 +15571,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15307
15571
|
// the public api doesn't allow for unsetting an email, so we don't wan to allow the setter
|
|
15308
15572
|
// eslint-disable-next-line @typescript-eslint/related-getter-setter-pairs
|
|
15309
15573
|
get email() {
|
|
15310
|
-
return (0,
|
|
15574
|
+
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
15575
|
}
|
|
15312
15576
|
|
|
15313
15577
|
/**
|
|
@@ -15477,7 +15741,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15477
15741
|
_classPrivateFieldGet(_api, this)?.language(language);
|
|
15478
15742
|
}
|
|
15479
15743
|
get languages() {
|
|
15480
|
-
|
|
15744
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
15745
|
+
return [_assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this)];
|
|
15746
|
+
}
|
|
15747
|
+
return (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .getLanguages */ .kG)(_classPrivateFieldGet(_playerData, this).mediaData);
|
|
15481
15748
|
}
|
|
15482
15749
|
|
|
15483
15750
|
/**
|
|
@@ -15539,7 +15806,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15539
15806
|
* @returns {Localization[]}
|
|
15540
15807
|
*/
|
|
15541
15808
|
get mediaLanguages() {
|
|
15542
|
-
|
|
15809
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
15810
|
+
return [_assertClassBrand(_WistiaPlayer_brand, this, _defaultLocalization).call(this)];
|
|
15811
|
+
}
|
|
15812
|
+
return (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .getMediaLanguages */ .my)(_classPrivateFieldGet(_playerData, this).mediaData);
|
|
15543
15813
|
}
|
|
15544
15814
|
|
|
15545
15815
|
/**
|
|
@@ -15721,7 +15991,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15721
15991
|
*/
|
|
15722
15992
|
get playerColorGradient() {
|
|
15723
15993
|
const value = _assertClassBrand(_WistiaPlayer_brand, this, _getSyncedEmbedOption).call(this, 'playerColorGradient');
|
|
15724
|
-
if ((0,
|
|
15994
|
+
if ((0,_types_gradient_ts__WEBPACK_IMPORTED_MODULE_37__/* .isGradient */ .b)(value)) {
|
|
15725
15995
|
return value;
|
|
15726
15996
|
}
|
|
15727
15997
|
return undefined;
|
|
@@ -15733,7 +16003,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
15733
16003
|
* @returns {void}
|
|
15734
16004
|
*/
|
|
15735
16005
|
set playerColorGradient(gradient) {
|
|
15736
|
-
if (!(0,
|
|
16006
|
+
if (!(0,_types_gradient_ts__WEBPACK_IMPORTED_MODULE_37__/* .isGradient */ .b)(gradient)) {
|
|
15737
16007
|
throw new Error('playerColorGradient must be a valid gradient object');
|
|
15738
16008
|
}
|
|
15739
16009
|
_classPrivateFieldGet(_impl, this)?.playerColorGradient(gradient);
|
|
@@ -16712,9 +16982,9 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16712
16982
|
if (detail.context === context) {
|
|
16713
16983
|
resolve();
|
|
16714
16984
|
}
|
|
16715
|
-
this.removeEventListener(
|
|
16985
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INPUT_CONTEXT_CHANGE_EVENT */ .ve, handler);
|
|
16716
16986
|
};
|
|
16717
|
-
this.addEventListener(
|
|
16987
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INPUT_CONTEXT_CHANGE_EVENT */ .ve, handler);
|
|
16718
16988
|
_classPrivateFieldGet(_impl, this)?.enterInputContext(context);
|
|
16719
16989
|
});
|
|
16720
16990
|
}
|
|
@@ -16735,7 +17005,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16735
17005
|
* @returns {Promise<MediaData | MediaDataServerErrorResponse>} The media data or error response
|
|
16736
17006
|
*/
|
|
16737
17007
|
async getInitialMediaData(mediaId, options) {
|
|
16738
|
-
return (0,
|
|
17008
|
+
return (0,_utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_33__/* .getInitialMediaData */ .n)(mediaId, options);
|
|
16739
17009
|
}
|
|
16740
17010
|
|
|
16741
17011
|
/**
|
|
@@ -16766,7 +17036,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16766
17036
|
_classPrivateFieldSet(_cachedRemapTime, this, (_fromLanguage, _toLanguage, fromTime) => fromTime);
|
|
16767
17037
|
return _classPrivateFieldGet(_cachedRemapTime, this);
|
|
16768
17038
|
}
|
|
16769
|
-
_classPrivateFieldGet(_cachedRemapTime, this) ?? _classPrivateFieldSet(_cachedRemapTime, this, await (0,
|
|
17039
|
+
_classPrivateFieldGet(_cachedRemapTime, this) ?? _classPrivateFieldSet(_cachedRemapTime, this, await (0,_utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_13__/* .dynamicImport */ .$)('assets/external/timeMapping.js').then(({
|
|
16770
17040
|
remapTime
|
|
16771
17041
|
}) => (fromLanguage, toLanguage, fromTime) => {
|
|
16772
17042
|
const fromTimeInMilliseconds = fromTime * 1000;
|
|
@@ -16808,10 +17078,15 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16808
17078
|
});
|
|
16809
17079
|
}
|
|
16810
17080
|
languagesToLocalizations(languages) {
|
|
16811
|
-
|
|
17081
|
+
if (!_classPrivateFieldGet(_playerData, this).hasMediaData) {
|
|
17082
|
+
return [];
|
|
17083
|
+
}
|
|
17084
|
+
|
|
17085
|
+
// As in PublicApi, languages without a localization map to undefined
|
|
17086
|
+
return languages.map(language => (0,_media_modules_publicApiHelpers_languageHelpers_ts__WEBPACK_IMPORTED_MODULE_8__/* .languageToLocalization */ .rK)(_classPrivateFieldGet(_playerData, this).mediaData, language));
|
|
16812
17087
|
}
|
|
16813
17088
|
languageToLocalization(language) {
|
|
16814
|
-
return _classPrivateFieldGet(
|
|
17089
|
+
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
17090
|
}
|
|
16816
17091
|
|
|
16817
17092
|
/**
|
|
@@ -16894,12 +17169,12 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16894
17169
|
if (!_classPrivateFieldGet(_api, this)) {
|
|
16895
17170
|
reject(new Error('api not ready to replace'));
|
|
16896
17171
|
}
|
|
16897
|
-
(0,
|
|
17172
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .removeInjectedJsonLd */ .Z)(_classPrivateFieldGet(_jsonLdId, this));
|
|
16898
17173
|
const handleAfterReplace = () => {
|
|
16899
|
-
this.removeEventListener(
|
|
17174
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, handleAfterReplace);
|
|
16900
17175
|
resolve();
|
|
16901
17176
|
};
|
|
16902
|
-
this.addEventListener(
|
|
17177
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, handleAfterReplace);
|
|
16903
17178
|
_classPrivateFieldGet(_api, this)?.replaceWith(mediaId, options);
|
|
16904
17179
|
});
|
|
16905
17180
|
}
|
|
@@ -16969,10 +17244,10 @@ class WistiaPlayer extends HTMLElement {
|
|
|
16969
17244
|
});
|
|
16970
17245
|
}
|
|
16971
17246
|
const handler = () => {
|
|
16972
|
-
this.removeEventListener(
|
|
17247
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .API_READY_EVENT */ .c5, handler);
|
|
16973
17248
|
resolve();
|
|
16974
17249
|
};
|
|
16975
|
-
this.addEventListener(
|
|
17250
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .API_READY_EVENT */ .c5, handler);
|
|
16976
17251
|
});
|
|
16977
17252
|
}
|
|
16978
17253
|
async whenControlMounted(handle) {
|
|
@@ -17030,7 +17305,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17030
17305
|
|
|
17031
17306
|
// Attribute names must match their corresponding property names (kebab-case -> camelCase)
|
|
17032
17307
|
// So the player-color attribute maps to the playerColor property
|
|
17033
|
-
this[(0,
|
|
17308
|
+
this[(0,_utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_36__/* .kebabCaseToCamelCase */ .b)(name)] = finalValue;
|
|
17034
17309
|
}
|
|
17035
17310
|
connectedCallback() {
|
|
17036
17311
|
if (_classPrivateFieldGet(_hasElementConnectedToDOM, this)) {
|
|
@@ -17039,27 +17314,27 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17039
17314
|
_classPrivateFieldSet(_hasElementConnectedToDOM, this, true);
|
|
17040
17315
|
const mediaId = this.getAttribute('media-id');
|
|
17041
17316
|
if (mediaId == null) {
|
|
17042
|
-
(0,
|
|
17317
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/failure/init-failed');
|
|
17043
17318
|
throw new Error('media-id attribute is required');
|
|
17044
17319
|
}
|
|
17045
17320
|
|
|
17046
17321
|
// Allows for all bulk setting of embed options and mediaData
|
|
17047
17322
|
window.wistiaOptions = window.wistiaOptions ?? {};
|
|
17048
|
-
const opts = (0,
|
|
17323
|
+
const opts = (0,_utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_29__/* .getWistiaOptions */ .C)(this.mediaId);
|
|
17049
17324
|
_classPrivateFieldGet(_playerData, this).setWistiaWindowEmbedOptionSource(opts);
|
|
17050
17325
|
|
|
17051
17326
|
// Add the media id to the logger now that we have it
|
|
17052
|
-
_classPrivateFieldSet(_logger, this,
|
|
17053
|
-
_classPrivateFieldSet(_judyContext, this, (0,
|
|
17327
|
+
_classPrivateFieldSet(_logger, this, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_31__/* .wlog */ .ct.getPrefixedFunctions(`WistiaPlayer ${mediaId}`));
|
|
17328
|
+
_classPrivateFieldSet(_judyContext, this, (0,_utilities_judy_js__WEBPACK_IMPORTED_MODULE_20__/* .buildContext */ .gC)());
|
|
17054
17329
|
|
|
17055
17330
|
// If the player was created from our React wrapper component, send a tracking event
|
|
17056
17331
|
if (this.getAttribute('react') === 'true') {
|
|
17057
|
-
(0,
|
|
17332
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/initembed.react');
|
|
17058
17333
|
}
|
|
17059
17334
|
_assertClassBrand(_WistiaPlayer_brand, this, _setupEventListeners).call(this);
|
|
17060
17335
|
_classPrivateFieldGet(_logger, this).info('initialize embed');
|
|
17061
17336
|
if (!this.useWebComponent) {
|
|
17062
|
-
(0,
|
|
17337
|
+
(0,_utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_30__/* .maybeStartWistiaQueue */ .z)();
|
|
17063
17338
|
}
|
|
17064
17339
|
|
|
17065
17340
|
// Generate a unique id for this embed in case there are
|
|
@@ -17083,9 +17358,9 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17083
17358
|
overrideMediaLanguage: this.embedOptions.language
|
|
17084
17359
|
};
|
|
17085
17360
|
this.getInitialMediaData(mediaId, optsForFetch).then(mediaDataOrError => {
|
|
17086
|
-
if ((0,
|
|
17361
|
+
if ((0,_utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__/* .isMediaDataError */ .V)(mediaDataOrError)) {
|
|
17087
17362
|
if (mediaDataOrError.iframe === true || mediaDataOrError.iframe === 'true') {
|
|
17088
|
-
const baseUrl = `${(0,
|
|
17363
|
+
const baseUrl = `${(0,_utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__/* .eV1Protocol */ .v9)()}//${(0,_utilities_hosts_js__WEBPACK_IMPORTED_MODULE_18__/* .eV1HostWithPort */ .aY)()}`;
|
|
17089
17364
|
this.style.display = 'block';
|
|
17090
17365
|
|
|
17091
17366
|
// Check if width is already set via CSS or attributes
|
|
@@ -17104,7 +17379,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17104
17379
|
const mediaData = mediaDataOrError;
|
|
17105
17380
|
this.mediaId = mediaData.hashedId ?? this.mediaId;
|
|
17106
17381
|
_classPrivateFieldGet(_playerData, this).setMediaDataSource(mediaData);
|
|
17107
|
-
this.dispatchEvent(new CustomEvent(
|
|
17382
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .LOADED_MEDIA_DATA_EVENT */ .rO, {
|
|
17108
17383
|
detail: {
|
|
17109
17384
|
mediaData: _classPrivateFieldGet(_playerData, this).mediaData
|
|
17110
17385
|
}
|
|
@@ -17117,7 +17392,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17117
17392
|
mediaData: _classPrivateFieldGet(_playerData, this).mediaData
|
|
17118
17393
|
});
|
|
17119
17394
|
}).catch(error => {
|
|
17120
|
-
(0,
|
|
17395
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/failure/init-failed');
|
|
17121
17396
|
throw new Error(error.message);
|
|
17122
17397
|
});
|
|
17123
17398
|
|
|
@@ -17142,11 +17417,11 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17142
17417
|
_classPrivateFieldGet(_removeEventListeners, this).forEach(removeListener => removeListener());
|
|
17143
17418
|
this.removeAllEventListeners();
|
|
17144
17419
|
_classPrivateFieldSet(_eventListeners, this, {});
|
|
17145
|
-
(0,
|
|
17146
|
-
(0,
|
|
17420
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .removeInjectedJsonLd */ .Z)(_classPrivateFieldGet(_jsonLdId, this));
|
|
17421
|
+
(0,_utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_35__/* .uncacheMediaData */ .s3)(this.mediaId);
|
|
17147
17422
|
_classPrivateFieldGet(_resizeObserver, this)?.disconnect();
|
|
17148
17423
|
_classPrivateFieldSet(_resizeObserver, this, null);
|
|
17149
|
-
(0,
|
|
17424
|
+
(0,_utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__/* .removeEmbedOptionStore */ .iU)(`__${this.uniqueId}_dom_options__`);
|
|
17150
17425
|
_classPrivateFieldGet(_api, this)?.remove();
|
|
17151
17426
|
_classPrivateFieldSet(_api, this, null);
|
|
17152
17427
|
_assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
|
|
@@ -17167,7 +17442,7 @@ class WistiaPlayer extends HTMLElement {
|
|
|
17167
17442
|
*/
|
|
17168
17443
|
_WistiaPlayer = WistiaPlayer;
|
|
17169
17444
|
function _get_pageUrl(_this) {
|
|
17170
|
-
return _this.getAttribute('page-url') ?? (0,
|
|
17445
|
+
return _this.getAttribute('page-url') ?? (0,_utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_19__/* .inferPageUrl */ .H)();
|
|
17171
17446
|
}
|
|
17172
17447
|
function _defaultLocalization() {
|
|
17173
17448
|
return {
|
|
@@ -17241,7 +17516,7 @@ function _findLocalizationByLanguage(language) {
|
|
|
17241
17516
|
*/
|
|
17242
17517
|
function _generateUniqueId(mediaId) {
|
|
17243
17518
|
const prefix = `wistia-${mediaId}-`;
|
|
17244
|
-
return (0,
|
|
17519
|
+
return (0,_utilities_seqid_js__WEBPACK_IMPORTED_MODULE_23__/* .seqId */ .h)(prefix);
|
|
17245
17520
|
}
|
|
17246
17521
|
/**
|
|
17247
17522
|
* Returns either the value of an embed option from the public api
|
|
@@ -17262,7 +17537,7 @@ function _getSyncedEmbedOption(key) {
|
|
|
17262
17537
|
|
|
17263
17538
|
// Otherwise check this element's embed config for a value and fallback
|
|
17264
17539
|
// to the default embed options as a last resort
|
|
17265
|
-
return this.embedOptions[key] ?? _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, (0,
|
|
17540
|
+
return this.embedOptions[key] ?? _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, (0,_utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_36__/* .camelCaseToKebabCase */ .$)(key)) ?? defaultEmbedOptions[key];
|
|
17266
17541
|
}
|
|
17267
17542
|
/**
|
|
17268
17543
|
* Gets the value of an attribute if it exists, returns null if not
|
|
@@ -17303,8 +17578,8 @@ function _initPlayerEmbed({
|
|
|
17303
17578
|
_classPrivateFieldGet(_playerData, this).updateEmbedOptionOverrides({
|
|
17304
17579
|
videoFoam: true
|
|
17305
17580
|
});
|
|
17306
|
-
if (mediaData && !(0,
|
|
17307
|
-
_classPrivateFieldSet(_playerType, this, (0,
|
|
17581
|
+
if (mediaData && !(0,_utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__/* .isMediaDataError */ .V)(mediaData)) {
|
|
17582
|
+
_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
17583
|
_assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
|
|
17309
17584
|
_assertClassBrand(_WistiaPlayer_brand, this, _maybeInjectJsonLd).call(this);
|
|
17310
17585
|
}
|
|
@@ -17328,7 +17603,7 @@ async function _initPublicApi(mediaId, options) {
|
|
|
17328
17603
|
// Import the public api script
|
|
17329
17604
|
await _classPrivateFieldGet(_publicApiScript, this);
|
|
17330
17605
|
if (!_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__/* .Wistia */ .s.PublicApi) {
|
|
17331
|
-
(0,
|
|
17606
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/failure/init-failed');
|
|
17332
17607
|
throw new Error('Wistia.PublicApi is not defined');
|
|
17333
17608
|
}
|
|
17334
17609
|
const embeddedCallback = () => {
|
|
@@ -17346,16 +17621,16 @@ async function _initPublicApi(mediaId, options) {
|
|
|
17346
17621
|
// Initialize!
|
|
17347
17622
|
_classPrivateFieldSet(_api, this, new _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_3__/* .Wistia */ .s.PublicApi(mediaId, options));
|
|
17348
17623
|
// internal: lets the TranslationApi attach legacy bindings made before the api existed
|
|
17349
|
-
this.dispatchEvent(new CustomEvent(
|
|
17624
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INTERNAL_API_CREATED_EVENT */ .jQ, {
|
|
17350
17625
|
detail: {
|
|
17351
17626
|
mediaId
|
|
17352
17627
|
}
|
|
17353
17628
|
}));
|
|
17354
|
-
this.addEventListener(
|
|
17355
|
-
this.addEventListener(
|
|
17629
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .BEFORE_REPLACE_EVENT */ .kY, _classPrivateFieldGet(_handleBeforeReplace, this));
|
|
17630
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, _classPrivateFieldGet(_handleAfterReplace, this));
|
|
17356
17631
|
_classPrivateFieldGet(_removeEventListeners, this).push(() => {
|
|
17357
|
-
this.removeEventListener(
|
|
17358
|
-
this.removeEventListener(
|
|
17632
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .BEFORE_REPLACE_EVENT */ .kY, _classPrivateFieldGet(_handleBeforeReplace, this));
|
|
17633
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .AFTER_REPLACE_EVENT */ .$1, _classPrivateFieldGet(_handleAfterReplace, this));
|
|
17359
17634
|
});
|
|
17360
17635
|
_classPrivateFieldGet(_api, this).ready(() => {
|
|
17361
17636
|
_classPrivateFieldGet(_resizeObserver, this)?.disconnect();
|
|
@@ -17363,14 +17638,14 @@ async function _initPublicApi(mediaId, options) {
|
|
|
17363
17638
|
_assertClassBrand(_WistiaPlayer_brand, this, _destroyPreloadThumbnailRoot).call(this);
|
|
17364
17639
|
this.removeEventListener('click', _classPrivateFieldGet(_handlePreloadThumbnailClick, this), PRELOAD_CLICK_OPTIONS);
|
|
17365
17640
|
// event for public consumption, exposed on our event types
|
|
17366
|
-
this.dispatchEvent(new CustomEvent(
|
|
17641
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .API_READY_EVENT */ .c5, {
|
|
17367
17642
|
detail: {
|
|
17368
17643
|
mediaId
|
|
17369
17644
|
}
|
|
17370
17645
|
}));
|
|
17371
17646
|
|
|
17372
17647
|
// event for internal consumption, not exposed on our event types
|
|
17373
|
-
this.dispatchEvent(new CustomEvent(
|
|
17648
|
+
this.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .INTERNAL_API_ON_FIND_EVENT */ .iP, {
|
|
17374
17649
|
detail: {
|
|
17375
17650
|
mediaId,
|
|
17376
17651
|
api: _classPrivateFieldGet(_api, this)
|
|
@@ -17407,12 +17682,12 @@ async function _maybeInitializeMux() {
|
|
|
17407
17682
|
if (!_classPrivateFieldGet(_api, this)) {
|
|
17408
17683
|
return;
|
|
17409
17684
|
}
|
|
17410
|
-
const shouldRandomEnableMux = (0,
|
|
17411
|
-
const shouldEnableMuxForPlayer = (0,
|
|
17685
|
+
const shouldRandomEnableMux = (0,_utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_11__/* .didWinCoinFlip */ .k)(_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_24__/* .MUX_PERCENTAGE_TO_ENABLE */ ._);
|
|
17686
|
+
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
17687
|
const embedType = this.useWebComponent ? 'translated-web-component' : 'web-component';
|
|
17413
17688
|
if (shouldEnableMuxForPlayer) {
|
|
17414
17689
|
try {
|
|
17415
|
-
const mux = await (0,
|
|
17690
|
+
const mux = await (0,_utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_13__/* .dynamicImport */ .$)('assets/external/wistia-mux.js');
|
|
17416
17691
|
mux.init(_classPrivateFieldGet(_api, this), {
|
|
17417
17692
|
embedType
|
|
17418
17693
|
});
|
|
@@ -17435,8 +17710,8 @@ async function _maybeInitializeMux() {
|
|
|
17435
17710
|
function _maybeInjectJsonLd() {
|
|
17436
17711
|
if (this.seo && _classPrivateFieldGet(_playerType, this) !== 'notplayable' && _classPrivateFieldGet(_playerType, this) !== 'passwordprotected' && _classPrivateFieldGet(_playerType, this) !== 'carouselHardWall') {
|
|
17437
17712
|
_classPrivateFieldSet(_jsonLdId, this, `w-json-ld-${this.uniqueId}`);
|
|
17438
|
-
(0,
|
|
17439
|
-
(0,
|
|
17713
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .removeInjectedJsonLd */ .Z)(_classPrivateFieldGet(_jsonLdId, this));
|
|
17714
|
+
(0,_utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_32__/* .injectJsonLd */ .g)(_classPrivateFieldGet(_jsonLdId, this), _classPrivateFieldGet(_playerData, this).mediaData, {
|
|
17440
17715
|
embedOptions: _classPrivateFieldGet(_playerData, this).embedOptions,
|
|
17441
17716
|
videoHeight: this.offsetHeight,
|
|
17442
17717
|
videoWidth: this.offsetWidth
|
|
@@ -17463,7 +17738,7 @@ function _maybeSetupLLMOptimizedEmbed() {
|
|
|
17463
17738
|
if (!preloadTranscriptForLLMEmbed) {
|
|
17464
17739
|
return;
|
|
17465
17740
|
}
|
|
17466
|
-
(0,
|
|
17741
|
+
(0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_25__/* .countMetric */ .WO)('player/initembed.llm-optimized', 1, {
|
|
17467
17742
|
href: window.location.href,
|
|
17468
17743
|
mediaId: this.mediaId
|
|
17469
17744
|
});
|
|
@@ -17486,7 +17761,7 @@ function _renderEmbedTemplate() {
|
|
|
17486
17761
|
if (parseFloat(_classPrivateFieldGet(_paddingTop, this)) !== 0 && _classPrivateFieldGet(_paddingTop, this) !== '') {
|
|
17487
17762
|
swatchHeight = `${parseFloat(_classPrivateFieldGet(_paddingTop, this))}px`;
|
|
17488
17763
|
}
|
|
17489
|
-
const playerBorderRadius = (0,
|
|
17764
|
+
const playerBorderRadius = (0,_utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_21__/* .getDefaultPlayerBorderRadius */ .JA)({
|
|
17490
17765
|
playerBorderRadius: this.playerBorderRadius,
|
|
17491
17766
|
roundedPlayer: this.roundedPlayer
|
|
17492
17767
|
});
|
|
@@ -17559,7 +17834,7 @@ function _renderPreloadThumbnail() {
|
|
|
17559
17834
|
if (carouselHardWall) {
|
|
17560
17835
|
return;
|
|
17561
17836
|
}
|
|
17562
|
-
const thumbnailAssets = (0,
|
|
17837
|
+
const thumbnailAssets = (0,_utilities_assets_js__WEBPACK_IMPORTED_MODULE_10__/* .thumbnailAssets */ .Q0)(assets, {});
|
|
17563
17838
|
const shouldRenderThumbnail = (!this.wistiaPopover || _assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this)) && mediaType !== 'Audio' && thumbnailAssets.length > 0;
|
|
17564
17839
|
if (!shouldRenderThumbnail) {
|
|
17565
17840
|
return;
|
|
@@ -17601,7 +17876,7 @@ function _runMethodsFromAttributes() {
|
|
|
17601
17876
|
this.whenApiReady().then(() => {
|
|
17602
17877
|
const newTime = Number(_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, 'current-time'));
|
|
17603
17878
|
const isClosedPopover = (_classPrivateFieldGet(_api, this)?.popover && !_classPrivateFieldGet(_api, this).popover.isVisible()) ?? false;
|
|
17604
|
-
const isMobile = (0,
|
|
17879
|
+
const isMobile = (0,_utilities_detect_js__WEBPACK_IMPORTED_MODULE_12__/* .detectIsMobile */ .GS)();
|
|
17605
17880
|
const shouldDelayUntilPlay = this.state !== 'playing' && (isMobile || isClosedPopover);
|
|
17606
17881
|
void _classPrivateFieldGet(_impl, this)?.time(newTime, {
|
|
17607
17882
|
lazy: shouldDelayUntilPlay
|
|
@@ -17630,11 +17905,11 @@ function _runMethodsFromAttributes() {
|
|
|
17630
17905
|
* @private
|
|
17631
17906
|
*/
|
|
17632
17907
|
function _saveInitialAttributesFromDomOptions() {
|
|
17633
|
-
const domOptions = Object.fromEntries(Object.entries(this.attributes).map(([, value]) => [(0,
|
|
17908
|
+
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
17909
|
_classPrivateFieldGet(_playerData, this).setDomEmbedOptionSource(domOptions);
|
|
17635
17910
|
|
|
17636
17911
|
// The public api uses this store when it gathers options from our many different sources
|
|
17637
|
-
(0,
|
|
17912
|
+
(0,_utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_14__/* .setEmbedOptionStore */ .gY)(`__${this.uniqueId}_dom_options__`, _classPrivateFieldGet(_playerData, this).embedOptions);
|
|
17638
17913
|
}
|
|
17639
17914
|
/**
|
|
17640
17915
|
* Takes an object of embed options and sets both the value of an
|
|
@@ -17700,8 +17975,8 @@ function _setupEventListeners() {
|
|
|
17700
17975
|
const implCreatedCallback = event => {
|
|
17701
17976
|
_classPrivateFieldSet(_impl, this, event.detail.impl);
|
|
17702
17977
|
};
|
|
17703
|
-
this.addEventListener(
|
|
17704
|
-
this.addEventListener(
|
|
17978
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .LOADED_MEDIA_DATA_EVENT */ .rO, loadedMediaDataCallback);
|
|
17979
|
+
this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .IMPL_CREATED_EVENT */ .dp, implCreatedCallback);
|
|
17705
17980
|
|
|
17706
17981
|
// Dispatched on this host by the legacy popover code each time the popover
|
|
17707
17982
|
// dialog closes. See #returnFocusToPopoverTrigger.
|
|
@@ -17711,9 +17986,9 @@ function _setupEventListeners() {
|
|
|
17711
17986
|
};
|
|
17712
17987
|
this.addEventListener('popover-thumbnail-ready', popoverThumbnailReadyCallback);
|
|
17713
17988
|
_classPrivateFieldGet(_removeEventListeners, this).push(() => {
|
|
17714
|
-
this.removeEventListener(
|
|
17989
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .LOADED_MEDIA_DATA_EVENT */ .rO, loadedMediaDataCallback);
|
|
17715
17990
|
}, () => {
|
|
17716
|
-
this.removeEventListener(
|
|
17991
|
+
this.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_16__/* .IMPL_CREATED_EVENT */ .dp, implCreatedCallback);
|
|
17717
17992
|
}, () => {
|
|
17718
17993
|
this.removeEventListener('popover-hide', _classPrivateFieldGet(_returnFocusToPopoverTrigger, this));
|
|
17719
17994
|
}, () => {
|
|
@@ -17737,7 +18012,7 @@ function _shouldDisplaySwatch() {
|
|
|
17737
18012
|
* @private
|
|
17738
18013
|
*/
|
|
17739
18014
|
function _updateEmail(email) {
|
|
17740
|
-
(0,
|
|
18015
|
+
(0,_utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_28__/* .updateWistiaLocalStorage */ .$B)(localStorage => {
|
|
17741
18016
|
// eslint-disable-next-line no-param-reassign
|
|
17742
18017
|
localStorage[_classPrivateGetter(_WistiaPlayer_brand, this, _get_pageUrl)] = {
|
|
17743
18018
|
...localStorage[_classPrivateGetter(_WistiaPlayer_brand, this, _get_pageUrl)],
|
|
@@ -17757,13 +18032,13 @@ function _updateEmail(email) {
|
|
|
17757
18032
|
* @private
|
|
17758
18033
|
*/
|
|
17759
18034
|
function _updateMediaData(mediaData) {
|
|
17760
|
-
if ((0,
|
|
18035
|
+
if ((0,_utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_34__/* .isMediaDataError */ .V)(mediaData)) {
|
|
17761
18036
|
// Return early to avoid errors since the rest of the code assumes a
|
|
17762
18037
|
// MediaData object.
|
|
17763
18038
|
return;
|
|
17764
18039
|
}
|
|
17765
18040
|
_classPrivateFieldGet(_playerData, this).setMediaDataSource(mediaData);
|
|
17766
|
-
_classPrivateFieldSet(_playerType, this, (0,
|
|
18041
|
+
_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
18042
|
_assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
|
|
17768
18043
|
}
|
|
17769
18044
|
const getSwatchMetaData = async url => {
|