Skip to content

How to fix CORB when i use youtube embedded video url? #16

Answered by igordanchenko
ivanyufen asked this question in Q&A
Discussion options

You must be logged in to vote

The Video plugin supports raw video files (.mp4, .webm, etc.), but it sounds like you are trying to use YouTube iframe embed. You can render iframe video as a custom slide:

https://codesandbox.io/s/yet-another-react-lightbox-16-bwx8nc

<Lightbox
  open={open}
  close={() => setOpen(false)}
  slides={[
    {
      type: "youtube",
      src: "https://www.youtube.com/embed/aqz-KE-bpKQ",
      title: "Big Buck Bunny",
      width: 2160,
      height: 1215
    }
  ]}
  render={{
    slide: ({ type, src, width, height, title }, offset, rect) =>
      type === "youtube" ? (
        <iframe
          width={Math.min(
            width,
            rect.width,
            (width * rect.height) / h…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@ivanyufen
Comment options

@igordanchenko
Comment options

@ivanyufen
Comment options

@igordanchenko
Comment options

@igordanchenko
Comment options

Answer selected by igordanchenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants