Commit 288059eecd5af4722841b1b1ac0d9131a1f02545

Authored by 648540858
Committed by GitHub
2 parents b6688bae 9c9ca912

Merge pull request #12 from lawrencehj/master

修正转码播放重复回调的错误
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java
... ... @@ -88,9 +88,6 @@ public class SIPRequestHeaderProvider {
88 88 viaHeader.setRPort();
89 89 viaHeaders.add(viaHeader);
90 90  
91   - viaHeader = sipFactory.createHeaderFactory().createViaHeader(sipConfig.getSipIp(), sipConfig.getSipPort(), device.getTransport(), viaTag);
92   - viaHeader.setRPort();
93   - viaHeaders.add(viaHeader);
94 91 //from
95 92 SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getSipId(),sipConfig.getSipDomain());
96 93 Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI);
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
... ... @@ -384,16 +384,22 @@ public class SIPCommander implements ISIPCommander {
384 384 }
385 385 String streamMode = device.getStreamMode().toUpperCase();
386 386 if("TCP-PASSIVE".equals(streamMode)) {
387   - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 98 97\r\n");
  387 + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n");
388 388 }else if ("TCP-ACTIVE".equals(streamMode)) {
389   - content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 98 97\r\n");
  389 + content.append("m=video "+ mediaPort +" TCP/RTP/AVP 126 125 99 34 98 97 96\r\n");
390 390 }else if("UDP".equals(streamMode)) {
391   - content.append("m=video "+ mediaPort +" RTP/AVP 96 98 97\r\n");
  391 + content.append("m=video "+ mediaPort +" RTP/AVP 126 125 99 34 98 97 96\r\n");
392 392 }
393   - content.append("a=recvonly\r\n");
394   - content.append("a=rtpmap:96 PS/90000\r\n");
395   - content.append("a=rtpmap:98 H264/90000\r\n");
396   - content.append("a=rtpmap:97 MPEG4/90000\r\n");
  393 + content.append("a=recvonly\r\n");
  394 + content.append("a=fmtp:126 profile-level-id=42e01e\r\n");
  395 + content.append("a=rtpmap:126 H264/90000\r\n");
  396 + content.append("a=rtpmap:125 H264S/90000\r\n");
  397 + content.append("a=fmtp:125 profile-level-id=42e01e\r\n");
  398 + content.append("a=rtpmap:99 MP4V-ES/90000\r\n");
  399 + content.append("a=fmtp:99 profile-level-id=3\r\n");
  400 + content.append("a=rtpmap:98 H264/90000\r\n");
  401 + content.append("a=rtpmap:97 MPEG4/90000\r\n");
  402 + content.append("a=rtpmap:96 PS/90000\r\n");
397 403 if("TCP-PASSIVE".equals(streamMode)){ // tcp被动模式
398 404 content.append("a=setup:passive\r\n");
399 405 content.append("a=connection:new\r\n");
... ...
web_src/src/components/gb28181/devicePlayer.vue
... ... @@ -296,7 +296,7 @@ export default {
296 296 }).catch(function (e) {});
297 297 that.coverPlaying = false;
298 298 that.convertKey = "";
299   - if (callback )callback();
  299 + // if (callback )callback();
300 300 },
301 301  
302 302 playFromStreamInfo: function (realHasAudio, streamInfo) {
... ... @@ -306,7 +306,7 @@ export default {
306 306 },
307 307 close: function () {
308 308 console.log('关闭视频');
309   - if (!this.$refs.videoPlayer){
  309 + if (!!this.$refs.videoPlayer){
310 310 this.$refs.videoPlayer.pause();
311 311 }
312 312 this.videoUrl = '';
... ...