Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add useSVGIcons option #8260

Merged
merged 28 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
11862fb
feat: Add useSVGIcons option
wseymour15 May 2, 2023
47f743f
update path to sandbox icons page
wseymour15 May 2, 2023
e9c36e0
update to using inline SVG and setIcon component functionality
wseymour15 May 10, 2023
8ece4f3
add tests and update setIcon calls
wseymour15 May 11, 2023
eb57850
update sandbox page with inline svg
wseymour15 May 11, 2023
79bbc2f
minor documentation updates
wseymour15 May 11, 2023
de322e2
add player example to sandbox
wseymour15 May 11, 2023
cf09d5d
add images to dist directory
wseymour15 May 12, 2023
a898a68
small doc updates and additional test
wseymour15 May 12, 2023
144907a
sandbox fix
wseymour15 May 12, 2023
4997916
move images directory
wseymour15 May 15, 2023
f150ddc
update sandbox and npm commands to build images in dist
wseymour15 May 15, 2023
5039685
update rollup config to include svg sprite as data uri
wseymour15 May 16, 2023
a4352a4
remove images directory from dist
wseymour15 May 17, 2023
a3ff4c9
add images to netlify correctly
wseymour15 May 17, 2023
92a14d8
fix netlify with images
wseymour15 May 17, 2023
d9f1c55
add sprite to dom and use DOMParser
wseymour15 May 23, 2023
20c7835
Merge branch 'main' into feat-add-svg-icons
wseymour15 May 25, 2023
9c52208
make svg icons responsive to font-size
wseymour15 May 26, 2023
4575c88
small doc update for set icon
wseymour15 May 30, 2023
0e465bd
remove unnecessary rollup plugin
wseymour15 May 30, 2023
9c90924
minor style change to volume icons
wseymour15 May 31, 2023
5076cdf
Merge branch 'main' into feat-add-svg-icons
wseymour15 May 31, 2023
c65109b
css update to account for Chinese font sizing
wseymour15 Jun 1, 2023
7643e8f
additional change for chinese sliders
wseymour15 Jun 1, 2023
357adf1
small css change and svg sprite failure fix
wseymour15 Jun 6, 2023
a63a20c
Merge branch 'main' into feat-add-svg-icons
wseymour15 Jun 6, 2023
edd3448
use experimental naming and minor icon improvements
wseymour15 Jun 9, 2023
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Video.js is [licensed][license] under the Apache License, Version 2.0.

[npm-link]: https://nodei.co/npm/video.js/

[options]: docs/guides/options.md
[options]: https://videojs.com/guides/options/

[plugins]: https://videojs.com/plugins/

Expand Down
5 changes: 4 additions & 1 deletion build/netlify.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ sh.rm('-rf', deployDir);
// make sure the directory exists
sh.mkdir('-p', deployDir);

// create sub-directory for images
sh.mkdir('-p', `${deployDir}/src`);

// create nested directories
files
.map((file) => path.dirname(file))
.forEach((dir) => sh.mkdir('-p', path.join(deployDir, dir)));

// copy files/folders to deploy dir
files
.concat('dist', 'index.html', 'sandbox', 'docs')
.concat('dist', 'index.html', 'sandbox', 'docs', 'src/images')
.forEach((file) => sh.cp('-r', file, path.join(deployDir, file)));

sh.rm(path.join(deployDir, 'dist', `video-js-${pkg.version}.zip`));
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ <h2>Navigation</h2>
<li><a href="sandbox/responsive.html">Responsive Demo</a></li>
<li><a href="sandbox/middleware-play.html">Middleware Play Demo</a></li>
<li><a href="sandbox/icons.html">Icons Demo</a></li>
<li><a href="sandbox/svg-icons.html">SVG Icons Directory</a></li>
<li><a href="sandbox/svg-icons-enabled.html">SVG Icons Demo</a></li>
<li><a href="sandbox/focus-visible.html">Focus Visible Demo</a></li>
<li><a href="sandbox/embeds.html">Embeds Demo</a></li>
<li><a href="sandbox/descriptions.html">Descriptions Demo</a></li>
Expand Down
750 changes: 409 additions & 341 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"@babel/core": "^7.9.0",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@rollup/plugin-image": "^3.0.2",
"@rollup/plugin-replace": "^2.4.1",
"@types/node": "^18.8.3",
"access-sniff": "^3.2.0",
Expand Down Expand Up @@ -155,6 +156,7 @@
"rollup-plugin-node-resolve": "^4.2.4",
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-stub": "^1.2.0",
"rollup-plugin-svg": "^2.0.0",
"sass": "^1.34.0",
"semver": "^5.7.0",
"shelljs": "^0.8.5",
Expand Down
10 changes: 10 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import multiEntry from 'rollup-plugin-multi-entry';
import stub from 'rollup-plugin-stub';
import isCI from 'is-ci';
import replace from '@rollup/plugin-replace';
import image from '@rollup/plugin-image';
import istanbul from 'rollup-plugin-istanbul';
import externalGlobals from 'rollup-plugin-external-globals';
import svg from 'rollup-plugin-svg';

const excludeCoverage = [
'test/**',
Expand Down Expand Up @@ -151,6 +153,7 @@ export default cliargs => [
primedExternalGlobals,
primedCjs,
primedBabel,
svg(),
cliargs.progress !== false ? progress() : {}
],
onwarn,
Expand All @@ -176,6 +179,7 @@ export default cliargs => [
primedExternalGlobals,
primedCjs,
primedBabel,
svg(),
cliargs.progress !== false ? progress() : {}
],
onwarn,
Expand All @@ -201,6 +205,7 @@ export default cliargs => [
primedCjs,
CI_TEST_TYPE === 'coverage' ? istanbul({exclude: excludeCoverage}) : {},
primedBabel,
image(),
cliargs.progress !== false ? progress() : {}

],
Expand Down Expand Up @@ -238,6 +243,7 @@ export default cliargs => [
}),
json(),
primedBabel,
svg(),
cliargs.progress !== false ? progress() : {}
],
onwarn,
Expand All @@ -264,6 +270,7 @@ export default cliargs => [
primedExternalGlobals,
primedCjs,
primedBabel,
svg(),
cliargs.progress !== false ? progress() : {}
],
onwarn,
Expand All @@ -289,6 +296,7 @@ export default cliargs => [
plugins: [
json(),
primedBabel,
svg(),
cliargs.progress !== false ? progress() : {}
],
onwarn,
Expand All @@ -311,6 +319,7 @@ export default cliargs => [
primedExternalGlobals,
primedCjs,
primedBabel,
svg(),
cliargs.progress !== false ? progress() : {}
],
onwarn,
Expand All @@ -334,6 +343,7 @@ export default cliargs => [
primedExternalGlobals,
primedCjs,
primedBabel,
svg(),
cliargs.progress !== false ? progress() : {}
],
onwarn,
Expand Down
36 changes: 36 additions & 0 deletions sandbox/svg-icons-enabled.html.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Video.js Sandbox</title>
<link href="../dist/video-js.css" rel="stylesheet" type="text/css">
<script src="../dist/video.js"></script>
</head>
<body>
<div style="background-color:#eee; border: 1px solid #777; padding: 10px; margin-bottom: 20px; font-size: .8em; line-height: 1.5em; font-family: Verdana, sans-serif;">
<p>You can use /sandbox/ for writing and testing your own code. Nothing in /sandbox/ will get checked into the repo, except files that end in .example (so don't edit or add those files). To get started run `npm start` and open the svg-icons-enabled.html</p>
<pre>npm start</pre>
<pre>open http://localhost:9999/sandbox/svg-icons-enabled.html</pre>
</div>

<video-js
id="vid1"
controls
preload="auto"
width="640"
height="264"
poster="https://vjs.zencdn.net/v/oceans.png">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
<source src="https://vjs.zencdn.net/v/oceans.webm" type="video/webm">
<source src="https://vjs.zencdn.net/v/oceans.ogv" type="video/ogg">
<track kind="captions" src="../docs/examples/shared/example-captions.vtt" srclang="en" label="English">
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video-js>

<script>
var vid = document.getElementById('vid1');
var player = videojs(vid, {experimentalSvgIcons: true});
</script>

</body>
</html>
Loading