最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

css - HTML5 <video> background not transparent on iOS - Stack Overflow

matteradmin7PV0评论

I need to use a HTML5 video tag to display a webm file which plays in a loop. I do not want to show any video background or controls. Currently, it looks like this:

.my_video {
    display: block;  
    border: none;  
    outline: none;  
    pointer-events: none;  
    background-color: transparent !important;  

    &::-webkit-media-controls,  
    &::-webkit-media-controls-panel,  
    &::-webkit-media-controls-play-button,  
    &::-webkit-media-controls-start-playback-button {  
        display: none !important;  
        -webkit-appearance: none !important;  
    }  
}

<video className={styles.my_video} autoPlay loop muted playsInline>
    <source src="/mywebmfile.webm" type="video/webm"/>
</video>

It works on all systems and browsers, but on all browsers iOS mobile devices. There, the video has a black background although the background should be transparent. What do I need to change?

Post a comment

comment list (0)

  1. No comments so far