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 {
1313 data-testid = "media-player-id"
1414 onClick = { this . props . onClick }
1515 onLoadedData = { this . props . onLoadedDataGetDuration }
16+ onPause = { this . props . videoHasPaused }
1617 ref = { this . props . videoRef }
1718 />
1819 ) ;
@@ -24,7 +25,8 @@ VideoPlayer.propTypes = {
2425 onTimeUpdate : PropTypes . func ,
2526 onClick : PropTypes . func ,
2627 videoRef : PropTypes . object ,
27- onLoadedDataGetDuration : PropTypes . func
28+ onLoadedDataGetDuration : PropTypes . func ,
29+ videoHasPaused : PropTypes . func
2830} ;
2931
3032export default VideoPlayer ;
Original file line number Diff line number Diff line change @@ -4,9 +4,6 @@ function returnHotKeys(self) {
44 priority : 1 ,
55 handler : ( ) => {
66 self . togglePlayMedia ( ) ;
7- if ( ! self . isPlaying ( ) && self . props . focusOnPause ) {
8- self . props . setFocus ( ) ;
9- }
107
118 self . props . handleAnalyticsEvents ( {
129 category : 'defaultHotKeys' ,
Original file line number Diff line number Diff line change @@ -412,6 +412,7 @@ class MediaPlayer extends React.Component {
412412 onClick = { this . togglePlayMedia . bind ( this ) }
413413 videoRef = { this . videoRef }
414414 onLoadedDataGetDuration = { this . onLoadedDataGetDuration }
415+ videoHasPaused = { this . props . setFocus }
415416 /> ;
416417
417418 const playerControlsSection = (
@@ -470,7 +471,6 @@ MediaPlayer.propTypes = {
470471 rollBackValueInSeconds : PropTypes . number ,
471472 timecodeOffset : PropTypes . number ,
472473 setFocus : PropTypes . func ,
473- focusOnPause : PropTypes . bool ,
474474} ;
475475
476476export default hotkeys ( MediaPlayer ) ;
Original file line number Diff line number Diff line change @@ -234,7 +234,9 @@ class TranscriptEditor extends React.Component {
234234 }
235235
236236 handleSetFocus = ( ) => {
237- this . setFocus ( ) ;
237+ if ( this . state . focusOnPause ) {
238+ this . setFocus ( ) ;
239+ }
238240 }
239241
240242 getEditorContent = ( exportFormat ) => {
@@ -259,7 +261,6 @@ class TranscriptEditor extends React.Component {
259261 handleAnalyticsEvents = { this . props . handleAnalyticsEvents }
260262 handleSaveTranscript = { this . handleSaveTranscript }
261263 setFocus = { this . handleSetFocus }
262- focusOnPause = { this . state . focusOnPause }
263264 /> ;
264265
265266 const settings = < Settings
You can’t perform that action at this time.
0 commit comments