@@ -27,6 +27,7 @@ class TranscriptEditor extends React.Component {
2727 rollBackValueInSeconds : 15 ,
2828 timecodeOffset : 0 ,
2929 showTimecodes : true ,
30+ focusOnPause : true ,
3031 showSpeakers : true
3132 } ;
3233 this . timedTextEditorRef = React . createRef ( ) ;
@@ -188,6 +189,20 @@ class TranscriptEditor extends React.Component {
188189 }
189190 }
190191
192+ handleFocusOnPause = ( e ) => {
193+ const isChecked = e . target . checked ;
194+ this . setState ( { focusOnPause : isChecked } ) ;
195+
196+ if ( this . props . handleAnalyticsEvents !== undefined ) {
197+ this . props . handleAnalyticsEvents ( {
198+ category : 'TranscriptEditor' ,
199+ action : 'handleFocusOnPause' ,
200+ name : 'focusOnPause' ,
201+ value : isChecked
202+ } ) ;
203+ }
204+ }
205+
191206 handleSettingsToggle = ( ) => {
192207 this . setState ( prevState => ( {
193208 showSettings : ! prevState . showSettings
@@ -244,6 +259,7 @@ class TranscriptEditor extends React.Component {
244259 handleAnalyticsEvents = { this . props . handleAnalyticsEvents }
245260 handleSaveTranscript = { this . handleSaveTranscript }
246261 setFocus = { this . handleSetFocus }
262+ focusOnPause = { this . state . focusOnPause }
247263 /> ;
248264
249265 const settings = < Settings
@@ -254,11 +270,13 @@ class TranscriptEditor extends React.Component {
254270 timecodeOffset = { this . state . timecodeOffset }
255271 showTimecodes = { this . state . showTimecodes }
256272 showSpeakers = { this . state . showSpeakers }
273+ focusOnPause = { this . state . focusOnPause }
257274 handlePauseWhileTyping = { this . handlePauseWhileTyping }
258275 handleIsScrollIntoViewChange = { this . handleIsScrollIntoViewChange }
259276 handleRollBackValueInSeconds = { this . handleRollBackValueInSeconds }
260277 handleSetTimecodeOffset = { this . handleSetTimecodeOffset }
261278 handleShowTimecodes = { this . handleShowTimecodes }
279+ handleFocusOnPause = { this . handleFocusOnPause }
262280 handleShowSpeakers = { this . handleShowSpeakers }
263281 handleAnalyticsEvents = { this . props . handleAnalyticsEvents }
264282 /> ;
0 commit comments