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

Video Detail Page Updates #1137

Merged
merged 1 commit into from
Aug 1, 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
24 changes: 15 additions & 9 deletions src/components/microlearning/VideoDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,25 @@ const VideoDetailPage = () => {
<Row>
<article className="col-12 col-lg-9">
<div className="d-flex flex-column align-items-start flex-grow-1 video-container">
<div className="d-flex flex-row align-items-center justify-content-between">
<h2 data-testid="video-title" className="mb-0">
{videoData?.courseTitle}
</h2>
<span className="small ml-2 mt-2 text-nowrap">
{videoData?.videoDuration && `(${videoData?.videoDuration} minutes)`}
</span>
</div>
{ videoData?.courseTitle && (
<div className="d-flex flex-row align-items-start justify-content-between">
<div className="flex-grow-1">
<h2 data-testid="video-title" className="mb-0 text-wrap">
{videoData?.courseTitle}
</h2>
</div>
<span className="small ml-2 mt-2 text-nowrap">
{videoData?.videoDuration && `(${videoData?.videoDuration} minutes)`}
</span>
</div>
)}
<p className="small align-self-stretch p-0 mb-0">
{videoData?.videoSummary}
</p>
{/* Skills that we are currently retrieving for videos are inaccurate, so we are temporarily
hiding this section. */}
{videoData?.videoSkills?.length > 0 && (
<div className="d-flex flex-row align-items-center">
<div className="d-none flex-row align-items-center">
<h4 className="mb-0">
<FormattedMessage
id="videoDetailPage.skills.label"
Expand Down
6 changes: 4 additions & 2 deletions src/components/microlearning/tests/VideoDetailPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ describe('VideoDetailPage Tests', () => {
expect(screen.getByTestId('video-title')).toHaveTextContent('Test Video');
expect(screen.getByText('(10:4 minutes)')).toBeInTheDocument();
expect(screen.getByText('This is a test video summary.')).toBeInTheDocument();
expect(screen.getByText('Skill 1')).toBeInTheDocument();
expect(screen.getByText('Skill 2')).toBeInTheDocument();
// Skills that we are currently retrieving for videos are inaccurate, so we are
// temporarily hiding this section.
// expect(screen.getByText('Skill 1')).toBeInTheDocument();
// expect(screen.getByText('Skill 2')).toBeInTheDocument();
expect(container.querySelector('.video-player-wrapper')).toBeTruthy();
});
it('renders a video detail page when course level type is Intermediate', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/video/VideoPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import VideoJS from './VideoJS';

const hlsExtension = '.m3u8';
const defaultOptions = {
autoplay: true,
autoplay: false,
controls: true,
responsive: true,
fluid: true,
Expand Down
Loading