Skip to content

Commit

Permalink
feat: Add useSVGIcons option (#8260)
Browse files Browse the repository at this point in the history
  • Loading branch information
wseymour15 authored Jun 12, 2023
1 parent 6c4997d commit 6fc0dc7
Show file tree
Hide file tree
Showing 46 changed files with 1,455 additions and 365 deletions.
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

0 comments on commit 6fc0dc7

Please sign in to comment.