How to get a direct link to an MP4 video for the HTML5 video tag
A direct link points to the video file itself, so you can use it in a video tag, an app or a script. Why Google Drive and YouTube don't give you one, and how to get one.
Most "share" links point to a page: a YouTube watch page, a Google Drive preview, a Dropbox download screen. A direct link points to the file itself, for example https://example.com/clip.mp4. You need one when you want to use your own player, like <video src="https://example.com/clip.mp4" controls playsinline></video>.
Apps, game engines, digital signage and many website builders also expect a direct file link instead of a page.
Why the usual services don't work well
- YouTube never gives you the video file. You can only embed its player.
- Google Drive share links open a preview page. Workarounds with changed download links break on larger files, because Drive shows a warning page that it can't scan the file for viruses.
- Dropbox can serve a file directly if you change the end of the share link to
raw=1, but shared links have traffic limits and get switched off when a video is watched too often.
Getting a direct link on Vidlify
Videos on Vidlify normally get a player with several quality levels. For a direct link you store the video as a plain file instead:
- Open the upload page and switch on Store videos as plain files, without a player.
- Upload your MP4 (files up to 5 GB on the free plan).
- Open the file and copy Direct link (for video). There is also a ready HTML code snippet.
The link works in a video tag, in apps and in scripts. Browsers can play MP4 (H.264), WebM and Ogg directly. A MOV or MKV file is offered as a download instead, so convert it to MP4 first (which format to use).
Keep others from using your link
Anyone who finds a direct link can put it on their own site and use your bandwidth. Under Allow embedding and direct links only on these domains you can limit it to your own site. Opening the link directly in a browser tab still works, so you can test it (how the lock works).
Player or direct link?
| Player (embed) | Direct link | |
|---|---|---|
| Quality adapts to the connection | yes | no, always the full file |
Works in your own video tag | no | yes |
| Plays on slow mobile connections | well | only if the file is small |
| MOV, MKV and other formats | converted for you | MP4, WebM or Ogg only |
For a normal video on a website the player is the better choice (how to embed it). Use a direct link when a tool or your own code needs the file itself, and keep the file small, for example with the video file size calculator or the free video compressor. Is your video a MOV, MKV or WebM? The video converter turns it into an MP4 first.