Skip to content

Commit

Permalink
Merge pull request #838 from AI4Bharat/uichange1
Browse files Browse the repository at this point in the history
remove word count and add fast audio design changes in ui
  • Loading branch information
aparna-aa authored Oct 28, 2024
2 parents 00ff0cb + 1b7038e commit 36aad0b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/containers/Organization/Video/RightPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,9 @@ const RightPanel = ({ currentIndex, currentSubs,setCurrentIndex, showTimeline, s
style={{ fontSize: fontSize, height: "120px" }}
{...props}
/>
<span id="charNum" className={classes.wordCount}>
{/* <span id="charNum" className={classes.wordCount}>
{targetLength(index)}
</span>
</span> */}
</div>
)}
/>
Expand All @@ -791,9 +791,9 @@ const RightPanel = ({ currentIndex, currentSubs,setCurrentIndex, showTimeline, s
}, 200);
}}
/>
<span id="charNum" className={classes.wordCount}>
{/* <span id="charNum" className={classes.wordCount}>
{targetLength(index)}
</span>
</span> */}
</div>
)}
</CardContent>
Expand Down
12 changes: 6 additions & 6 deletions src/containers/Organization/Video/TranslationRightPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ const TranslationRightPanel = ({ currentIndex, currentSubs,setCurrentIndex, show
);
}}
/>
<span
{/* <span
className={classes.wordCount}
style={{
color:
Expand All @@ -786,7 +786,7 @@ const TranslationRightPanel = ({ currentIndex, currentSubs,setCurrentIndex, show
}}
>
{sourceLength(index)}
</span>
</span> */}
</div>
)}

Expand Down Expand Up @@ -844,7 +844,7 @@ const TranslationRightPanel = ({ currentIndex, currentSubs,setCurrentIndex, show
}}
{...props}
/>
<span
{/* <span
className={classes.wordCount}
style={{
color:
Expand All @@ -858,7 +858,7 @@ const TranslationRightPanel = ({ currentIndex, currentSubs,setCurrentIndex, show
}}
>
{targetLength(index)}
</span>
</span> */}
</div>
)}
/>
Expand Down Expand Up @@ -890,7 +890,7 @@ const TranslationRightPanel = ({ currentIndex, currentSubs,setCurrentIndex, show
}, 200);
}}
/>
<span
{/* <span
className={classes.wordCount}
style={{
color:
Expand All @@ -904,7 +904,7 @@ const TranslationRightPanel = ({ currentIndex, currentSubs,setCurrentIndex, show
}}
>
{targetLength(index)}
</span>
</span> */}
</div>
)}
</CardContent>
Expand Down
14 changes: 7 additions & 7 deletions src/containers/Organization/Video/VoiceOverRightPanel1.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg
);
}}
/>
<span
{/* <span
className={classes.wordCount}
style={{
color:
Expand All @@ -1002,7 +1002,7 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg
}}
>
{sourceLength(index)}
</span>
</span> */}
</div>}

<div className={classes.relative} style={{ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: "4px", width: "50%" }}>
Expand Down Expand Up @@ -1066,7 +1066,7 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg
: {}
}
>
<AudioPlayer src={data[index]} />
<AudioPlayer src={data[index]} fast={item?.fast_audio}/>
{/* <audio
disabled={isDisabled(index)}
src={data[index]}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg
disabled={isDisabled(index)}
{...props}
/>
<span
{/* <span
className={classes.wordCount}
style={{
color:
Expand All @@ -1162,7 +1162,7 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg
}}
>
{targetLength(index)}
</span>
</span> */}
</div>
)}
/>
Expand Down Expand Up @@ -1193,7 +1193,7 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg
}}
disabled={isDisabled(index)}
/>
<span
{/* <span
className={classes.wordCount}
style={{
color:
Expand All @@ -1207,7 +1207,7 @@ const VoiceOverRightPanel1 = ({ currentIndex, setCurrentIndex, showTimeline, seg
}}
>
{targetLength(index)}
</span>
</span> */}
</div>
)}
</CardContent>
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Organization/Video/audioPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const Audio = styled.audio`
display: none;
`;

const AudioPlayer = ({ src }) => {
const AudioPlayer = ({ src, fast = false }) => {
const playerRef = useRef(null);
const [isPlaying, setIsPlaying] = useState(false);
const [disabled, setDisabled] = useState(false);
Expand Down Expand Up @@ -153,7 +153,7 @@ const AudioPlayer = ({ src }) => {
}, [src]);

return (
<PlayerContainer style={{opacity:disabled&&"0.5", cursor:disabled&&"not-allowed"}}>
<PlayerContainer style={{opacity:disabled&&"0.5", cursor:disabled&&"not-allowed", border:fast&&"1px solid red"}}>
<Controls>
<PlayPauseButton onClick={!disabled&&togglePlay} style={{cursor:disabled&&"not-allowed"}}>
{isPlaying ? (
Expand Down
1 change: 1 addition & 0 deletions src/utils/Sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class Sub {
this.transcription_text = obj.transcription_text;
this.paraphrased_text = obj.paraphrased_text;
this.verbatim_text = obj.verbatim_text;
this.fast_audio = obj.fast_audio;
}

get check() {
Expand Down

0 comments on commit 36aad0b

Please sign in to comment.