Mux plugin for live captions
Add captions to a Mux player
Using the Mux player using the connector
If you’ve created your project in Timbra using the Mux CMS integration, you can use the plugin to add captions to the Mux player:
<mux-player id="my-player" playback-id="YOUR_PLAYBACK_ID"></mux-player>
<script src="https://cdn.captionhub.com/live/mux-plugin-1.21.js"></script>
<script>
CaptionHubLiveForMux.init({
video: document.querySelector('#my-player'),
});
</script>You can get the versioned script URL and captions URL from the “Plugin integration” tab on a live project page. Note that the embed code works for all players, as we’ll look up the captions by the Mux playback ID in the player.
Using the Mux Player with custom source
If you’re using the Mux player with a “custom” source by specifying src instead of playback-id, you’ll need to specify the captionsURL when initialising the plugin.
<mux-player id="my-player" src="http://example.com/playlist.m3u8"></mux-player>
<script src="https://cdn.captionhub.com/live/mux-plugin-1.21.js"></script>
<script>
CaptionHubLiveForMux.init({
video: document.querySelector('#my-player'),
captionsURL: "<CAPTIONS_URL>"
});
</script>
Did this answer your question?
😞
😐
🤩