The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> make a video clickable and act as a hyperlink, make a video clickable and act as a hyperlink
one_button
post Feb 21 2024, 08:11 PM
Post #1





Group: Members
Posts: 1
Joined: 21-February 24
Member No.: 29,134



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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 22 2024, 06:38 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
coothead
post Feb 22 2024, 10:28 AM
Post #3


Advanced Member
****

Group: Members
Posts: 206
Joined: 12-January 23
From: chertsey, a small town 25 miles south west of london, england
Member No.: 28,743



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

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 05:13 AM