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

Fix UI for file download and fix bug in quality selector #160

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions docs/build/bundle.4e34def3.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/build/bundle.f2e8d51e.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="rsg-root"></div>
<script src="build/bundle.f2e8d51e.js"></script>
<script src="build/bundle.4e34def3.js"></script>
</body>
</html>
11 changes: 0 additions & 11 deletions public/dev/lunchroom_manners.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,6 @@
}
}
]
},
{
"id": "http://localhost:3000/lunchroom_manners/lunchroom_manners.vtt",
"type": "Text",
"format": "text/vtt",
"label": {
"en": [
"Captions in WebVTT format"
]
},
"language": "en"
}
],
"target": "/dev/lunchroom_manners/canvas/1"
Expand Down
11 changes: 0 additions & 11 deletions public/prod/lunchroom_manners.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@
}
}
]
},
{
"id": "https://iiif-react-media-player.netlify.app/lunchroom_manners/lunchroom_manners.vtt",
"type": "Text",
"format": "text/vtt",
"label": {
"en": [
"Captions in WebVTT format"
]
},
"language": "en"
}
],
"target": "/prod/lunchroom_manners/canvas/1"
Expand Down
22 changes: 11 additions & 11 deletions src/components/MediaPlayer/VideoJSComponents/VideoJSDownloadIcon.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

const VideoJSDownloadIcon = () => {
return (
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 330 330"
style={{ enableBackground: "new 0 0 4 490 490", fill: 'white', height: '1.25rem', scale: '0.9' }}>
<g id="XMLID_23_">
<path id="XMLID_24_" d="M154.389,255.602c0.351,0.351,0.719,0.683,1.103,0.998c0.169,0.138,0.347,0.258,0.52,0.388
const VideoJSDownloadIcon = ({ scale }) => {
return (
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 330 330"
style={{ enableBackground: "new 0 0 4 490 490", fill: 'white', height: '1.25rem', scale: scale }}>
<g id="XMLID_23_">
<path id="XMLID_24_" d="M154.389,255.602c0.351,0.351,0.719,0.683,1.103,0.998c0.169,0.138,0.347,0.258,0.52,0.388
c0.218,0.164,0.432,0.333,0.659,0.484c0.212,0.142,0.432,0.265,0.649,0.395c0.202,0.121,0.4,0.248,0.608,0.359
c0.223,0.12,0.453,0.221,0.681,0.328c0.215,0.102,0.427,0.21,0.648,0.301c0.223,0.092,0.45,0.167,0.676,0.247
c0.236,0.085,0.468,0.175,0.709,0.248c0.226,0.068,0.456,0.119,0.684,0.176c0.246,0.062,0.489,0.131,0.739,0.181
Expand All @@ -18,11 +18,11 @@ const VideoJSDownloadIcon = () => {
c5.858-5.858,5.858-15.355,0-21.213c-5.857-5.857-15.355-5.858-21.213-0.001l-44.396,44.393V25c0-8.284-6.716-15-15-15
c-8.284,0-15,6.716-15,15v183.785l-44.392-44.391c-5.857-5.858-15.355-5.858-21.213,0c-5.858,5.858-5.858,15.355,0,21.213
L154.389,255.602z"/>
<path id="XMLID_25_" d="M315,160c-8.284,0-15,6.716-15,15v115H30V175c0-8.284-6.716-15-15-15c-8.284,0-15,6.716-15,15v130
<path id="XMLID_25_" d="M315,160c-8.284,0-15,6.716-15,15v115H30V175c0-8.284-6.716-15-15-15c-8.284,0-15,6.716-15,15v130
c0,8.284,6.716,15,15,15h300c8.284,0,15-6.716,15-15V175C330,166.716,323.284,160,315,160z"/>
</g>
</svg>
);
</g>
</svg>
);
};

export default VideoJSDownloadIcon;
export default VideoJSDownloadIcon;
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,22 @@ function Downloader({ manifest, canvasIndex }) {
title="Alternate Resource Download"
onMouseEnter={() => setShowMenu(true)}
onMouseLeave={() => setShowMenu(false)}>
<VideoJSDownloadIcon width="1rem" />
<VideoJSDownloadIcon width="1rem" scale="0.9" />
</button>
{showMenu && (
<div className='vjs-menu'
data-testid='videojs-file-download-menu'
onMouseEnter={() => setShowMenu(true)}
onMouseLeave={() => setShowMenu(false)}>
<ul className="vjs-menu-content file-download-menu" role='menu'>
<li className='menu-header'><span>Download files</span></li>
{files.map((f, index) => {
return <li className='vjs-menu-item' key={index}>
<a href={f.id} className='vjs-menu-item-text'
onClick={e => handleDownload(e, f)}>{f.label}</a>
onClick={e => handleDownload(e, f)}>
<VideoJSDownloadIcon width="0.5rem" scale="0.6" />
<span>{f.label}</span>
</a>
</li>;
})}
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../styles/vars';

.vjs-download-btn {
color: white;
border: none;
Expand All @@ -19,14 +21,24 @@
z-index: 1;
right: -100%;
bottom: 100%;

.menu-header {
background-color: $primaryDark;
}
}

.vjs-menu-content a {
color: white;
padding: 0 1.5rem;
padding: 0 1.5rem 0 0.5rem;
text-decoration: none;
}

.vjs-menu-item-text span,
svg {
vertical-align: middle;
display: inline-block;
}

.vjs-menu-content li:hover {
background-color: rgba(115, 133, 159, 0.5);
}