我将来自youtube的视频嵌入到我的网页中,我想让它在屏幕上100%拉伸,没有黑条.虽然我给它的宽度为100%,但它仍然在视频的两侧有一些黑条.我怎么能摆脱它?
截图:
摘录:https://jsfiddle.net/o3rp6an9/1/
<div id="video">
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/zWAiQJvwb8Q?autoplay=1&loop=1&controls=0&rel=0&showinfo=0&playlist=zWAiQJvwb8Q&modestbranding=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
</div>
#video {
height:100%;
width:100% !important;
background-size:100% 100%;
position:relative;
overflow:hidden;
}
Run Code Online (Sandbox Code Playgroud)
还有另一个问题,但它基本上没有帮助我.
我想知道是否有办法检测我在我的网站上使用的javascript文件的源代码已更改?我在其中使用ajax,我觉得它应该更安全,因为代码可以很容易地改变.我可以做的事情就像每次php文件打开它可以下载js文件并手动检查代码是否在一些if else结构的帮助下发生了变化.但它会健康吗?
我正在尝试使用 nginx 代理传递 node.js-socket.io 应用程序。
客户端是一个 html 文件,其中包含一些 javascript;
<html>
<head>
<script src="socket.io.js"></script>
<script>
var socket = io('http://localhost:80');
socket.on('welcome', function(data){
console.log('Server says:' + data);
socket.emit('client-response', 'thank you!');
});
</script>
</head>
<body>
Socket.io
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
而应该在 nginx.conf 文件中代理传递的服务器块是这个;
server {
listen 80;
listen [::]:80;
#root /usr/share/nginx/html;
include /etc/nginx/default.d/*.conf;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass "http://localhost:2156";
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
} …Run Code Online (Sandbox Code Playgroud)