Asset URLs
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 .mp4 or .png. Below are some techniques for obtaining these asset URLs with a few tips & tricks for using them.
NoteThe Wistia APIs were specifically built for videos in projects. We do not formally support using our APIs for audio files in projects, or audio or video episodes in Channels at this time. For the most reliable experience, we recommend continuing to use these for videos in projects.
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'.
Bandwidth and Analytics Tradeoffs
A Direct Asset URL serves the raw file outside the Wistia player, so it behaves very differently from a normal embed for both billing and analytics. Understand these tradeoffs before you build a workflow around asset URLs.
Requests to an asset URL never reach the Wistia player, so they produce no plays, no engagement graphs, and no viewer data. That activity is invisible in your media stats. It still consumes bandwidth, and that bandwidth counts toward your account's bandwidth usage just like a normal play. Using asset URLs can raise usage significantly and incur additional costs.
Because bandwidth is counted but plays are not, direct asset distribution shows up as bandwidth with no player analytics to explain it. This is a common reason a Wistia account's bandwidth doesn't line up with its play counts.
Signs direct asset URLs are driving your bandwidth
If your bandwidth usage looks high relative to the plays reported in your media stats, direct asset distribution is a likely cause. Check for these signals:
- Bandwidth in the billing dashboard is higher than your play volume would suggest.
- A media's file URL (an
embed-ssl.wistia.com/deliveries/...link) has been pasted into a website, email, RSS feed, podcast host, or app. - Downloads are enabled on an asset URL with
?disposition=attachment. - A large
OriginalFileasset is being linked instead of a streaming-optimized asset.
Confirming which asset is responsible usually requires a CDN-log investigation by Support, so it's fastest to first rule out the causes above.
Safer alternatives
- To keep analytics, use a standard Wistia embed instead of a raw file URL. That's the only way to record plays and engagement.
- To pull stats programmatically, use the Stats API rather than asset URLs. It returns play and engagement data without touching the file.
- If you must distribute the file, prefer a streaming-optimized asset over the
OriginalFileto limit bandwidth per request, and only enable downloads where you accept the untracked bandwidth cost. - Because direct asset traffic won't appear in media stats, monitor the bandwidth dashboard directly to catch a spike early.
AlertWe generally do not recommend using Asset URLs, as accessing a Wistia-hosted video file outside of the video player means you won't get any video stats, analytics, customizations, HLS playback delivery, or other features specific to the Wistia player. This activity does count towards your account's bandwidth usage however. If you do start using Asset URLs, be aware that bandwidth usage may increase significantly, which can incur additional usage costs for your account.
Getting an Asset URL
Asset URLs are obtained through the Wistia Data API, specifically the Media Show method. This request requires an API token which can be obtained by or from the Account Owner.
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.
NoteThe
OriginalFileis used as a blueprint for encoding a set of streaming assets, and is never used for video streaming/playback in the Wistia player. Originals are typically much larger in size compared to our streaming-optimized assets, which means higher bandwidth usage when viewed or downloaded. Unless you're looking for a backup of your original, we generally recommend against using theOriginalFilefor embedding or downloading, as doing so can lead to high usage costs.
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 .mp4 format.
Asset URL File Extensions
Asset URLs in Wistia take this form:
https://embed-ssl.wistia.com/deliveries/856970d9a4bcb9aab381a0bd9ab714f19d72c62f.bin
The .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:
https://embed-ssl.wistia.com/deliveries/856970d9a4bcb9aab381a0bd9ab714f19d72c62f/my-file.mp4
Getting HLS assets
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 .bin to .m3u8, which will return an HLS manifest file for that particular mp4.
NoteThe contents of the .m3u8 playlist does not include captions data. If you use the "main" .m3u8 playlist, the information will include captions data.
That format of that main playlist is as follows:
https://fast.wistia.com/embed/medias/HashedID.m3u8
Enabling Downloads from Asset URLs
AlertReminder that asset URL viewing and downloads will contribute to bandwidth usage in your account. Enabling downloads from direct assets creates the risk of a spike in bandwidth, and thereby increased bandwidth costs, but without any video stats to represent it.
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.
https://embed-ssl.wistia.com/deliveries/061aacab996e0da67c3dd65883025aa3efa6043d.bin?disposition=attachment
This will automatically download the file instead of trying to play it natively in the browser.
HTTP vs HTTPS Asset URLs
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 to embed-ssl. We use different subdomains for SSL and non-SSL assets because they're sometimes served through different CDNs for performance reasons.
Thumbnails & Image Assets
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!
Updated 17 days ago