DEV Community

Ranjani R
Ranjani R

Posted on

DAY 7

Hi all! Today I continued learning about the video element and all its attributes. We need an attribute called controls enabled in order for the video to play....also we need to mention the type of video format so that the browser can render it accordingly. We can also give attributes like autoplay muted and loop to the source tag so the the video plays automatically each time the website is loaded. But some users might find autoplay as a form of violation of their privacy and so we must try and avoid using autoplay.
Next up I learnt about how to add a Youtube video in the website. This can be done using the iframe tag and the url can be obtained by selecting the share option in the desired Youtube video and copying the code given under embed tab into the iframe. Similar to regular video we can also use autoplay and mute options in this. However these should not be written as seperate attributes but should be written at the end of the iframe URL address with their values set to 1.
So that's all for today.....see you all in the next post!

Top comments (3)

Collapse
 
payilagam_135383b867ea296 profile image
Payilagam

Adding example code would be more helpful for future reference.

Collapse
 
dotallio profile image
Dotallio

Love that you’re thinking about user privacy and not just the code! Have you tried experimenting with custom video controls yet?

Collapse
 
asran_2025 profile image
Ranjani R

Not yet....as far as I know not many developers use

Some comments may only be visible to logged-in visitors. Sign in to view all comments.