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

React support? #8

Open
pateljoel opened this issue Mar 19, 2021 · 2 comments
Open

React support? #8

pateljoel opened this issue Mar 19, 2021 · 2 comments
Labels
question Further information is requested

Comments

@pateljoel
Copy link

Hello, this looks like an amazing project :)

Is it possible to use with React? Is there any samples for this?

@BMSVieira
Copy link
Owner

BMSVieira commented Mar 19, 2021

Hey, thanks!
It's currently on the to-do list but there's a few big ones ahead of it.

@BMSVieira BMSVieira added the question Further information is requested label Mar 19, 2021
@wonrax
Copy link

wonrax commented May 16, 2023

Working example in Next.js 13 app directory:

"use client";

import Moovie from "mooviejs";
import "mooviejs/css/moovie.css";
import { useEffect } from "react";

export default function Movies() {
  useEffect(() => {
    var demo = new Moovie({
      selector: "#moovie-player",
      dimensions: {
        width: "700px",
      },
      icons: {
        path: "/icons/",
      },
    });

    return () => {
      demo.destroy();
    };
  }, []);

  return (
    <div style={{ margin: 8 }}>
      <video id="moovie-player">
        <source src="example.com/file.mp4" type="video/mp4" />
        Your browser does not support the video tag.
      </video>
    </div>
  );
}

I'm not sure if this is safe to use because Moovie could conflict with React on the DOM thing.

@BMSVieira BMSVieira reopened this May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants