Skip to main content
Cookbook Content Presto Player

Add a YouTube, Vimeo or Uploaded Video to a Page with Presto Player and AI

A YouTube, Vimeo or media library video added to Presto Player's Media Hub and placed on a new draft page.

Difficulty Beginner
Time ~5 min

Prerequisites

A site connected to WPVibe running a recent Presto Player (tested on 4.5.6, free) on WordPress 6.9 or newer, with an administrator account, and Enable AI access and Allow AI to make changes turned on in Presto Player, Settings, AI Abilities and MCP. For a file, the video is already in your media library.

The prompt
My WordPress site uses Presto Player. Put my video [YouTube or Vimeo link, or words from the title of a video file in my media library] on a new draft page called [page title]. [Optional: one line of text to show above the video.]

1. Run discover_abilities with category presto-player. If presto-player/create-video-youtube, presto-player/create-video-vimeo, presto-player/create-video-self-hosted and presto-player/get-video-shortcode are not there: if no presto-player abilities show at all, tell me to install or update the free Presto Player plugin (its AI abilities need WordPress 6.9 or newer) and to turn on Enable AI access in Presto Player, Settings, AI Abilities and MCP; if only the read abilities show (such as presto-player/list-videos), tell me to turn on Allow AI to make changes there too. Then stop.
2. For a YouTube link, run presto-player/create-video-youtube with url set to it, title set to the page title and status draft. For a Vimeo link, run presto-player/create-video-vimeo the same way. For a file, run rest_api GET /wp/v2/media with search set to my words, media_type video and _fields id,title,source_url, show me the matches and wait for my pick, then run presto-player/create-video-self-hosted with attachment_id set to it and status draft, and tell me the video keeps the file's media library title. Always send status draft: Presto also makes a page that plays the video, with the same status, and publishes it when no status is sent. Note video_id, post_id, reused and url (the page Presto made).
3. If reused is true, the video was already in the Media Hub: run rest_api GET /wp/v2/presto-videos/POST_ID with context edit and _fields id,status, and if it is not published, tell me publishing it also shows it on every published page that already has it, and ask before going on. Publish the video record so a published page can play it: run rest_api_write POST /wp/v2/presto-videos/POST_ID with status publish. Tell me why: a draft video shows nothing on a published page, and the video record's own address stays hidden from visitors (it answers not found) unless its instant video page is turned on in the video's editor, opened from the Media Hub. Its page stays a draft.
4. If reused is false, the page Presto made in step 2 is new and only holds this video: take PAGE_ID from its url (the page_id number) and run rest_api_write POST /wp/v2/pages/PAGE_ID with my title, status draft, and content: a paragraph block with my line if I gave one, then the block, written as the self-closing block comment wp:presto-player/reusable-display with the attributes {"id":POST_ID}. If reused is true, the video was already in the Media Hub and that page may be in use: do not change it, and create a new page instead with rest_api_write POST /wp/v2/pages with the same title, status and content, and use its id as PAGE_ID from here on. Do not publish the page.
5. Check: run presto-player/get-video-shortcode with post_id and confirm ambiguous is false (if it is true, tell me which video renders_video_id says it plays). Run rest_api GET /wp/v2/pages/PAGE_ID with context edit and _fields id,status,link,content.raw and confirm it is a draft holding the block with the right id. Run rest_api GET /wp/v2/presto-videos/POST_ID with context edit and _fields id,status and confirm publish. Give me the link to edit the page, and tell me the video plays there once I publish it.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Add a YouTube, Vimeo or Uploaded Video to a Page with Presto Player and AI” recipe from the WPVibe cookbook on my connected site.

You have a video on YouTube, Vimeo or in your media library and want it on a page in a player that matches your site, without YouTube’s suggestions pulling visitors away. Doing it by hand means adding it to Presto’s Media Hub, copying its shortcode, making a page and pasting it in.

Give the AI the link or the file name and the page title. It adds the video to Presto Player’s Media Hub, puts it on a new draft page with an optional line of text above it, and publishes only the video record, which has no public page of its own, so the player shows once you publish the page. It reads everything back and gives you the link to the draft.

Presto makes a page for every new video, and publishes it unless told otherwise, so the AI always asks for a draft. If the video is already in the Media Hub, Presto reuses it, and the AI then leaves its existing page alone and makes a new draft page. A video from your media library keeps its media library title. When Presto made the page, it stays linked: renaming the video renames it, and deleting the video sets it back to draft, unless another video shares the post. To turn a video into a blog post instead, use this recipe.

Outcome

The video is in your Media Hub and on a new draft page that plays it once you publish the page.