Working with direct file URLs for Wistia-hosted content
Sometimes a particular implementation calls for the use of a file URL, what we call a Direct Asset URL in Wistia. This is the raw video or image file ending in the relevant file extension like
.png. Below are some techniques for obtaining these asset URLs with a few tips & tricks for using them.
An ’asset' refers to the any of the video or image files attached to media. Video files for streaming, thumbnail images, and storyboard images are all considered ’assets'.
The response to a
medias:show request includes an array of
assets, with their direct URLs and information on each asset’s size and type. The
OriginalFile asset is the source media that was uploaded to Wistia, and all other assets are the streaming-optimized files delivered by the Wistia player during playback.
Alternatively, you can use this handy ’videolinkfor' tool. This makes it a little easier to get an asset URL without directly using our API, and it will give you a link for the 1280 x 720p asset URL, in
Asset URLs in Wistia take this form:
.bin extension at the URL is for binary. Certain clients won’t accept URLs with an unfamiliar extension like this one. In this case, you can drop the
.bin, add a slash, and append whatever filename and extension you like -– you’ll still get the underlying video asset.
So, say the URL above is an mp4 file and we need the URL to end in the proper file extension. Here’s how we would change it:
Wistia uses HLS playback by default - if you would like to retrieve HLS assets for your videos in m3u8 format, you’ll first want to grab an mp4 asset URL from your video using the Data API technique mentioned above. All m3u8 files in Wistia are generated dynamically from the mp4 files for that same media.
With an mp4 asset URL for your media, you can change the extension from
.m3u8, which will return an HLS manifest file for that particular mp4.
If you are looking to allow downloads from asset URLs in your site or application, you can add the
disposition=attachment parameter to the end of the URL, e.g.
This will automatically download the file instead of trying to play it natively in the browser.
If you have an asset that’s served over HTTP and you’d like to get it served over HTTPS instead, you’ll need to change the subdomain from
embed-ssl. We use different subdomains for SSL and non-SSL assets because they’re sometimes served through different CDNs for performance reasons.
Using the Data API or oEmbed endpoint, you can obtain the thumbnail URL for your video, and then manipulate it. You can request images from a specific time in your video, resize them, even crop them!
For more details, We have a dedicated guide all about working with images!