Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible add embedded youtube video in editor ? #642

Open
rasel-stacklearner opened this issue May 17, 2024 · 7 comments
Open

is it possible add embedded youtube video in editor ? #642

rasel-stacklearner opened this issue May 17, 2024 · 7 comments

Comments

@rasel-stacklearner
Copy link

i want to embed youtube videos in the editor. is it possible now?

@jaywcjlove
Copy link
Member

@rasel-stacklearner

Using the remark-oembed plugin allows displaying youtube videos in the preview area.

You can also create a custom plugin to solve your own problem.

@rasel-stacklearner
Copy link
Author

@rasel-stacklearner

Using the remark-oembed plugin allows displaying youtube videos in the preview area.

You can also create a custom plugin to solve your own problem.

Can you give me some example codes? and one more thing is it possible to embed "MDX Embed" https://mdx-embed.netlify.app/?path=/docs/introduction--page

@jaywcjlove
Copy link
Member

@rasel-stacklearner The recommended plugin doesn't seem to be working. I found a new one that should work.

https://www.npmjs.com/package/remark-youtube

import { useState } from "react";
import MDEditor from "@uiw/react-md-editor";
import "@uiw/react-md-editor/dist/mdeditor.css";
import youtube from "remark-youtube";

const markdown = `Hey this is a nice youtube video about making modern react apps with gatsby:

https://www.youtube.com/watch?v=GN0xHSk2P8Q

Check it out 👆`;

export default function App() {
  const [value, setValue] = useState(markdown);
  return (
    <div>
      <MDEditor
        value={value}
        onChange={setValue}
        previewOptions={{
          remarkPlugins: [[youtube]],
        }}
      />
    </div>
  );
}

@rasel-stacklearner
Copy link
Author

@rasel-stacklearner The recommended plugin doesn't seem to be working. I found a new one that should work.

https://www.npmjs.com/package/remark-youtube

import { useState } from "react";
import MDEditor from "@uiw/react-md-editor";
import "@uiw/react-md-editor/dist/mdeditor.css";
import youtube from "remark-youtube";

const markdown = `Hey this is a nice youtube video about making modern react apps with gatsby:

https://www.youtube.com/watch?v=GN0xHSk2P8Q

Check it out 👆`;

export default function App() {
  const [value, setValue] = useState(markdown);
  return (
    <div>
      <MDEditor
        value={value}
        onChange={setValue}
        previewOptions={{
          remarkPlugins: [[youtube]],
        }}
      />
    </div>
  );
}

is there any way to work with it "https://mdx-embed.netlify.app/?path=/docs/introduction--page" ?

@jaywcjlove
Copy link
Member

@rasel-stacklearner I'm not sure what you're trying to do. Are you looking to replace the markdown preview area with MDX?

@rasel-stacklearner
Copy link
Author

rasel-stacklearner commented May 18, 2024

@rasel-stacklearner I'm not sure what you're trying to do. Are you looking to replace the markdown preview area with MDX?

yes. Is it possible? So that i can embed the components of MDX-Embed

@rasel-stacklearner
Copy link
Author

@rasel-stacklearner I'm not sure what you're trying to do. Are you looking to replace the markdown preview area with MDX?

@jaywcjlove Basically I want to do something like this =>
image

I try to extend the component functionality with MDX-Embed Component.
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants