External files

On this page

Sirv Media Viewer can also display images which are not hosted in your Sirv account. They will display as static images (not zoomable).

The images in this demo are served from a different domain (wikimedia.org):






External images are referenced with an img tag, using data-src, such as this:

<div class="Sirv">
  <img data-src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Pilot-Mountain-Szmurlo.jpg/800px-Pilot-Mountain-Szmurlo.jpg" data-type="static">
  <img data-src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Castle_Mountain.jpg/800px-Castle_Mountain.jpg" data-type="static">
  <img data-src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Passo_di_Giau.jpg/800px-Passo_di_Giau.jpg" data-type="static">
</div>

An extra tag data-type="static" can be added, to tell Sirv JS to treat the image as external and not attempt to resize or optimize it. This will also reduce the number of requests and permit the image to load slightly faster.

External videos

You can also display external videos in Sirv Media Viewer. They will simply be served from the third party server. Example:

<div class="Sirv">
  <img data-src="https://another-website.com/folder/video.mpg" data-type="static">
</div>

However, we recommend uploading your videos to Sirv, so that they benefit from Sirv's intelligent video streaming, with automatic serving of the most suitable resolution to each user.

No zoom or optimization

External images are simply served as they are, from the third-party server. None of Sirv's special effects such as image zoom, dynamic resizing or image optimization can be applied.

To benefit from Sirv's image zoom, resizing, optimization, dynamic imaging and other features, upload the images to your Sirv account. Uploading can even be automated, with Sirv's REST API or with automatic image fetching if all the external images are on the same domain.

Get advice

It is quick and easy to configure Sirv for your needs. Contact the team at Sirv if you'd like to discuss your requirements.

Was this article helpful?

Get help from a Sirv expert

help ukraine help ukraine Powered by Ukrainian determination and British ingenuity

How can you support Ukraine