Skip to content

Commit e72d27d

Browse files
committed
Disable Drag+Resize on mobile
1 parent be94bcb commit e72d27d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

web/src/components/player/PlayerPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const PlayerPage = () => {
9595
const playerGridGap = 8;
9696
const playerGridRowHeight = 16;
9797
const playerGridItemPixelWidth = (playerGridWidth - playerGridGap * (playerGridColumns - 1)) / playerGridColumns;
98+
const isMobilePlayer = window.innerWidth < 768;
9899
const playerGridItemWidth = 12 / playerGridColumns;
99100
const isSingleStreamChatSidebar = isSingleStream && isChatOpen && playerGridItemPixelWidth >= 1024;
100101
const chatSidebarWidth = cinemaMode ? 320 : 336;
@@ -138,6 +139,8 @@ const PlayerPage = () => {
138139
<div className={`flex flex-col w-full items-center ${!cinemaMode && "mx-auto px-2 py-2 container"}`} >
139140
<div ref={playerGridRef} className="w-full">
140141
<ReactGridLayout
142+
dragConfig={{ enabled: !isMobilePlayer }}
143+
resizeConfig={{ enabled: !isMobilePlayer }}
141144
layout={streamKeys.map((streamKey, index) => ({
142145
i: `${streamKey}_player_card`,
143146
x: (index % playerGridColumns) * playerGridItemWidth,

0 commit comments

Comments
 (0)