[Glitch] Fix video player offering to expand in a lightbox when it's in an iframe

Port cbcf32777e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
Claire 2023-05-23 14:28:21 +02:00
parent 006bc485e4
commit ffc7a57f8b
1 changed files with 8 additions and 1 deletions

View File

@ -73,6 +73,13 @@ export default class MediaContainer extends PureComponent {
render () {
const { locale, components } = this.props;
let handleOpenVideo;
// Don't offer to expand the video in a lightbox if we're in a frame
if (window.self === window.top) {
handleOpenVideo = this.handleOpenVideo;
}
return (
<IntlProvider locale={locale} messages={messages}>
<>
@ -89,7 +96,7 @@ export default class MediaContainer extends PureComponent {
...(componentName === 'Video' ? {
componentIndex: i,
onOpenVideo: this.handleOpenVideo,
onOpenVideo: handleOpenVideo,
} : {
onOpenMedia: this.handleOpenMedia,
}),