Browse Source

优化播放器以及部分日志

pull/93/head
panlinlin 4 years ago
parent
commit
c566d4d7cf
  1. 1
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java
  2. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
  3. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java
  4. 13
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java
  5. 4
      web_src/build/webpack.dev.conf.js
  6. 4
      web_src/build/webpack.prod.conf.js
  7. 6
      web_src/package-lock.json
  8. 1
      web_src/package.json
  9. 6
      web_src/src/router/index.js
  10. 19
      web_src/static/js/EasyWasmPlayer.js
  11. BIN
      web_src/static/libDecoder.wasm

1
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java

@ -70,6 +70,7 @@ public class SIPRequestHeaderProvider {
//via //via
ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>(); ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>();
ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(device.getIp(), device.getPort(), device.getTransport(), viaTag); ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(device.getIp(), device.getPort(), device.getTransport(), viaTag);
// ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(sipConfig.getSipIp(), sipConfig.getSipPort(), device.getTransport(), viaTag);
viaHeader.setRPort(); viaHeader.setRPort();
viaHeaders.add(viaHeader); viaHeaders.add(viaHeader);

2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java

@ -376,7 +376,7 @@ public class SIPCommander implements ISIPCommander {
// //
StringBuffer content = new StringBuffer(200); StringBuffer content = new StringBuffer(200);
content.append("v=0\r\n"); content.append("v=0\r\n");
// content.append("o="+channelId+" 0 0 IN IP4 "+mediaInfo.getWanIp()+"\r\n"); // content.append("o=" + sipConfig.getSipId() + " 0 0 IN IP4 "+mediaInfo.getWanIp()+"\r\n");
content.append("o="+"00000"+" 0 0 IN IP4 "+mediaInfo.getWanIp()+"\r\n"); content.append("o="+"00000"+" 0 0 IN IP4 "+mediaInfo.getWanIp()+"\r\n");
content.append("s=Play\r\n"); content.append("s=Play\r\n");
content.append("c=IN IP4 "+mediaInfo.getWanIp()+"\r\n"); content.append("c=IN IP4 "+mediaInfo.getWanIp()+"\r\n");

2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/response/impl/RegisterResponseProcessor.java

@ -27,7 +27,7 @@ import javax.sip.message.Response;
@Component @Component
public class RegisterResponseProcessor implements ISIPResponseProcessor { public class RegisterResponseProcessor implements ISIPResponseProcessor {
private Logger logger = LoggerFactory.getLogger(RegisterRequestProcessor.class); private Logger logger = LoggerFactory.getLogger(RegisterResponseProcessor.class);
@Autowired @Autowired
private ISIPCommanderForPlatform sipCommanderForPlatform; private ISIPCommanderForPlatform sipCommanderForPlatform;

13
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java

@ -13,6 +13,7 @@ import java.io.IOException;
import java.net.ConnectException; import java.net.ConnectException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
@Component @Component
public class ZLMRESTfulUtils { public class ZLMRESTfulUtils {
@ -40,7 +41,7 @@ public class ZLMRESTfulUtils {
FormBody.Builder builder = new FormBody.Builder(); FormBody.Builder builder = new FormBody.Builder();
builder.add("secret",mediaSecret); builder.add("secret",mediaSecret);
if (param != null) { if (param != null && param.keySet().size() > 0) {
for (String key : param.keySet()){ for (String key : param.keySet()){
builder.add(key, param.get(key).toString()); builder.add(key, param.get(key).toString());
} }
@ -65,7 +66,7 @@ public class ZLMRESTfulUtils {
logger.error(String.format("连接ZLM失败: %s, %s", e.getCause().getMessage(), e.getMessage())); logger.error(String.format("连接ZLM失败: %s, %s", e.getCause().getMessage(), e.getMessage()));
logger.info("请检查media配置并确认ZLM已启动..."); logger.info("请检查media配置并确认ZLM已启动...");
}catch (IOException e) { }catch (IOException e) {
e.printStackTrace(); logger.error(String.format("[ %s ]请求失败: %s", url, e.getMessage()));
} }
}else { }else {
client.newCall(request).enqueue(new Callback(){ client.newCall(request).enqueue(new Callback(){
@ -74,14 +75,10 @@ public class ZLMRESTfulUtils {
public void onResponse(@NotNull Call call, @NotNull Response response){ public void onResponse(@NotNull Call call, @NotNull Response response){
if (response.isSuccessful()) { if (response.isSuccessful()) {
try { try {
String responseStr = response.body().string(); String responseStr = Objects.requireNonNull(response.body()).string();
if (responseStr != null) {
callback.run(JSON.parseObject(responseStr)); callback.run(JSON.parseObject(responseStr));
}else {
callback.run(null);
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.error(String.format("[ %s ]请求失败: %s", url, e.getMessage()));
} }
} }
} }

4
web_src/build/webpack.dev.conf.js

@ -63,9 +63,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
from: path.resolve(__dirname, '../static'), from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory, to: config.dev.assetsSubDirectory,
ignore: ['.*'] ignore: ['.*']
}, }
{ from: 'node_modules/@easydarwin/easywasmplayer/libDecoder.wasm', to: 'static/'},
{ from: 'node_modules/@easydarwin/easywasmplayer/EasyWasmPlayer.js', to: 'static/js/'}
]) ])
] ]
}) })

4
web_src/build/webpack.prod.conf.js

@ -114,9 +114,7 @@ const webpackConfig = merge(baseWebpackConfig, {
from: path.resolve(__dirname, '../static'), from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory, to: config.build.assetsSubDirectory,
ignore: ['.*'] ignore: ['.*']
}, }
{ from: 'node_modules/@easydarwin/easywasmplayer/libDecoder.wasm', to: 'static/'},
{ from: 'node_modules/@easydarwin/easywasmplayer/EasyWasmPlayer.js', to: 'static/js/'}
]) ])
] ]
}) })

6
web_src/package-lock.json

@ -5,9 +5,9 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@easydarwin/easywasmplayer": { "@easydarwin/easywasmplayer": {
"version": "4.0.7", "version": "4.0.12",
"resolved": "https://registry.npm.taobao.org/@easydarwin/easywasmplayer/download/@easydarwin/easywasmplayer-4.0.7.tgz", "resolved": "https://registry.npm.taobao.org/@easydarwin/easywasmplayer/download/@easydarwin/easywasmplayer-4.0.12.tgz",
"integrity": "sha1-FNtIUXbdwIWdalvIMEaH0+zUGx4=" "integrity": "sha1-8Isg0HkYtHHQ20PLnCTHsOjw7lA="
}, },
"@types/q": { "@types/q": {
"version": "1.5.4", "version": "1.5.4",

1
web_src/package.json

@ -10,7 +10,6 @@
"build": "node build/build.js" "build": "node build/build.js"
}, },
"dependencies": { "dependencies": {
"@easydarwin/easywasmplayer": "^4.0.7",
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"echarts": "^4.7.0", "echarts": "^4.7.0",

6
web_src/src/router/index.js

@ -9,6 +9,7 @@ import streamProxyList from '../components/StreamProxyList.vue'
import devicePosition from '../components/devicePosition.vue' import devicePosition from '../components/devicePosition.vue'
import login from '../components/Login.vue' import login from '../components/Login.vue'
import parentPlatformList from '../components/ParentPlatformList.vue' import parentPlatformList from '../components/ParentPlatformList.vue'
import test from '../components/test.vue'
const originalPush = VueRouter.prototype.push const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) { VueRouter.prototype.push = function push(location) {
@ -56,6 +57,11 @@ export default new VueRouter({
path: '/devicePosition/:deviceId/:parentChannelId/:count/:page', path: '/devicePosition/:deviceId/:parentChannelId/:count/:page',
name: 'devicePosition', name: 'devicePosition',
component: devicePosition, component: devicePosition,
},,
{
path: '/test',
name: 'test',
component: test,
}, },
] ]
}) })

19
web_src/static/js/EasyWasmPlayer.js

File diff suppressed because one or more lines are too long

BIN
web_src/static/libDecoder.wasm

Binary file not shown.
Loading…
Cancel
Save