cloudinary-video-player 3.13.1 → 3.13.2-edge.0

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.
Files changed (73) hide show
  1. package/dist/134.min.js +4 -4
  2. package/dist/309.min.js +3 -3
  3. package/dist/350.min.js +6 -0
  4. package/dist/689.min.js +6 -0
  5. package/dist/adaptive-streaming.js +2 -2
  6. package/dist/adaptive-streaming.min.js +2 -2
  7. package/dist/chapters.js +2 -2
  8. package/dist/chapters.min.js +2 -2
  9. package/dist/cld-player-core.js +2 -2
  10. package/dist/cld-player-core.min.js +2 -2
  11. package/dist/cld-poster-url.js +57 -0
  12. package/dist/cld-poster-url.min.js +6 -0
  13. package/dist/cld-video-player-lazy.js +10 -66
  14. package/dist/cld-video-player-lazy.min.js +3 -3
  15. package/dist/cld-video-player.css +6 -2
  16. package/dist/cld-video-player.js +33 -43
  17. package/dist/cld-video-player.light.js +33 -43
  18. package/dist/cld-video-player.light.min.js +4 -4
  19. package/dist/cld-video-player.min.css +3 -3
  20. package/dist/cld-video-player.min.js +4 -4
  21. package/dist/colors.js +2 -2
  22. package/dist/colors.min.js +2 -2
  23. package/dist/dash.js +2 -2
  24. package/dist/dash.min.js +2 -2
  25. package/dist/debug.js +3 -3
  26. package/dist/debug.min.js +3 -3
  27. package/dist/ima.js +2 -2
  28. package/dist/ima.min.js +2 -2
  29. package/dist/interaction-areas.js +2 -2
  30. package/dist/interaction-areas.min.js +2 -2
  31. package/dist/node_modules_lodash_throttle_js.js +2 -2
  32. package/dist/playlist.js +2 -2
  33. package/dist/playlist.min.js +2 -2
  34. package/dist/{plugins_cloudinary_url-helpers_js-utils_object_js-utils_querystring_js-utils_utf8Base64_js-vi-555007.js → plugins_cloudinary_url-helpers_js-utils_cloudinary-config-from-options_js-utils_querystring_j-adfe37.js} +48 -4
  35. package/dist/recommendations-overlay.js +2 -2
  36. package/dist/recommendations-overlay.min.js +2 -2
  37. package/dist/schema.json +16 -0
  38. package/dist/share.js +2 -2
  39. package/dist/share.min.js +2 -2
  40. package/dist/shoppable.js +2 -2
  41. package/dist/shoppable.min.js +2 -2
  42. package/dist/utils_fetch-config_js.js +3 -3
  43. package/dist/utils_schedule_js.js +27 -0
  44. package/dist/video-player_js.js +9 -9
  45. package/dist/visual-search.js +2 -2
  46. package/dist/visual-search.min.js +2 -2
  47. package/lib/all.js +3 -2
  48. package/lib/chapters.js +2 -2
  49. package/lib/cld-video-player.min.css +3 -3
  50. package/lib/{object.js → cloudinary-config-from-options.js} +10 -2
  51. package/lib/cloudinary-url-prefix.js +91 -0
  52. package/lib/colors.js +2 -2
  53. package/lib/config/configSchema.json +16 -0
  54. package/lib/debug.js +1 -0
  55. package/lib/fetch-config.js +4 -11
  56. package/lib/index.js +3 -2
  57. package/lib/interaction-areas.service.js +2 -2
  58. package/lib/lazy.js +0 -1
  59. package/lib/player-api.js +171 -413
  60. package/lib/player.js +2 -1
  61. package/lib/playlist.js +2 -2
  62. package/lib/poster-url.js +46 -0
  63. package/lib/recommendations-overlay.js +2 -2
  64. package/lib/schedule.js +153 -0
  65. package/lib/share.js +2 -2
  66. package/lib/shoppable-widget.js +2 -2
  67. package/lib/toNumber.js +1 -1
  68. package/lib/video-player.const.js +1 -1
  69. package/lib/video-player.js +17 -9
  70. package/lib/videoPlayer.js +2 -1
  71. package/package.json +1 -1
  72. package/types/cld-video-player.d.ts +6 -0
  73. package/dist/19.min.js +0 -6
