사파리와 크롬의 브라운저 엔진 자체의 정책에서 음소거 요소를 추가해 줘야 한다.(자동재생시 제한이 있음)
import React from "react";
import Footer from "../Components/Footer";
import Menubar from "../Components/Menubar";
import Totop from "../Components/Totop";
import "./Main.css";
import mainvideo_sample from "../../assets/images/etc/mainvideo_sample.png";
import project1 from "../../assets/videos/project1.mp4";
export default function Main() {
return (
<div
id="content"
className="content"
style={{
height: "100vh"
// backgroundColor: "#000"
}}
>
<Menubar slideIndex={0} />
<Totop />
<div id="main">
<video
controls={false}
muted={true}
loop={true}
autoPlay={true}
src={project1}
alt="project1"
/>
</div>
</div>
);
}
#content {
overflow: hidden;
}
#main {
position: relative;
height: 100%;
}
#main video {
position: absolute;
top: 0;
left: 0;
height: 100%;
}
@media screen and (max-height: 1018px) {
#main video {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
height: 1018px;
}
}
'NEW(스크립트용)' 카테고리의 다른 글
특정 페이지에서 새로고침 (0) | 2022.07.06 |
---|---|
position:sticky (0) | 2022.06.30 |
flex-direction (0) | 2022.06.24 |
input checkbox react에서 ui변경(html과 다름) (0) | 2022.06.15 |
html에서 자주 쓰이는 특수문자, 특수기호, 이모지 (0) | 2022.05.24 |