Disable video Picture-in-Picture for stickers and gifs (#1981)
This commit is contained in:
parent
0b3db96ea2
commit
49e7c15b2e
@ -151,6 +151,7 @@ const Avatar: FC<OwnProps> = ({
|
|||||||
className={buildClassName(cn.media, 'avatar-media', transitionClassNames)}
|
className={buildClassName(cn.media, 'avatar-media', transitionClassNames)}
|
||||||
muted
|
muted
|
||||||
autoPlay
|
autoPlay
|
||||||
|
disablePictureInPicture
|
||||||
loop={!noLoop}
|
loop={!noLoop}
|
||||||
playsInline
|
playsInline
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -182,6 +182,7 @@ const GifButton: FC<OwnProps> = ({
|
|||||||
autoPlay
|
autoPlay
|
||||||
loop
|
loop
|
||||||
muted
|
muted
|
||||||
|
disablePictureInPicture
|
||||||
playsInline
|
playsInline
|
||||||
preload="none"
|
preload="none"
|
||||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
|
|||||||
@ -107,6 +107,7 @@ const ProfilePhoto: FC<OwnProps> = ({
|
|||||||
src={imageSrc}
|
src={imageSrc}
|
||||||
className="avatar-media"
|
className="avatar-media"
|
||||||
muted
|
muted
|
||||||
|
disablePictureInPicture
|
||||||
autoPlay={!notActive}
|
autoPlay={!notActive}
|
||||||
loop
|
loop
|
||||||
playsInline
|
playsInline
|
||||||
|
|||||||
@ -272,6 +272,7 @@ const StickerButton = <T extends number | ApiSticker | ApiBotInlineMediaResult |
|
|||||||
autoPlay={canVideoPlay}
|
autoPlay={canVideoPlay}
|
||||||
loop
|
loop
|
||||||
playsInline
|
playsInline
|
||||||
|
disablePictureInPicture
|
||||||
muted
|
muted
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -50,6 +50,7 @@ const PremiumFeaturePreviewVideo: FC<OwnProps> = ({
|
|||||||
)}
|
)}
|
||||||
src={mediaData}
|
src={mediaData}
|
||||||
autoPlay
|
autoPlay
|
||||||
|
disablePictureInPicture
|
||||||
playsInline
|
playsInline
|
||||||
muted
|
muted
|
||||||
loop
|
loop
|
||||||
|
|||||||
@ -563,6 +563,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
|
|||||||
src={botInfoGifUrl}
|
src={botInfoGifUrl}
|
||||||
loop
|
loop
|
||||||
autoPlay
|
autoPlay
|
||||||
|
disablePictureInPicture
|
||||||
muted
|
muted
|
||||||
playsInline
|
playsInline
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -264,7 +264,7 @@ const AttachmentModal: FC<OwnProps> = ({
|
|||||||
{renderingAttachments.map((attachment) => (
|
{renderingAttachments.map((attachment) => (
|
||||||
attachment.mimeType.startsWith('image/')
|
attachment.mimeType.startsWith('image/')
|
||||||
? <img src={attachment.blobUrl} alt="" />
|
? <img src={attachment.blobUrl} alt="" />
|
||||||
: <video src={attachment.blobUrl} autoPlay muted loop />
|
: <video src={attachment.blobUrl} autoPlay muted loop disablePictureInPicture />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@ -34,7 +34,7 @@ const StickerSetCover: FC<OwnProps> = ({ stickerSet, observeIntersection }) => {
|
|||||||
<div ref={ref} className="sticker-set-cover">
|
<div ref={ref} className="sticker-set-cover">
|
||||||
{firstLetters}
|
{firstLetters}
|
||||||
{isVideo ? (
|
{isVideo ? (
|
||||||
<video src={mediaData} className={transitionClassNames} loop autoPlay />
|
<video src={mediaData} className={transitionClassNames} loop autoPlay disablePictureInPicture />
|
||||||
) : (
|
) : (
|
||||||
<img src={mediaData} className={transitionClassNames} alt="" />
|
<img src={mediaData} className={transitionClassNames} alt="" />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -68,6 +68,7 @@ const Game: FC<OwnProps> = ({
|
|||||||
className="preview-content"
|
className="preview-content"
|
||||||
playsInline
|
playsInline
|
||||||
muted
|
muted
|
||||||
|
disablePictureInPicture
|
||||||
autoPlay
|
autoPlay
|
||||||
loop
|
loop
|
||||||
src={videoBlobUrl}
|
src={videoBlobUrl}
|
||||||
|
|||||||
@ -218,6 +218,7 @@ const RoundVideo: FC<OwnProps> = ({
|
|||||||
width={ROUND_VIDEO_DIMENSIONS_PX}
|
width={ROUND_VIDEO_DIMENSIONS_PX}
|
||||||
height={ROUND_VIDEO_DIMENSIONS_PX}
|
height={ROUND_VIDEO_DIMENSIONS_PX}
|
||||||
autoPlay
|
autoPlay
|
||||||
|
disablePictureInPicture
|
||||||
muted={!isActivated}
|
muted={!isActivated}
|
||||||
loop={!isActivated}
|
loop={!isActivated}
|
||||||
playsInline
|
playsInline
|
||||||
|
|||||||
@ -167,6 +167,7 @@ const Sticker: FC<OwnProps> = ({
|
|||||||
height={height}
|
height={height}
|
||||||
autoPlay={shouldPlay}
|
autoPlay={shouldPlay}
|
||||||
playsInline
|
playsInline
|
||||||
|
disablePictureInPicture
|
||||||
loop={shouldLoop}
|
loop={shouldLoop}
|
||||||
muted
|
muted
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
<video src="./nojs.mp4" class="nojs-video" muted loop autoplay playsinline></video>
|
<video src="./nojs.mp4" class="nojs-video" muted loop autoplay playsinline disablePictureInPicture></video>
|
||||||
<h1>Telegram Web</h1>
|
<h1>Telegram Web</h1>
|
||||||
<p>Please, enable JavaScript to open the app.</p>
|
<p>Please, enable JavaScript to open the app.</p>
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user