Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
556 changes: 348 additions & 208 deletions docs/es-modules/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/es-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"preview": "vite preview"
},
"devDependencies": {
"vite": "^5.2.6"
"vite": "^6.0.2"
}
}
6,787 changes: 2,472 additions & 4,315 deletions package-lock.json

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
],
"exports": {
".": {
"types": "./types/cld-video-player.d.ts",
"import": "./lib/cld-video-player.js",
"require": "./dist/cld-video-player.js",
"types": "./types/cld-video-player.d.ts"
"require": "./dist/cld-video-player.js"
},
"./*": "./lib/*"
},
Expand Down Expand Up @@ -57,76 +57,76 @@
"files": [
{
"path": "./dist/cld-video-player.min.js",
"maxSize": "252kb"
"maxSize": "258kb"
},
{
"path": "./dist/cld-video-player.light.min.js",
"maxSize": "131kb"
"maxSize": "132kb"
},
{
"path": "./lib/cld-video-player.js",
"maxSize": "252kb"
"maxSize": "258kb"
},
{
"path": "./lib/videoPlayer.js",
"maxSize": "252kb"
"maxSize": "258kb"
},
{
"path": "./lib/all.js",
"maxSize": "285kb"
"maxSize": "288kb"
}
]
},
"dependencies": {
"@cloudinary/url-gen": "^1.20.0",
"@cloudinary/url-gen": "^1.21.0",
"cloudinary-video-analytics": "1.7.1",
"cloudinary-video-player-profiles": "1.1.0",
"lodash": "^4.17.21",
"srt-parser-2": "^1.2.3",
"uuid": "^10.0.0",
"video.js": "^8.17.1",
"uuid": "^11.0.3",
"video.js": "^8.20.0",
"videojs-contrib-ads": "^7.5.2",
"videojs-contrib-dash": "^5.1.1",
"videojs-ima": "^2.3.0",
"videojs-per-source-behaviors": "^3.0.1",
"webfontloader": "^1.6.28"
},
"devDependencies": {
"@actions/core": "^1.10.1",
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.25.3",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@commitlint/cli": "^19.6.0",
"@commitlint/config-conventional": "^19.6.0",
"@playwright/test": "1.41.2",
"@types/node": "22.0.2",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"@types/node": "22.10.1",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"babel-loader": "^9.2.1",
"bundlewatch": "^0.4.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"css.escape": "^1.5.1",
"eslint": "^8.57.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-webpack-plugin": "^4.2.0",
"expose-loader": "^5.0.0",
"html-webpack-plugin": "^5.6.0",
"husky": "^9.1.4",
"html-webpack-plugin": "^5.6.3",
"husky": "^9.1.7",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-puppeteer": "^10.0.1",
"mini-css-extract-plugin": "^2.9.0",
"jest-puppeteer": "^10.1.4",
"mini-css-extract-plugin": "^2.9.2",
"puppeteer": "^22.15.0",
"puppeteer-request-spy": "^1.4.0",
"sass": "^1.77.8",
"sass-loader": "^16.0.0",
"sass": "^1.82.0",
"sass-loader": "^16.0.4",
"semver": "^7.6.3",
"shx": "^0.3.4",
"terser-webpack-plugin": "^5.3.10",
Expand All @@ -135,7 +135,7 @@
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-conditional-loader": "^1.0.12",
"webpack-dev-server": "^5.0.4",
"webpack-dev-server": "^5.1.0",
"webpack-merge": "^6.0.1"
}
}
8 changes: 5 additions & 3 deletions src/assets/styles/_icons.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@use "sass:meta";
@use "sass:string";
// https://github.com/sass/sass/issues/659#issuecomment-64819075
@function char($character-code) {
@if function-exists("selector-append") {
@return unquote("\"\\#{$character-code}\"");
@if meta.function-exists("selector-append") {
@return string.unquote("\"\\#{$character-code}\"");
}

@return str-slice("\x", 1, 1) + $character-code;
@return string.slice("\x", 1, 1) + $character-code;
}

$icon-font-family: VideoJS;
Expand Down
13 changes: 7 additions & 6 deletions src/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
$icon-font-path: '../icon-font' !default;

// Video.js overrides
@import 'variables';
@use "sass:meta";
@use 'variables';

// Import Video.js style
@import '~video.root.js/dist/video-js.min.css';
@import 'mixins/skin';
@import 'icons';
@import 'components/loading-button.scss';
@import 'components/text-tracks.scss';
@include meta.load-css('mixins/skin');
@include meta.load-css('icons');
@include meta.load-css('components/loading-button.scss');
@include meta.load-css('components/text-tracks.scss');

.cld-video-player {
// container-type: inline-size;
font-family: $text-font-family;
font-family: variables.$text-font-family;
overflow: hidden;

// The base font size controls the size of everything, not just text.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../assets/styles/mixins/aspect-ratio';
@import '../../assets/styles/mixins/mixins.scss';
@use '../../assets/styles/mixins/aspect-ratio';
@use '../../assets/styles/mixins/mixins.scss';

.vjs-recommendations-overlay {
display: flex;
Expand Down Expand Up @@ -27,7 +27,7 @@
position: relative;
width: 85%;

@include aspect-ratio(16, 9);
@include aspect-ratio.aspect-ratio(16, 9);

.aspect-ratio-content {
display: flex;
Expand Down Expand Up @@ -60,15 +60,15 @@
min-width: 0; // for use with flex and white-space: nowrap

h2 {
@include ellipsis;
@include mixins.ellipsis;
padding: 0 0 0 0;
font-size: 18px;
margin: 0 0 1em 0;
font-weight: 600;
}

h3 {
@include ellipsis;
@include mixins.ellipsis;
padding: 0 0 0 0;
font-size: 20px;
margin: 0 0 1.3em 0;
Expand Down
11 changes: 6 additions & 5 deletions src/plugins/styled-text-tracks/styled-text-tracks.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use "sass:color";
.cld-video-player {

// Gravity (position + alignment)
Expand Down Expand Up @@ -42,12 +43,12 @@
&:has(.cld-styled-text-tracks-theme-3d) ::cue {
$base-size: 0.03em;
$base-color: #ff76ad;
color: lighten($base-color, 40%) !important;
color: color.adjust($base-color, $lightness: 40%) !important;
text-shadow:
#{1*$base-size} #{1*$base-size} 0 darken($base-color, 10%),
#{2*$base-size} #{2*$base-size} 0 darken($base-color, 20%),
#{3*$base-size} #{3*$base-size} 0 darken($base-color, 30%),
#{4*$base-size} #{4*$base-size} 0 darken($base-color, 40%);
#{1*$base-size} #{1*$base-size} 0 color.adjust($base-color, $lightness: -10%),
#{2*$base-size} #{2*$base-size} 0 color.adjust($base-color, $lightness: -20%),
#{3*$base-size} #{3*$base-size} 0 color.adjust($base-color, $lightness: -30%),
#{4*$base-size} #{4*$base-size} 0 color.adjust($base-color, $lightness: -40%);
}

div.vjs-text-track-display.cld-styled-text-tracks-theme-player-colors div.vjs-text-track-cue > div,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/attributes-normalizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function coerce(string) {
// Complex object
try {
val = JSON.parse(string);
} catch (e) {
} catch (e) { // eslint-disable-line no-unused-vars
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would console.warn the error instead of the eslint disable line ... since anyway we have other console.warn statements .... later we need to start thinking how we should report these errors somewhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle I agree, but it seems like in this case the author used try...catch to silence the failing JSON.parse()
I'll try thinking of a better way to write this

// Continue execution in case str is not parsable
}
if (val) {
Expand Down
4 changes: 2 additions & 2 deletions src/video-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class VideoPlayer extends Utils.mixin(Eventable) {
...internalAnalyticsMetadata,
}).toString();
fetch(`${INTERNAL_ANALYTICS_URL}/video_player_source?${analyticsParams}&${baseParams}`);
} catch (e) {
// consider reporting this failure
} catch (err) {
console.warn(err);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/video-player.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const getResolveVideoElement = (elem) => {

try {
elem = document.querySelector(`#${cssEscape(id)}`) || videojs.getPlayer(id);
} catch (e) {
} catch (err) { // eslint-disable-line no-unused-vars
elem = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would console.warn the error instead of the eslint disable line ... since anyway we have other console.warn statements .... later we need to start thinking how we should report these errors somewhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous

}

Expand Down
Loading