我想将视频文件发送到客户端并使用.createObjectURL()显示视频.
节点server.js:
var fs = require("fs"),
http = require("http");
http.createServer(function (req, res) {
if (req.url == "/") {
res.writeHead(200, { "Content-Type": "text/html" });
res.end('<video id="video" src="" autoplay controls loop width="200px" height="200px" muted></video>' +
'<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>' +
'<script src="blobvideo.js"></script>');
}
else if (req.url == "/blobvideo.js") {
res.writeHead(200, { "Content-Type": "application/javascript" });
fs.readFile('./blobvideo.js', function(err, data) {
res.end(data.toString());
});
}
else if (req.url == "/video") {
fs.readFile('video.mp4', function(err, data) {
res.end(data);
});
}
}).listen(3000);
Run Code Online (Sandbox Code Playgroud)
客户端blobvideo.js:
$.ajax( "/video" ).done(function(data) {
var ab = new …Run Code Online (Sandbox Code Playgroud) 在 Safari 中打开虚拟键盘时,位置粘性不起作用
我尝试过使用position: -webkit-sticky.
非 Safari webkit 浏览器(Chrome、Firefox、Opera)中的预期行为
.sticky {
background-color: red;
position: sticky;
position: -webkit-sticky;
bottom: 0;
}
Run Code Online (Sandbox Code Playgroud)
重现步骤:
预期:即使虚拟键盘打开,红色页脚也应粘在屏幕底部实际:用户必须在键盘打开的情况下向下滚动才能看到红色页脚