-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from RandomStudio/new-video-controls
New video controls
- Loading branch information
Showing
5 changed files
with
274 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.wrapper { | ||
display: flex; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
width: 100%; | ||
z-index: 1; | ||
padding-left: 1rem; | ||
padding-bottom: 24px; | ||
font-size: 17px; | ||
|
||
button, | ||
a { | ||
background: none; | ||
border: none; | ||
color: white; | ||
text-decoration: none; | ||
width: 7rem; | ||
display: flex; | ||
align-items: center; | ||
text-align: left; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.muteToggle { | ||
margin-left: 590px; // Progress bar width | ||
} | ||
|
||
.playToggle { | ||
width: 4rem; | ||
} | ||
} | ||
.pullRight { | ||
display: flex; | ||
margin-left: auto; | ||
margin-right: 0; | ||
|
||
a, | ||
button { | ||
text-align: right; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import styles from './Controls.module.scss'; | ||
import { VideoData } from '../../../types/types'; | ||
|
||
type ControlsTypes = { | ||
handlePlayToggle: () => void; | ||
handleMuteToggle: () => void; | ||
isPlaying: boolean; | ||
isMuted: boolean; | ||
video: VideoData; | ||
}; | ||
|
||
const Controls = ({ | ||
handlePlayToggle, | ||
handleMuteToggle, | ||
isMuted, | ||
isPlaying, | ||
video, | ||
}: ControlsTypes) => { | ||
return ( | ||
<div className={styles.wrapper}> | ||
<button | ||
className={styles.playToggle} | ||
onClick={handlePlayToggle} | ||
type="button" | ||
> | ||
{isPlaying ? 'Pause' : 'Play'} | ||
</button> | ||
|
||
<button | ||
className={styles.muteToggle} | ||
onClick={handleMuteToggle} | ||
type="button" | ||
> | ||
{isMuted ? 'Sound On' : 'Sound Off'} | ||
</button> | ||
|
||
<div className={styles.pullRight}> | ||
<a download href={`${video.baseUrl}/original`}> | ||
{'Download'} | ||
</a> | ||
|
||
<button type="button">{'Share'}</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Controls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.