Speed Selection
The Flowplayer Native speed selection plugin adds support for playback speed selection, so viewers can change the playback speed of a video.
Table of contents
Installation
Load the speed plugin next to the core player.
<script src="//cdn.flowplayer.com/releases/native/3/stable/flowplayer.min.js"></script>
<script src="//cdn.flowplayer.com/releases/native/3/stable/plugins/speed.min.js"></script>
Player and plugins exist in different release versions. Please see the release channel documentation.
OVP managed player
To enable the plugin in an OVP managed player, add it in the OVP player configurator. The JavaScript and iframe embeds then load it automatically.
Alternatively, to enable it only in a single OVP JavaScript (ESM) embed, import the plugin's ESM module after the embed module and register it with flowplayer(speed) before you create the player:
<div id="player-<media id>"></div>
<script type="module">
import flowplayer from "https://embed.flowplayer.com/<player id>/<media id>.js";
import speed from "https://cdn.flowplayer.com/releases/native/3/stable/esm/plugins/speed.min.js";
flowplayer(speed);
flowplayer("#player-<media id>", {});
</script>
Load the plugin from the same release channel or version as the player. In legacy async embeds, add "speed" to the "plugins": [] array instead.
Configuration
The plugin is configured in top level configuration under speed namespace.
Properties:
-
- option
- description
- default
-
optionsarray- Array of speed factors where
1is normal speed. [0.2, 0.5, 1, 2, 10].
-
labelsarray- Array of speed labels. Indices match with options array.
- For each label
{option}x
Sample code
var api = flowplayer('#container',
{ src: "//edge.flowplayer.org/bauhaus.mp4"
, title: "Bauhaus"
, speed:
{ options: [0.5, 1, 2]
, labels: ["Slow","Normal", "Fast"]
}
}
)