@@ -0,0 +1,91 @@
1
+ const LEGACY_CONDITIONAL_OPERATORS = {
2
+ "=": 'eq',
3
+ "!=": 'ne',
4
+ "<": 'lt',
5
+ ">": 'gt',
6
+ "<=": 'lte',
7
+ ">=": 'gte',
8
+ "&&": 'and',
9
+ "||": 'or',
10
+ "*": "mul",
11
+ "/": "div",
12
+ "+": "add",
13
+ "-": "sub",
14
+ "^": "pow"
15
+ };
16
+ const OLD_AKAMAI_SHARED_CDN = "cloudinary-a.akamaihd.net";
17
+ const AKAMAI_SHARED_CDN = "res.cloudinary.com";
18
+ const SHARED_CDN = AKAMAI_SHARED_CDN;
19
+ const LEGACY_PREDEFINED_VARS = {
20
+ "aspect_ratio": "ar",
21
+ "aspectRatio": "ar",
22
+ "current_page": "cp",
23
+ "currentPage": "cp",
24
+ "duration": "du",
25
+ "face_count": "fc",
26
+ "faceCount": "fc",
27
+ "height": "h",
28
+ "initial_aspect_ratio": "iar",
29
+ "initial_height": "ih",
30
+ "initial_width": "iw",
31
+ "initialAspectRatio": "iar",
32
+ "initialHeight": "ih",
33
+ "initialWidth": "iw",
34
+ "initial_duration": "idu",
35
+ "initialDuration": "idu",
36
+ "page_count": "pc",
37
+ "page_x": "px",
38
+ "page_y": "py",
39
+ "pageCount": "pc",
40
+ "pageX": "px",
41
+ "pageY": "py",
42
+ "tags": "tags",
43
+ "width": "w"
44
+ };
45
+ const NUMBER_PATTERN = "([0-9]*)\\.([0-9]+)|([0-9]+)";
46
+ const OFFSET_ANY_PATTERN = `(${NUMBER_PATTERN})([%pP])?`;
47
+ const RANGE_VALUE_RE = RegExp(`^${OFFSET_ANY_PATTERN}$`);
48
+ const OFFSET_ANY_PATTERN_RE = RegExp(`(${OFFSET_ANY_PATTERN})\\.\\.(${OFFSET_ANY_PATTERN})`);
49
+ const LAYER_KEYWORD_PARAMS = {
50
+ font_weight: "normal",
51
+ font_style: "normal",
52
+ text_decoration: "none",
53
+ text_align: '',
54
+ stroke: "none"
55
+ };
56
+
57
+ function unsigned_url_prefix(source, cloud_name, private_cdn, cdn_subdomain, secure_cdn_subdomain, cname, secure, secure_distribution) {
58
+ let prefix;
59
+ if (cloud_name.indexOf("/") === 0) {
60
+ return '/res' + cloud_name;
61
+ }
62
+ let shared_domain = !private_cdn;
63
+ if (secure) {
64
+ if ((secure_distribution == null) || secure_distribution === OLD_AKAMAI_SHARED_CDN) {
65
+ secure_distribution = private_cdn ? cloud_name + "-res.cloudinary.com" : SHARED_CDN;
66
+ }
67
+ if (shared_domain == null) {
68
+ shared_domain = secure_distribution === SHARED_CDN;
69
+ }
70
+ prefix = 'https://' + secure_distribution;
71
+ }
72
+ else if (cname) {
73
+ // let subdomain = cdn_subdomain ? 'a' + ((crc32(source) % 5) + 1) + '.' : '';
74
+ prefix = 'http://' + cname;
75
+ }
76
+ else {
77
+ let cdn_part = private_cdn ? cloud_name + '-' : '';
78
+ let host = [cdn_part, 'res', '.cloudinary.com'].join('');
79
+ prefix = 'http://' + host;
80
+ }
81
+ if (shared_domain) {
82
+ prefix += '/' + cloud_name;
83
+ }
84
+ return prefix;
85
+ }
86
+
87
+ const getCloudinaryUrlPrefix = cloudinaryConfig => {
88
+ return unsigned_url_prefix(null, cloudinaryConfig.cloud_name, cloudinaryConfig.private_cdn, cloudinaryConfig.cdn_subdomain, cloudinaryConfig.secure_cdn_subdomain, cloudinaryConfig.cname, cloudinaryConfig.secure ?? true, cloudinaryConfig.secure_distribution);
89
+ };
90
+
91
+ export { LAYER_KEYWORD_PARAMS as L, OFFSET_ANY_PATTERN_RE as O, RANGE_VALUE_RE as R, LEGACY_CONDITIONAL_OPERATORS as a, LEGACY_PREDEFINED_VARS as b, getCloudinaryUrlPrefix as g, unsigned_url_prefix as u };
package/lib/colors.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { i as isLight } from './video-player.js';
2
2
  import './_videojs-proxy.js';
3
3
  import './_commonjsHelpers.js';
4
- import './object.js';
4
+ import './cloudinary-config-from-options.js';
5
5
  import './video-player.const.js';
6
6
  import './validators-functions.js';
7
- import './player-api.js';
7
+ import './cloudinary-url-prefix.js';
8
8
 
9
9
  const defaults = {
10
10
  colorsDark: {
@@ -578,6 +578,22 @@
578
578
  },
579
579
  "default": {}
580
580
  },
