Videoteca adds a video library to WordPress for videos hosted on Mux. You upload, find, rename and embed videos from the WordPress admin, and Mux handles encoding and streaming. It is an independent plugin, not affiliated with or endorsed by Mux, Inc.
Titles stay the way you wrote them. Each video is stored in WordPress with the title you give it, taken from the file name unless you change it, even while it is still uploading. The same title goes to Mux, so your Mux dashboard shows it too. Rename a video in WordPress and it is renamed in Mux.
Search by title. Find any video by words from its title, description or original file name, or by its Mux asset or playback ID. Search works in the library screen and in the block’s video picker.
[vlfm_video id="123"], with the same options.MuxVideo type for headless sites, which ACF Mux Video fields resolve to, and library queries for editors.Videos play in Mux Player, which is bundled with the plugin, so nothing loads from a CDN. Casting to Chromecast is turned off, because it needs Google’s Cast SDK from Google’s servers. AirPlay still works in Safari.
The plugin includes its source code. The JavaScript and CSS in build/ are compiled from src/ with @wordpress/scripts: run npm install, then npm run build.
Bundled libraries, both under the MIT License:
@mux/mux-player)UpChunk (@mux/upchunk)
tools/no-cast-sdk-loader.js removes the code in Mux Player that loads Google’s Cast SDK, during the build.
You need a Mux account. Mux charges for encoding, storage and delivery; see Mux pricing.
[vlfm_video id="123"] plays library video 123. Switches take `1`, `true`, `on` or `yes`.
background="1": plays muted and on a loop with no controls, like a moving image.autoplay="1": starts playing, muted, when the page loads.muted="1", loop="1"controls="0": hides the controls. A click on the video plays and pauses it.title="1": shows the title in the player.captions="off": starts with captions off. Visitors can turn them on.speeds="0.5 1 1.5 2": the speeds in the speed menu, or speeds="off" to hide it.preload="none": none, metadata or auto.max_resolution="720p": 720p, 1080p, 1440p or 2160p.poster="456": a poster image, as a Media Library ID or an image URL.start="10": starts 10 seconds in.accent_color="#fa50b5": the color of the controls.You can find a video’s ID in its details in Mux Videos Library, where you can also copy its shortcode.
With Advanced Custom Fields active, field groups get a Mux Video field type, under Content. Editors choose a video from the library, upload one or import one from a URL, right in the field. The field saves the library video ID.
Return Format sets what get_field() returns:
the_field(). Its script and styles load with it.For player options, set Return Format to Video ID and pass the ID to the shortcode:
echo do_shortcode( sprintf( '[vlfm_video id="%d" background="1"]', get_field( 'video' ) ) );
In ACF’s REST API, the field’s value is the video ID.
With WPGraphQL active, the schema has a MuxVideo type. Add WPGraphQL for ACF and Mux Video fields resolve to MuxVideo, whatever their Return Format:
{
post(id: "launch-day", idType: SLUG) {
videoFields {
video {
title
playbackId
playbackPolicy
tokens { playback thumbnail storyboard }
thumbnailUrl
aspectRatio
duration
}
}
}
}
Anyone who can see a post can see the videos in its fields, as on the page itself. tokens is null for public videos. For signed ones it has the same shape as the tokens prop of Mux Player for React, and it expires after the token lifetime in Mux Videos Settings, so refetch or rebuild pages within that time. streamUrl is the HLS stream, for other players.
To browse the library itself, muxVideo(id: ID!, idType: MuxVideoIdTypeEnum) gets one video by global ID, database ID, asset ID or playback ID, and muxVideos(first: Int, after: String, where: {search, status, orderby, order}) lists them, newest first. node(id:) loads videos too. These are for logged-in users who can edit posts, for example with an application password, and return nothing to anyone else, so videos that are not on a page stay private.
This plugin connects to Mux, a video hosting service run by Mux, Inc., to store, process and stream your videos. Without a Mux account it cannot upload or play videos.
/wp-json/vlfm/v1/webhook on your site. The site turns them away until you save the webhook’s signing secret.Mux terms of service: https://www.mux.com/terms
Mux privacy policy: https://www.mux.com/privacy