# How to Install Videoteca Player

The **Videoteca Player** integration offers a fast and efficient solution for hosting [Videofront's Videoteca](https://videofront.com.br/videoteca) player using the iframe embedding method. With this integration, you can load videos by simply passing the `video-id` query string argument to specify the content to be displayed.

---

## Requirements

To set up this integration, you need to provide a **Username** and an **API Token** from **Videoteca**. To obtain these credentials, you need to have an account on the [Videoteca website](https://videofront.com.br/videoteca).

---

## Getting the integration

To install this integration provided by Azion Marketplace, you have to:

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > **Marketplace**.
2. On the Marketplace homepage, select the integration's card.
3. Once the integration's page opens, click the **Install** button, at the bottom-right corner of the page.

You'll see a message indicating that your integration was successfully installed.

:::tip
You can search any integration by browsing through the cards, using the filters, or typing a keyword in the search bar. 
:::

---

## Setting up the integration

### Instantiating the function

To create an instance of the integration's function:

1. On the **Products menu**, navigate to **Build** > **Application**.
2. Select the application from the list to which you want to add the integration or [create a new application](/en/documentation/products/build/applications/first-steps/).
3. Select the **Functions Instances** tab.
4. Click the **+ Function Instance** button.
5. Give a name to your instance.
6. On the dropdown menu, select the *Videoteca Player* function.
  - This action will load the **Arguments** tab, where you can add the parameters to execute your application.
7. In the **Arguments** tab, pass these parameters:


```json
{
"videoteca_user": "<your_username>", // Replace with your Videoteca username
"videoteca_token": "<your_token>", // Replace with your Videoteca API token
"custom_html": "<your_html>" // Replace with your custom html
}
```

Where:

| Variable | Required | Description |
| ---- | ----- | ----- |
| `videoteca_user` | Yes | The name of the account from which the function will retrieve the videos |
| `videoteca_token` | Yes | The token to access the Videoteca's API |
| `custom_html` | No | Custom HTML for the page delivered by the function. It must include the tag `<!-- videoteca_iframe -->` in the HTML, as the function will replace it with the actual iframe of the video |

:::tip
You can get your token at: `https://<YOUR-USER>.videotecaead.com.br/Apidoc` replacing `<YOUR-USER>` with your actual Videoteca username.
:::

8. Click the **Save** button to save your configuration.

Done. Now your Videoteca Player instance is saved.

### Setting up the Application Rules Engine

To finish, you have to set up the **Rules Engine** to configure the *behavior* and the *criteria* to run the function.

Still on the **Application** page:

1. Select the **Rules Engine** tab.
2. Click the **+ Rule Engine** button.
3. Give a name to the rule.
4. In **Criteria**, define the conditions for running the function.
5. Below, select the **Run Function** behavior. 
    - Select the adequate function according to the name you gave it in the instantiate step.
6. Click the **Save** button.

Done. Now the integration will run according to the criteria you set.

---