gpt4 book ai didi

html - 桌面查看不同的视频和移动查看不同的视频自动播放

转载 作者:行者123 更新时间:2023-12-05 03:50:05 25 4
gpt4 key购买 nike

Place help me...我会尝试将视频放在桌面屏幕上,并且该视频的宽度和高度为 100%。任何用户在桌面上访问我们的网站都是为了观看此视频。

但在移动 View 上打开此页面以更改视频。在移动端观看不同的视频播放。

**Both Screen video autoplay **

请帮我解决这个问题。

**this is my code..**

<html>
<head>
<title>video</title>
</head>
<body>

<video width="100%" height="100%">
<source src="https://www.w3schools.com/howto/rain.mp4" type="video/mp4">
<source src="https://www.w3schools.com/howtorain.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>

打开移动 View 和桌面 View 播放不同的视频并且都自动播放。

最佳答案

通过提供单独的类移动桌面播放视频

喜欢..

<video class="desktop" controls autoplay>
<source src="Fumefx colored smoke.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

<video class="mobile" controls autoplay>
<source src="mobile.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

给我们 css 来隐藏广告鞋......

.desktop{
width:100%;
height:100vh;
display:block;
}
.mobile{
display:none;
}
@media only screen and (max-width: 600px) {
.desktop{
display:none;
}
.mobile{
width:100%;
height:100vh;
display:block;
}
}

关于html - 桌面查看不同的视频和移动查看不同的视频自动播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63650848/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com