~cytrogen/masto-fe

8f380a33fc9cd30ea807e166b8fa7342ea258764 — Claire 2 years ago 6dbd44f
[Glitch] Fix video player offering to expand in a lightbox when it's in an iframe

Port 100840c06e5c771524cb2ef55dbb99b077984911 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
1 files changed, 8 insertions(+), 1 deletions(-)

M app/javascript/flavours/glitch/containers/media_container.jsx
M app/javascript/flavours/glitch/containers/media_container.jsx => app/javascript/flavours/glitch/containers/media_container.jsx +8 -1
@@ 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,
              }),