if <img> used to load image, then how if i want to load an movie like swf, or avi??
THX

Dani AI

Generated

, images use the <img> tag, but movies are different. For video on the web, use the HTML5 <video> element with a web-friendly format. Flash/SWF files no longer run in modern browsers (Flash was discontinued and disabled in 2021), so embedding a .swf is not a viable option today Adobe Flash Player EOL. AVI also is not a browser media format; convert it to MP4 (H.264/AAC) or WebM and embed with <video> instead. You do not need jQuery just to play video; libraries are only helpful for UI behaviors like lightboxes, as was hinting.

<video controls width="640" height="360" poster="poster.jpg">
  <source src="/media/movie.mp4" type="video/mp4">
  <source src="/media/movie.webm" type="video/webm">
  Sorry, your browser does not support HTML5 video.
</video>

If you currently have an AVI, convert it first:

ffmpeg -i input.avi -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4

Tips:

  • Serve correct MIME types (e.g., video/mp4, video/webm) or playback may fail.
  • MP4 (H.264/AAC) is the safest single choice across major browsers; add WebM for broader coverage when needed MDN: Supported media formats.
  • See the <video> element reference for attributes like controls, autoplay, muted, poster, and track for captions MDN: HTML video element.

Recommended Answers

All 2 Replies

You would have to probably go jquery.

Here's something i quickly sourced. Sure if you searched you could probably find something better.

sorry about the double post

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.