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

Change audio player progress-bar and controls in embeds #6102

Merged
merged 2 commits into from
Nov 5, 2024
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
14 changes: 8 additions & 6 deletions app/javascript/components/embeds/EmbeddedRamp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ const Ramp = ({
};

return (
<IIIFPlayer manifestUrl={manifestUrl}
customErrorMessage='This embed encountered an error. Please refresh or contact an administrator.'
startCanvasId={startCanvasId}
startCanvasTime={startCanvasTime}>
<MediaPlayer enableFileDownload={false} enablePlaybackRate={is_video} enableTitleLink={is_video} />
</IIIFPlayer>
<div className='embedded-ramp'>
<IIIFPlayer manifestUrl={manifestUrl}
customErrorMessage='This embed encountered an error. Please refresh or contact an administrator.'
startCanvasId={startCanvasId}
startCanvasTime={startCanvasTime}>
<MediaPlayer enableFileDownload={false} enablePlaybackRate={is_video} enableTitleLink={is_video} />
</IIIFPlayer>
</div>
);
};

Expand Down
30 changes: 28 additions & 2 deletions app/javascript/components/embeds/Ramp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,44 @@
font-family: Arial, Helvetica, sans-serif;
}

.ramp--media_player {
// Scope CSS to only embedded player
.embedded-ramp .ramp--media_player {
.video-js .vjs-big-play-button {
left: 55% !important;
}

.video-js.vjs-audio-only-mode {
// Player height to the height of iframe container in embeds
max-height: 40px !important;

// Disable tooltips for volume and progress in embedded
// audio. Viewport is too small to display them.
.vjs-volume-panel:hover .vjs-mouse-display,
.vjs-custom-progress-bar .tooltiptext {
.vjs-custom-progress-bar .vjs-time-tooltip {
display: none !important;
}

// Display progress-bar inline with player controls
.vjs-custom-progress-bar {
position: relative;
top: 0.475em;
margin: 0 0.15em;
}

.vjs-volume-horizontal .vjs-volume-level span.vjs-icon-placeholder {
margin-top: 0.15em;
}

// Set control-bar to player's width and remove spacers & offset
.vjs-control-bar {
&::after, &::before {
content: none;
}
width: 100% !important;
left: 0;
}
}

@media (max-width: 585px) {
.video-js .vjs-big-play-button {
scale: 1.5;
Expand Down