I have put together a FIDDLE to demonstrate how you can utilize the scale property to adjust the size of your video as well as control its opacity.
HTML:
<iframe width="560" height="315" src="https://www.youtube.com/embed/ie-C7DQVNKw" frameborder="0" allowfullscreen></iframe>
CSS:
iframe {
transform: scale(1, 1);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
iframe:hover {
transform: scale(1.1,1.1);
filter: alpha(opacity=80);
opacity: 0.8;
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
}
Explanation:
In this example, there are two key features:
- The initial state of the video is set to scale at (1,1) using the transform property, although this step is not mandatory, it is included for illustrative purposes.
Upon hovering over the video, the iframe is scaled to (1.1 , 1.1), resulting in a 10% increase in size in both dimensions, along with applying an opacity effect.
- For the hover state, an opacity effect has been added to the iframe.