- Attribute of
- <img> HTML Tag
- What does
- An early failed attempt to include native video playback in HTML.
An Early Attempt at HTML Video
dynsrc attribute was part of an early failed attempt to include native video playback in HTML. The idea was to overload the
<img> element with a video file, defined in
dynsrc (dynamic source). If the browser supported the playback feature, the video would be shown. Otherwise, the regular image defined in
src would be displayed.
<img src="flamingo.jpg" dynsrc="flamingo-movie">
Unfortunately, there were problems with this method. Not all browsers implemented it, and those that did implemented it differently. Most of all, the problem was simply that it wasn't the right time for widespread use of HTML video — download speeds were still slow, storage and bandwidth were still expensive, video was still hard to produce. The ‘dynsrc` method never really caught on, and the attribute was written out of the HTML specification even before HTML5.
How to Embed Video in HTML Today
With HTML5, embedding video is as easy as using the
<video controls> <!-- Define one or more source files. The browser selects the best option. --> <source src="/wp-content/uploads/flamingo-movie.mp4" type="video/mp4"> <!-- Anything outside of a source definition is shown if playback fails. --> Your browser does not support the video tag. </video>