Skip to content

Cannot change color theme #2596

Answered by trymeouteh
trymeouteh asked this question in Q&A
Discussion options

You must be logged in to vote

Found a solution. Turns out You need to add a DIV wrapper around the video and edit the CSS variable on that DIV element.

<link rel="stylesheet" href="node_modules/plyr/dist/plyr.css">

<style>
    #myVideoPlayer,
    #myYouTubeVideo {
        --plyr-color-main: red;
    }
</style>





<div id="myVideoPlayer">
    <video controls src="video.mp4">
    </video>
</div>

<div id="myYouTubeVideo">
    <iframe src="https://www.youtube.com/embed/bTqVqk7FSmY" frameborder="0" allowfullscreen></iframe>
</div>



<script src="node_modules/plyr/dist/plyr.min.js"></script>

<script>
    new Plyr('#myVideoPlayer video');

    new Plyr('#myYouTubeVideo');
</script>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by trymeouteh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant