优化bug

This commit is contained in:
wuxw 2024-07-11 15:30:36 +08:00
parent bfc1c0708b
commit e7629b79e1
5 changed files with 467 additions and 204 deletions

3
app.js
View File

@ -1,5 +1,6 @@
var createError = require('http-errors'); var createError = require('http-errors');
var express = require('express'); var express = require('express');
const cors = require('cors');
var path = require('path'); var path = require('path');
var cookieParser = require('cookie-parser'); var cookieParser = require('cookie-parser');
var logger = require('morgan'); var logger = require('morgan');
@ -25,6 +26,8 @@ app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade'); app.set('view engine', 'jade');
app.use(logger('dev')); app.use(logger('dev'));
// 使用cors中间件
app.use(cors());
// 反向代理(这里把需要进行反代的路径配置到这里即可) // 反向代理(这里把需要进行反代的路径配置到这里即可)
let opts = { let opts = {
preserveHostHdr: true, preserveHostHdr: true,

628
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@
}, },
"dependencies": { "dependencies": {
"cookie-parser": "~1.4.4", "cookie-parser": "~1.4.4",
"cors": "^2.8.5",
"debug": "~2.6.9", "debug": "~2.6.9",
"express": "~4.16.1", "express": "~4.16.1",
"express-http-proxy": "^1.6.0", "express-http-proxy": "^1.6.0",

View File

@ -44,11 +44,9 @@
<div class="col-sm-2"> <div class="col-sm-2">
<select class="custom-select" v-model="carInoutManageInfo.conditions.carType"> <select class="custom-select" v-model="carInoutManageInfo.conditions.carType">
<option selected value="">{{vc.i18n('请选择车牌类型','carInoutManage')}}</option> <option selected value="">{{vc.i18n('请选择车牌类型','carInoutManage')}}</option>
<option value="T">{{vc.i18n('临时车','carInoutManage')}}</option> <option value="1003">{{vc.i18n('临时车','carInoutManage')}}</option>
<option value="S">{{vc.i18n('出售车辆','carInoutManage')}}</option> <option value="S">{{vc.i18n('出售车辆','carInoutManage')}}</option>
<option value="H">{{vc.i18n('月租车','carInoutManage')}}</option> <option value="1001">{{vc.i18n('月租车','carInoutManage')}}</option>
<option value="W">{{vc.i18n('白名单','carInoutManage')}}</option>
<option value="B">{{vc.i18n('黑名单','carInoutManage')}}</option>
<option value="I">{{vc.i18n('内部车','carInoutManage')}}</option> <option value="I">{{vc.i18n('内部车','carInoutManage')}}</option>
<option value="NM">{{vc.i18n('免费车','carInoutManage')}}</option> <option value="NM">{{vc.i18n('免费车','carInoutManage')}}</option>
</select> </select>

33
public/v.html Normal file
View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>video</title>
<script src="https://unpkg.com/flv.js/dist/flv.min.js"></script>
</head>
<body>
<div>
<video id="my-player" preload="auto" muted autoplay type="rtmp/flv">
<source src="">
</video>
</div>
</body>
</html>
<script>
// 获取video节点
videoElement = document.getElementById('my-player');
if (flvjs.isSupported()) {
flvPlayer = flvjs.createPlayer({
type: 'flv',
isLive: true,
url: 'http://localhost:3000/output_file.flv',//flv格式流地址
},{
enableWorker: false, //不启用分离线程
enableStashBuffer: false, //关闭IO隐藏缓冲区
reuseRedirectedURL: true, //重用301/302重定向url用于随后的请求如查找、重新连接等。
autoCleanupSourceBuffer: true //自动清除缓存
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load(); //加载
flvPlayer.play();//播放
}
</script>