581
+ "lazy": {
582
+ "oneOf": [
583
+ {
584
+ "type": "boolean",
585
+ "default": false
586
+ },
587
+ {
588
+ "type": "object",
589
+ "properties": {
590
+ "loadOnScroll": { "type": "boolean", "default": false }
591
+ },
592
+ "additionalProperties": false
593
+ }
594
+ ],
595
+ "default": false
596
+ },
581
597
  "videoSources": {
582
598
  "type": "array",
583
599
  "items": {
package/lib/debug.js CHANGED
@@ -237,6 +237,7 @@ const playerValidators = {
237
237
  duration: validator.isNumber
238
238
  })
239
239
  },
240
+ lazy: validator.or(validator.isBoolean, validator.isPlainObject),
240
241
  cloudinary: {
241
242
  autoShowRecommendations: validator.isBoolean,
242
243
  sourceTypes: validator.isArrayOfStrings,
@@ -1,7 +1,7 @@
1
- import { i as isRawUrl, a as appendQueryParams, u as utf8ToBase64, p as pick, c as convertKeysToSnakeCase } from './object.js';
2
- import { C as CLOUDINARY_CONFIG_PARAM } from './video-player.const.js';
3
- import { g as getCloudinaryUrlPrefix } from './player-api.js';
1
+ import { g as getCloudinaryConfigFromOptions, i as isRawUrl, a as appendQueryParams, u as utf8ToBase64 } from './cloudinary-config-from-options.js';
2
+ import { g as getCloudinaryUrlPrefix } from './cloudinary-url-prefix.js';
4
3
  import './_commonjsHelpers.js';
4
+ import './video-player.const.js';
5
5
 
6
6
  var dist = {};
7
7
 
@@ -37,13 +37,6 @@ const getDefaultProfileConfig = profileName => {
37
37
  }
38
38
  return profile.config;
39
39
  };
40
- const getCloudinaryConfigFromOptions = options => {
41
- if (options.cloudinaryConfig) {
42
- return options.cloudinaryConfig;
43
- }
44
- const snakeCaseCloudinaryConfig = pick(convertKeysToSnakeCase(options), CLOUDINARY_CONFIG_PARAM);
45
- return Object.assign({}, snakeCaseCloudinaryConfig);
46
- };
47
40
  const fetchConfig = async options => {
48
41
  const {
49
42
  profile,
@@ -58,7 +51,7 @@ const fetchConfig = async options => {
58
51
  const cloudinaryConfig = getCloudinaryConfigFromOptions(options);
59
52
  const urlPrefix = getCloudinaryUrlPrefix(cloudinaryConfig) + '/_applet_/video_service';
60
53
  const queryParams = allowUsageReport ? {
61
- _s: `vp-${"3.13.1"}`
54
+ _s: `vp-${"3.13.2-edge.0"}`
62
55
  } : null;
63
56
  let configUrl;
64
57
  if (profile) {
package/lib/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  export { _ as videojs } from './_videojs-proxy.js';
2
2
  import { n as createPlayerWithConfig, q as createVideoPlayer } from './video-player.js';
3
- import { s as setupCloudinaryGlobal, a as createAsyncPlayer, c as createMultiplePlayers, f as createMultipleSync } from './player-api.js';
3
+ import { s as setupCloudinaryGlobal, a as createAsyncPlayer, c as createMultiplePlayers, b as createMultipleSync } from './player-api.js';
4
4
  import './_commonjsHelpers.js';
5
- import './object.js';
5
+ import './cloudinary-config-from-options.js';
6
6
  import './video-player.const.js';
7
7
  import './validators-functions.js';
8
+ import './cloudinary-url-prefix.js';
8
9
 
9
10
  const videoPlayer = function (id) {
10
11
  let playerOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -5,10 +5,10 @@ import { n as noop } from './noop.js';
5
5
  import { I as INTERACTION_AREA_HAND_ICON, a as INTERACTION_AREAS_PREFIX, b as INTERACTION_AREA_LAYOUT_LOCAL_STORAGE_NAME, c as INTERACTION_AREAS_CONTAINER_CLASS_NAME, d as INTERACTION_AREAS_THEME, C as CLOSE_INTERACTION_AREA_LAYOUT_DELAY, T as TEMPLATE_INTERACTION_AREAS_VTT, D as DEFAULT_INTERACTION_ARE_TRANSITION } from './interaction-areas.const.js';
6
6
  import { getDefaultPlayerColor } from './colors.js';
7
7
  import './_commonjsHelpers.js';
8
- import './object.js';
8
+ import './cloudinary-config-from-options.js';
9
9
  import './video-player.const.js';
10
10
  import './validators-functions.js';
11
- import './player-api.js';
11
+ import './cloudinary-url-prefix.js';
12
12
  import './toNumber.js';
13
13
 
14
14
  const themedButton = _ref => {
package/lib/lazy.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { s as setupCloudinaryGlobal, c as createMultiplePlayers, a as createAsyncPlayer } from './player-api.js';
2
- import './_commonjsHelpers.js';
3
2
 
4
3
  /**
5
4
  * Lazy entry: tiny initial bundle, player core loads on demand.