Skip to content

Commit

Permalink
fix audio hiccups
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed Hussein committed Sep 1, 2024
1 parent 3d001cc commit 24c38e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/components/MediaMaker/Content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ const MediaMakerContent: React.FC<Props> = ({
<Video loop src={videoPath} />
</div>
{audioHasStartAndEndRanges && (
<Audio pauseWhenBuffering startFrom={startFrom} endAt={endAt} src={audio.audioUrl} />
<Audio
pauseWhenBuffering
startFrom={startFrom}
endAt={endAt}
src={audio.audioUrl}
acceptableTimeShiftInSeconds={1}
/>
)}
{verses &&
verses.length > 0 &&
Expand Down
7 changes: 2 additions & 5 deletions src/pages/media/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
getChapterAudioData,
getChapterVerses,
} from '@/api';
import PlayerContent from '@/components/MediaMaker/Content';
import styles from '@/components/MediaMaker/MediaMaker.module.scss';
import VideoSettings from '@/components/MediaMaker/Settings/VideoSettings';
import NextSeoWrapper from '@/components/NextSeoWrapper';
Expand Down Expand Up @@ -88,10 +89,6 @@ const MediaMaker: NextPage<MediaMaker> = ({

const playerRef = useRef<PlayerRef>(null);

const lazyComponent = useCallback(() => {
return import('@/components/MediaMaker/Content');
}, []);

useEffect(() => {
setIsReady(true);
}, []);
Expand Down Expand Up @@ -395,7 +392,7 @@ const MediaMaker: NextPage<MediaMaker> = ({
[styles.playerHeight]: !isSafari(),
})}
inputProps={inputProps}
lazyComponent={lazyComponent}
component={PlayerContent}
durationInFrames={getDurationInFrames(timestamps)}
compositionWidth={width}
compositionHeight={height}
Expand Down

0 comments on commit 24c38e5

Please sign in to comment.