Skip to content

Commit

Permalink
Fixing the controls and adding next and last frame svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharma, Amit committed Apr 23, 2020
1 parent 04a0c04 commit c136c1f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
28 changes: 14 additions & 14 deletions src/controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,30 @@ function Controls(props: Props) {

return (
<div className="react-video-controls">
{controls.includes('play') ? (
{controls.includes('play') && (
<button
className={isPlaying ? 'pause' : 'play'}
onClick={isPlaying ? onPauseClick : onPlayClick}
>
{isPlaying ? 'Pause' : 'Play'}
</button>
) : null}
{controls.includes('last-frame') ? (
)}
{controls.includes('last-frame') && (
<button className="last-frame" onClick={onFullScreenClick}>
Next Frame
</button>
) : null}
{controls.includes('next-frame') ? (
)}
{controls.includes('next-frame') && (
<button className="next-frame" onClick={onFullScreenClick}>
Next Frame
</button>
) : null}
{controls.includes('time') ? (
)}
{controls.includes('time') && (
<div className="time">
{currentTimeCode}/{durationTimeCode}
</div>
) : null}
{controls.includes('progress') ? (
)}
{controls.includes('progress') && (
<div className="progress-wrap">
<progress ref={progressEl} max="100" onClick={onProgressClick}>
0% played
Expand All @@ -107,8 +107,8 @@ function Controls(props: Props) {
)
})}
</div>
) : null}
{controls.includes('volume') ? (
)}
{controls.includes('volume') && (
<div className="volume-wrap">
<progress ref={volumeEl} max="100" value={volume * 100} onClick={onVolumeClick}>
{volume * 100}% volume
Expand All @@ -117,12 +117,12 @@ function Controls(props: Props) {
Volume
</button>
</div>
) : null}
{controls.includes('full-screen') ? (
)}
{controls.includes('full-screen') && (
<button className="full-screen" onClick={onFullScreenClick}>
FullScreen
</button>
) : null}
)}
</div>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/images/last-frame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions src/images/next-frame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c136c1f

Please sign in to comment.