Skip to content

Commit 89b5d16

Browse files
author
Ivan Jimenez
committed
Multiple layout/CSS fixes
+ Added Toggle sound
1 parent cf1ff2c commit 89b5d16

File tree

6 files changed

+39
-9
lines changed

6 files changed

+39
-9
lines changed

src/lib/TranscriptEditor/MediaPlayer/PlayerControls.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
34
import Select from './Select';
45

56
import style from './PlayerControls.module.css';
@@ -13,7 +14,9 @@ import {
1314
faPause,
1415
faBackward,
1516
faForward,
16-
faUndo
17+
faUndo,
18+
faVolumeUp,
19+
faVolumeOff
1720
} from '@fortawesome/free-solid-svg-icons';
1821

1922
class PlayerControls extends React.Component {
@@ -114,11 +117,18 @@ class PlayerControls extends React.Component {
114117
<button
115118
value="Picture-in-picture"
116119
title="Picture-in-picture"
117-
className={ style.playerButton }
120+
className={ style.playerButton + " " + style.pip }
118121
onClick={ this.props.pictureInPicture }>
119122
<FontAwesomeIcon icon={ faTv } />
120123
</button>
121124

125+
<button
126+
value="Toggle Sound"
127+
title="Toggle Sound"
128+
className={ style.playerButton }
129+
onClick={ this.props.handleMuteVolume }>
130+
{ this.props.isMute ? <FontAwesomeIcon icon={ faVolumeOff } /> : <FontAwesomeIcon icon={ faVolumeUp } /> }
131+
</button>
122132
</div>
123133
</div>
124134
);
@@ -135,6 +145,7 @@ PlayerControls.propTypes = {
135145
handleMuteVolume: PropTypes.func,
136146
duration: PropTypes.string,
137147
isPlaying: PropTypes.bool,
148+
isMute: PropTypes.bool,
138149
skipBackward: PropTypes.func,
139150
skipForward: PropTypes.func,
140151
playbackRate: PropTypes.number,

src/lib/TranscriptEditor/MediaPlayer/PlayerControls.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,8 @@
153153
float:right;
154154
line-height: 1em;
155155
}
156+
157+
.pip {
158+
display:none;
159+
}
156160
}

src/lib/TranscriptEditor/MediaPlayer/ProgressBar.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@value color-light-grey, color-labs-red from '../colours.module.css';
22

33
.progress {
4-
margin-bottom:0.5em;
4+
margin-bottom:1em;
55
}
66

77
input[type=range] {
@@ -48,7 +48,7 @@ input[type=range]::-moz-range-thumb {
4848
height: 22px;
4949
width: 22px;
5050
border-radius: 22px;;
51-
background: rgb(255, 0, 0);
51+
background:rgb(255, 255, 255);
5252
}
5353

5454
/*hide the outline behind the border*/
@@ -84,7 +84,7 @@ input[type=range]::-ms-thumb {
8484
height: 16px;
8585
width: 16px;
8686
border-radius: 50%;
87-
background: goldenrod;
87+
background:rgb(255, 255, 255);
8888
margin-top: 0px;
8989
}
9090
input[type=range]:focus::-ms-fill-lower {

src/lib/TranscriptEditor/MediaPlayer/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ class MediaPlayer extends React.Component {
3535
hotKeys: returnHotKeys(this),
3636
isPlaying: false,
3737
playbackRateOptions: PLAYBACK_RATES,
38-
previewIsDisplayed: true
38+
previewIsDisplayed: true,
39+
isMute: false
40+
3941
};
4042
}
4143
/*eslint-disable camelcase */
@@ -213,8 +215,10 @@ class MediaPlayer extends React.Component {
213215
if (this.props.videoRef.current !== null) {
214216
if (this.props.videoRef.current.volume > 0) {
215217
this.props.videoRef.current.volume = 0;
218+
this.setState({ isMute: true });
216219
} else {
217220
this.props.videoRef.current.volume = 1;
221+
this.setState({ isMute: false });
218222
}
219223
}
220224
}
@@ -385,6 +389,7 @@ class MediaPlayer extends React.Component {
385389
<PlayerControls
386390
playMedia={ this.togglePlayMedia.bind(this) }
387391
isPlaying={ this.state.isPlaying }
392+
isMute={ this.state.isMute }
388393
playbackRate={ this.state.playbackRate }
389394
skipBackward={ this.skipBackward.bind(this) }
390395
skipForward={ this.skipForward.bind(this) }

src/lib/TranscriptEditor/TimedTextEditor/WrapperBlock.module.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.markers {
77
display: grid;
8-
grid-template-columns: 1fr 1fr;
8+
grid-template-columns: 2fr 1fr;
99
}
1010

1111
.WrapperBlock {
@@ -22,11 +22,12 @@
2222
color: color-mid-grey;
2323
font-weight: bold;
2424
text-transform: uppercase;
25-
text-align: right;
2625
text-overflow: ellipsis;
2726
overflow: hidden;
2827
white-space: nowrap;
2928
justify-self: start;
29+
max-width: 100px;
30+
text-align: left;
3031
}
3132

3233
.text {

src/lib/TranscriptEditor/index.module.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
background: color-subt-green;
99
}
1010

11+
.container {
12+
position:relative;
13+
}
14+
1115
.help {
1216
text-align: center;
1317
cursor: pointer;
@@ -21,6 +25,11 @@
2125
margin-right: 6em;
2226
}
2327

28+
.helpMessage {
29+
min-width: 240px;
30+
text-align: left;
31+
}
32+
2433
@media (max-width: 760px) {
2534
.help {
2635
display:none;
@@ -48,7 +57,7 @@
4857
.header {
4958
background-color: black;
5059
width: 100%;
51-
overflow: hidden;
60+
display:block;
5261
}
5362

5463
.nav {

0 commit comments

Comments
 (0)