Tagged: autoplay, play button
-
AuthorPosts
-
August 5, 2019 at 11:59 pm #1124918
I would like to edit the default colours of the video element using custom css. The video player currently shows like this
I would like to change the background to white, and the sections currently in white (mejs-overlay-button; mejs-button; mejs-playpause-button; mejs-play; mejs-time; mejs-button; mejs-volume-button; mejs-mute;) to #82b5d0
Any help on how to best structure the custom css would be greatly appreciated. Thanks.
August 6, 2019 at 7:46 am #1124983Hey tommyp15,
The default colors can be changed via css however the icons like the play/pause button doesn’t change because it’s an svg file and you’ll need to replace it with a dark svg file or image.
Here’s a great guide in styling wordpress’ media player: https://www.cssigniter.com/css-style-guide-for-the-default-wordpress-media-player/ under it’s “Styling the player” section just replace .mytheme-mejs-container with #top, so the code in Quick CSS should be:/* Player background */ #top .mejs-container, #top .mejs-controls, #top .mejs-embed, #top .mejs-embed body { background-color: #efefef; } /* Player controls */ #top .mejs-button > button { background-image: url(images/mejs-controls-dark.svg); } #top .mejs-time { color: #888888; } /* Progress and audio bars */ /* Progress and audio bar background */ #top .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total, #top .mejs-controls .mejs-time-rail .mejs-time-total { background-color: #fff; } /* Track progress bar background (amount of track fully loaded) We prefer to style these with the main accent color of our theme */ #top .mejs-controls .mejs-time-rail .mejs-time-loaded { background-color: rgba(219, 78, 136, 0.075); } /* Current track progress and active audio volume level bar */ #top .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current, #top .mejs-controls .mejs-time-rail .mejs-time-current { background: #db4e88; } /* Reduce height of the progress and audio bars */ #top .mejs-time-buffering, #top .mejs-time-current, #top .mejs-time-float, #top .mejs-time-float-corner, #top .mejs-time-float-current, #top .mejs-time-hovered, #top .mejs-time-loaded, #top .mejs-time-marker, #top .mejs-time-total, #top .mejs-horizontal-volume-total, #top .mejs-time-handle-content { height: 3px; } #top .mejs-time-handle-content { top: -6px; } #top .mejs-time-total { margin-top: 8px; } #top .mejs-horizontal-volume-total { top: 19px; }
Just replace the colors and the background image.
Hope this helps.Best regards,
NikkoAugust 6, 2019 at 11:37 am #1125067Hi Nikko,
Thanks for this – very informative.
I’ve implemented the custom css in general styling (having changed the colours and .svg file), however it is still showing as default. Do you know why this might be the case?
Thanks
Tommy
August 6, 2019 at 4:26 pm #1125156Hi Tommy,
Can you give a link to your site? so we can try to inspect it.
Also the svg file needs to be uploaded to your child theme first, the url in the background image needs to be changed in this code:background-image: url(images/mejs-controls-dark.svg);
Let us know if there’s a part that’s confusing.
Best regards,
NikkoAugust 7, 2019 at 1:01 am #1125327This reply has been marked as private.August 7, 2019 at 5:24 pm #1125590Hi Tommy,
Modifying the skin of the player only works if the video is local but doesn’t work on vimeo or youtube since it’s using an iframe.
As for enlarging the video via lightbox, would this do: https://kriesi.at/themes/enfold-startup/ (click on the play button).
And as for the playback settings, we apologize but video settings doesn’t provide those features yet.Best regards,
NikkoAugust 7, 2019 at 5:31 pm #1125595Hi Nikko,
We’ve reverted to Vimeo to give us greater control over the settings and player, which covers those challenges. The Lightbox effect demonstrated in that link would be amazing, and give us greater flexibility. Is there a simple way to implement this?
Best regards,
Tommy
August 8, 2019 at 3:48 pm #1125959Hi Tommy,
I see, as for lightbox demonstrated in Enfold Startup, it’s just an icon with the following settings: https://imgur.com/r0ELiFF
Hope this is helpful.Best regards,
NikkoDecember 12, 2020 at 1:40 am #1266693Hi Nikko. I would like to change the PLAY button that appears on the video from white to dark
I used your suggestion
.mejs-overlay-button {
background: url(mejs-controls-dark.svg) no-repeat;
background-position: 0 -39px;
height: 80px;
width: 80px;
}but the PLAY button remains white: where am I wrong?
I also set autoplay, but the play button appears on the first load, it is not in autoplay. For autoplay, you have to reload the page: is that right?
Many thanks Nikko. Best regards. Bruno
- This reply was modified 3 years, 11 months ago by Bruno.
December 14, 2020 at 4:58 am #1267004Hi Bruno,
I have checked on your site and the background image points to (link in private content) and it’s white in color.
You’ll need to use a different image and point it in css, if you’re not sure how to do this, then just post in private content the link to the dark play button image, then we’ll write some CSS code based on it which should work.
As for autoplay, browsers have some sets of policy which prevents autoplay, in chrome for example it needs to be muted first. Also, you can try to disable Javascript file merging and compression in Enfold > Performance.Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.