Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ make a video clickable and act as a hyperlink

Posted by: one_button Feb 21 2024, 08:11 PM

I am trying to make a video clickable and act as a hyperlink

If I include controls as in this example

CODE
<a href="https://www.example.com/destination-page.html">
  <video src="path/to/video.mp4" width="640" height="360" controls></video>
</a>


the video can play but clicking on the video only pauses playback
if I remove controls, clicking on the video will open the link URL

is there a way to make the link work while including controls?

Posted by: Christian J Feb 22 2024, 06:38 AM

You might be able to place a transparent link in front of the video with CSS "position: absolute" or similar (but don't cover the video controls).

But it will likely be confusing to users if clicking on the video opens a new URL instead of the usual video interaction.

Posted by: coothead Feb 22 2024, 10:28 AM

QUOTE(one_button @ Feb 22 2024, 02:11 AM) *


is there a way to make the link work while including controls?



You may see an example here...
Full Page View
https://codepen.io/coothead/full/mdoYGoj

Editor View
https://codepen.io/coothead/pen/mdoYGoj


cootheasd


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)