Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rotate HTML 5 video without also rotating controls?

Using the CSS transform() property (and the -moz-, -webkit-, etc verisons), it's easy to rotate an HTML 5 video:

video {
   transform:rotate(90deg);
}

However, this rotates the controls along with the video. Is there any way to keep the video itself rotated without also rotating the controls?

like image 945
Paul Avatar asked Apr 08 '14 04:04

Paul


2 Answers

Ok I see, you're using the native video controls. What you'll need to do is build custom controls if you want to style them separately. Here's a good tutorial on how to do that http://blog.teamtreehouse.com/building-custom-controls-for-html5-videos. Hope this helps

like image 165
Josh Rutherford Avatar answered Nov 15 '22 17:11

Josh Rutherford


Ok, For next rotate control. Add this in Css:

video::-webkit-media-controls {
 transform: scale(-1, 1);
    -webkit-transform:scale(-1, 1); /* Safari and Chrome */
    -moz-transform:scale(-1, 1); /* Firefox */
}
video::-webkit-media-controls-enclosure {
 transform: scale(-1, 1);
    -webkit-transform:scale(-1, 1); /* Safari and Chrome */
    -moz-transform:scale(-1, 1); /* Firefox */
}
like image 34
amir karami Avatar answered Nov 15 '22 18:11

amir karami