> For the complete documentation index, see [llms.txt](https://docs.fluidplayer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluidplayer.com/pt/integracao/using-fluid-player-with-react.md).

# Usando o Fluid Player com React

O Fluid Player funciona com React pronto a usar. Para começar a usar o Fluid Player no seu projeto React, você precisará de:

* instalar o Fluid Player usando Yarn ou NPM, como descrito [aqui](/pt/integracao/quick-setup.md#integration-using-npm); e
* importar o módulo do Fluid Player e anexá-lo ao elemento de vídeo da sua escolha.

Você pode ver um exemplo de como integrar o Fluid Player e o React no exemplo abaixo. Este é um exemplo simplificado para ajudá-lo a começar rapidamente. Siga as melhores práticas do React sobre como criar componentes reutilizáveis, dependendo das necessidades do seu projeto.

**IMPORTANTE:** a troca dinâmica de fontes não é suportada. É **necessário** recriar o componente OU recriar a instância do Fluid Player para alterar as fontes ou outras configurações do player.

#### App.css

```css
@import "~fluid-player/src/css/fluidplayer.css";
```

#### App.js

```jsx
import fluidPlayer from 'fluid-player'
import './App.css';
import {useEffect, useRef} from "react";

function App() {
  let self = useRef(null);
  let player = null;

  useEffect(() => {
      if (!player) {
        player = fluidPlayer(self.current, {});
      }
  });

  return (
      <>
        <video ref={self}>
          <source src='https://cdn.fluidplayer.com/videos/valerian-1080p.mkv'
                  data-fluid-hd
                  title='1080p'
                  type='video/mp4'/>
        </video>
      </>
  );
}

export default App;
```

**Nota**: O Safari não suporta a reprodução de ficheiros .mkv. Para visualizar este tipo de ficheiro, considere usar um navegador diferente que suporte o formato .mkv.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fluidplayer.com/pt/integracao/using-fluid-player-with-react.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
