File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class VideoPlayer extends React.Component {
13
13
data-testid = "media-player-id"
14
14
onClick = { this . props . onClick }
15
15
onLoadedData = { this . props . onLoadedDataGetDuration }
16
+ onPause = { this . props . videoHasPaused }
16
17
ref = { this . props . videoRef }
17
18
/>
18
19
) ;
@@ -24,7 +25,8 @@ VideoPlayer.propTypes = {
24
25
onTimeUpdate : PropTypes . func ,
25
26
onClick : PropTypes . func ,
26
27
videoRef : PropTypes . object ,
27
- onLoadedDataGetDuration : PropTypes . func
28
+ onLoadedDataGetDuration : PropTypes . func ,
29
+ videoHasPaused : PropTypes . func
28
30
} ;
29
31
30
32
export default VideoPlayer ;
Original file line number Diff line number Diff line change @@ -4,9 +4,6 @@ function returnHotKeys(self) {
4
4
priority : 1 ,
5
5
handler : ( ) => {
6
6
self . togglePlayMedia ( ) ;
7
- if ( ! self . isPlaying ( ) && self . props . focusOnPause ) {
8
- self . props . setFocus ( ) ;
9
- }
10
7
11
8
self . props . handleAnalyticsEvents ( {
12
9
category : 'defaultHotKeys' ,
Original file line number Diff line number Diff line change @@ -412,6 +412,7 @@ class MediaPlayer extends React.Component {
412
412
onClick = { this . togglePlayMedia . bind ( this ) }
413
413
videoRef = { this . videoRef }
414
414
onLoadedDataGetDuration = { this . onLoadedDataGetDuration }
415
+ videoHasPaused = { this . props . setFocus }
415
416
/> ;
416
417
417
418
const playerControlsSection = (
@@ -470,7 +471,6 @@ MediaPlayer.propTypes = {
470
471
rollBackValueInSeconds : PropTypes . number ,
471
472
timecodeOffset : PropTypes . number ,
472
473
setFocus : PropTypes . func ,
473
- focusOnPause : PropTypes . bool ,
474
474
} ;
475
475
476
476
export default hotkeys ( MediaPlayer ) ;
Original file line number Diff line number Diff line change @@ -234,7 +234,9 @@ class TranscriptEditor extends React.Component {
234
234
}
235
235
236
236
handleSetFocus = ( ) => {
237
- this . setFocus ( ) ;
237
+ if ( this . state . focusOnPause ) {
238
+ this . setFocus ( ) ;
239
+ }
238
240
}
239
241
240
242
getEditorContent = ( exportFormat ) => {
@@ -259,7 +261,6 @@ class TranscriptEditor extends React.Component {
259
261
handleAnalyticsEvents = { this . props . handleAnalyticsEvents }
260
262
handleSaveTranscript = { this . handleSaveTranscript }
261
263
setFocus = { this . handleSetFocus }
262
- focusOnPause = { this . state . focusOnPause }
263
264
/> ;
264
265
265
266
const settings = < Settings
You can’t perform that action at this time.
0 commit comments