Refac inline player scroll behaviour

This commit is contained in:
MerlinScheurer
2025-01-06 19:21:17 +01:00
parent 71797b5050
commit 5abe2d0548
2 changed files with 4 additions and 3 deletions

View File

@@ -63,6 +63,9 @@ const EmbeddableVideoPlayer = ({ videoId }: EmbeddableVideoPlayerProps) => {
setVideoResponse(videoResponse);
const inlinePlayer = document.getElementById('inline-player');
inlinePlayer?.scrollIntoView();
setRefresh(false);
setLoading(false);
})();
@@ -88,7 +91,7 @@ const EmbeddableVideoPlayer = ({ videoId }: EmbeddableVideoPlayerProps) => {
return (
<>
<div className="player-wrapper">
<div id="inline-player" className="player-wrapper">
<div className="video-player">
{!loading && (
<VideoPlayer

View File

@@ -39,8 +39,6 @@ const VideoListItem = ({
<a
onClick={() => {
setSearchParams({ videoId: video.youtube_id });
window.scroll({ top: 0, left: 0, behavior: 'smooth' });
}}
>
<div className={`video-thumb-wrap ${viewLayout}`}>