Install the Videoteca Player integration
Install Videoteca Player from Azion Marketplace and run it on an application to host a Videofront Videoteca player with an iframe.
Videoteca Player hosts the player of Videofront’s Videoteca and embeds it with an iframe. To choose the video the page displays, pass its ID in the video-id query string argument. It is one of the Marketplace integrations that run on an application.
Four objects must exist before a request loads the player: the installed function, an application with the Functions module turned on, a function instance that holds your Videoteca credentials, and a Rules Engine rule with the Run Function behavior. Each section below creates one of them.
Prerequisites
- An Azion account. To sign in, refer to How to access Azion Console.
- An application served by a workload. To create one, refer to Applications quickstart.
- An account on the Videoteca website, with its Username and API Token. The function instance requires both.
- Turning on a product or a module can generate usage costs. For more information, refer to Pricing.
Install the integration
The install adds the Videoteca Player function to your account. To install it from Azion Console:
Access Azion Console > Marketplace.
Enter Videoteca Player in the Search on Marketplace field, then select the integration’s card.
The card shows Successfully installed! and Latest version installed!. The function is then listed in the Function list of the Create Instance drawer.
Turn on the Functions module
An application runs an installed function only when its Functions module is on. To turn on the module:
Access Azion Console > Applications > your application.
In the Main Settings tab, go to the Modules section.
Azion Console confirms that the application was updated.
Create the function instance
A function instance holds the arguments the Videoteca Player function reads for one application. To create the instance in your application:
In Applications, select your application, then select the Functions Instances tab.
An application with no instance yet offers the same action as Function Instance. The Create Instance drawer opens.
In Name, enter a unique name that identifies the instance. For example: videoteca-player.
In Function, select Videoteca Player. The Arguments editor fills with the default arguments of the integration.
In Arguments, enter your Videoteca username and API token. Each key is described in the table below.
The instance appears in the Functions Instances tab with the name you entered.
Arguments
The arguments are one JSON object. Replace each placeholder with your own value:
| Key | Required | Description |
|---|---|---|
videoteca_user | Yes | The name of the account the function retrieves the videos from |
videoteca_token | Yes | The token that accesses the Videoteca API |
custom_html | No | Custom HTML for the page the function delivers. It must include the <!-- videoteca_iframe --> tag, which the function replaces with the iframe of the video |
To get your API token, open https://<YOUR-USER>.videotecaead.com.br/Apidoc, with <YOUR-USER> replaced by your Videoteca username.
Create the rule
The instance runs only when a Rules Engine rule calls it. The rule below matches every request. To create the rule:
In Applications, select your application, then select the Rules Engine tab.
In Name, enter a name for the rule. For example: Run Videoteca Player on every request.
In the Phase section, select Request Phase.
In the Criteria section, keep the ${uri} variable and the starts with operator, then enter / as the argument.
In the Behaviors section, select Run Function, then select the instance you created by its name.
The rule appears in the Rules Engine tab, under the request phase, and runs the Videoteca Player instance on every request. To narrow the requests that load the player, change the criterion.
For every criterion and behavior a rule accepts, refer to Rules Engine.