Presto Player Shortcode

Presto Player provides a shortcode you can use to add a player to many different parts of your site. This shortcode lets you specify a Media Hub video, but also lets you define a video source directly, either through a url or a custom field.

Media Hub Item

To use the presto_player shortcode with a media item, you can find the shortcode you can copy and paste, right on the Presto Player > Media Hub page:

Custom URL

There are times you want to quickly reference a url directly in the presto_player shortcode. To use the presto_player shortcode with a custom url, use the src parameter:

[presto_player src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"]

Custom Field

Another powerful feature of the Presto Player shortcode is the ability to reference a custom field as a video url. With the custom_field parameter:

[presto_player custom_field="my_custom_field_id"]

Adding Chapters

To add chapters, you can use the presto_player_chapter shortcode inside the presto_player shortcode. The presto_player_chapter shortcode requires a time and chapter.

[presto_player src="https://site.com/video.mp4"]

[presto_player_chapter time="10" title="Ten Seconds"]
[presto_player_chapter time="00:10" title="Also Ten Seconds"]
[presto_player_chapter time="61:20" title="One hour, 1 minute and 20 seconds"]

[/presto_player]

Adding Captions

To add captions, you can use the presto_player_caption shortcode inside the presto_player shortcode. The presto_player_caption shortcode requires a label, src and src_lang.

[presto_player src="https://site.com/video.mp4"]

[presto_player_track label="English" src="https://site.com/english.vtt" src_lang="en"]
[presto_player_track label="Spanish" src="https://site.com/spansih.vtt" src_lang="es"]

[/presto_player]

Additional Options

Along with specifying a video source, you can specify a host of additional options:

ParameterValueExample
presetAn id of a preset from the presets database.preset=46
autoplayEnable autoplaying the videoautoplay=1
plays_inlineEnable the playsinline attributeplays_inline=1
classClass name to add to the playerclass="my-class"
posterUrl to a poster imageposter="http://mysite.com/poster.jpg"
preloadVideo preload setting. Either “auto”, “metadata” or “none”preload="metadata"

How to find a Preset ID

To find a preset id, open the preset in the “Edit Preset” modal:

Then you'll see a “Preset ID” in the bottom right corner of the popup: