Skip to content
BeoHosting
BeoHosting
Technical

How to Build Multimedia Content for a Site

BeoHosting Team··8 min read read
How to Build Multimedia Content for a Site

Why multimedia content matters

Multimedia content - video, audio, animations, and interactive elements - dramatically increases visitor engagement. Pages with video have 80% higher conversion rates than text-only pages. Users spend 2.6 times more time on pages with video.

However, multimedia can significantly slow down loading if not properly implemented. A 50MB video that loads automatically will destroy the user experience on mobile. This guide will teach you how to add multimedia to your site without sacrificing performance.

1. Video hosting and embedding

External video hosting (recommended)

For most sites, the best option is to host videos on specialized platforms and embed them on the site. This saves bandwidth, speeds up loading, and offers adaptive streaming.

  • YouTube: Free, unlimited storage, automatically transcodes to multiple resolutions. Downside: shows ads and other video recommendations at the end.
  • Vimeo: More professional look, no ads, more player control. Free plan limited to 500MB weekly, Pro plan from €11/month.
  • Bunny Stream: CDN-based video hosting at low prices (€1/1,000 minutes of streaming). No branding, custom player, HLS adaptive streaming.
  • Cloudflare Stream: Pay-per-use model integrated with the Cloudflare CDN. €1 per 1,000 minutes of streaming + €5 per 1,000 minutes of storage.

Self-hosting video

Hosting video on your own server only makes sense if you have specific privacy requirements or want full control. You need significantly more disk space on a VPS and bandwidth.

  • Use the HTML5 video tag with multiple sources (MP4 + WebM) for cross-browser compatibility.
  • Never use autoplay with sound - browsers will block it and users will be frustrated.
  • Add a poster attribute (thumbnail image) that shows before the user starts the video.
  • Compress the video before upload using HandBrake or FFmpeg. Target size: 5-10MB per minute for 1080p.

Optimizing the YouTube embed

The standard YouTube iframe loads over 1MB of JavaScript even if the user does not play the video. Use the "lite-youtube-embed" library or a facade pattern - it shows a thumbnail and loads the real player only when the user clicks play. This can reduce initial page load time by 2-3 seconds.

2. Audio content

Audio content is increasingly popular - podcasts, audio guides, interviews, and background music. Implementing audio on the site requires attention to user experience and performance.

Embedding audio

  • HTML5 Audio tag: The simplest way for self-hosted audio. Supports MP3, OGG, and WAV. Add the controls attribute to show the player.
  • SoundCloud embed: For podcasts and music. Free plan with 3 hours of upload. Automatically transcodes and streams.
  • Spotify embed: For podcasts already on Spotify. Simple iframe embed with styling options.
  • Podbean/Buzzsprout: Specialized podcast hosting platforms with embeddable players and RSS feeds.

Audio format and compression

  • MP3: Universally supported, excellent compression. Use 128kbps for speech, 256kbps for music.
  • OGG Vorbis: Open-source alternative, better quality at the same size. Will not work in Safari without a fallback.
  • AAC: Better quality than MP3 at the same bitrate. Supported in all modern browsers.

3. Image optimization

Images are the most common type of multimedia content and usually make up 50-70% of total web page size. Proper image optimization is key to site speed.

Image formats

  • WebP: The recommended format for the web. 25-35% smaller than JPEG at the same quality. Supported in all modern browsers.
  • AVIF: The newest format, even better than WebP (20% smaller). Adoption is growing but not universal. Use as primary with WebP fallback.
  • JPEG: Standard for photos. Use quality 75-85% for the web - the difference is invisible for most images.
  • PNG: For images with transparency, logos, and illustrations with sharp edges. Do not use for photos - size will be too large.
  • SVG: For icons, logos, and simple illustrations. Vector format - scales without quality loss, extremely small files.

Compression tools

  • Squoosh (web app): Google's free tool. Visual before/after comparison, support for all formats.
  • ShortPixel (WordPress plugin): Automatic compression on upload. Free plan for 100 images per month.
  • ImageOptim (Mac): A desktop app for batch compression. Free and open source.
  • TinyPNG (API): A popular online tool with an API for automation. Free for 500 images per month.

Responsive images

Do not serve the same 2000px-wide image to both mobile and desktop users. Use srcset and sizes attributes to serve appropriately sized images based on screen width. WordPress automatically creates multiple image sizes on upload and adds the srcset attribute.

4. Lazy loading

Lazy loading is a technique that defers loading of multimedia content until the user reaches that part of the page. Instead of loading all images and videos at once, the browser loads only what is visible on screen.

Native lazy loading

Modern browsers support native lazy loading via the loading="lazy" attribute on img and iframe elements. This is the simplest implementation and requires no JavaScript.

Important rules for lazy loading

  • Do not lazy-load the hero image: The image above the fold (visible without scrolling) must load immediately. Lazy loading on the hero image worsens the LCP (Largest Contentful Paint) metric.
  • Define dimensions: Always set width and height on images to prevent layout shift (CLS) while the image loads.
  • Placeholder: Use a blur-up technique (show a small blurred version of the image while the full version loads) or a solid color placeholder.
  • Intersection Observer: For advanced control, use the JavaScript Intersection Observer API, which gives you more options than native lazy loading.

5. Animations and interactive elements

Animations can improve user experience but can also kill performance if used carelessly.

  • CSS animations: Prefer CSS transforms (transform, opacity) over animating layout properties (width, height, top, left). CSS animations are hardware accelerated and do not block the main thread.
  • Lottie animations: Lightweight JSON-based animations created in Adobe After Effects. Much smaller than GIFs, vector and scalable. Use the lottie-web library.
  • Scroll-triggered animations: Use libraries like AOS (Animate On Scroll) or GSAP ScrollTrigger for animations triggered on scroll. Watch performance - many animations on one page can slow scrolling.

6. Practical implementation tips

  • Test on real devices: Multimedia that runs smoothly on your desktop can be slow on older mobile devices. Test on real phones.
  • Measure performance: Use Lighthouse and WebPageTest to measure the impact of multimedia on page speed before and after implementation.
  • Progressive enhancement: Basic site functionality must work without multimedia content. Video and animations are an enhancement, not a requirement.
  • Accessibility: Add alt text to images, captions to videos, and transcripts for audio content. This helps users with disabilities and SEO.

Conclusion

Multimedia content dramatically improves user experience and engagement, but requires careful implementation to avoid destroying performance. Use external hosting for video, optimize images in WebP/AVIF format, implement lazy loading for everything below the fold, and test on real devices. The balance between visual richness and load speed is the key to a successful multimedia site.

BeoHosting Team

10+ years of experience — Web hosting and infrastructure specialists

  • Web Hosting
  • WordPress Hosting
  • VPS
  • Dedicated Serveri
  • Domeni
  • SSL
  • cPanel
  • LiteSpeed
  • Linux administracija
  • DNS

Last updated: