去除ssrc作为流ID传递,ssrc只作为sdp消息使用。动态端口的情况下支持固定流地址,同时支持未点播时直接播放流地址,代码自动发起点播

This commit is contained in:
panlinlin
2020-12-19 21:52:20 +08:00
parent 0188ffd19f
commit b0080159d9
17 changed files with 117 additions and 127 deletions

View File

@@ -187,9 +187,9 @@ export default {
url: '/api/play/' + deviceId + '/' + channelId + '?getEncoding=' + getEncoding
}).then(function (res) {
console.log(res.data)
let ssrc = res.data.ssrc;
let streamId = res.data.streamId;
that.isLoging = false;
if (!!ssrc) {
if (!!streamId) {
// that.$refs.devicePlayer.play(res.data, deviceId, channelId, itemData.hasAudio);
that.$refs.devicePlayer.openDialog("media", deviceId, channelId, {
streamInfo: res.data,
@@ -212,7 +212,7 @@ export default {
var that = this;
this.$axios({
method: 'post',
url: '/api/play/' + itemData.ssrc + '/stop'
url: '/api/play/' + itemData.streamId + '/stop'
}).then(function (res) {
console.log(JSON.stringify(res));
that.initData();

View File

@@ -158,7 +158,6 @@ export default {
searchHistoryResult: [] //媒体流历史记录搜索结果
},
showVideoDialog: false,
ssrc: '',
streamId: '',
convertKey: '',
deviceId: '',
@@ -210,7 +209,6 @@ export default {
this.tabActiveName = tab;
this.channelId = channelId;
this.deviceId = deviceId;
this.ssrc = "";
this.streamId = "";
this.videoUrl = ""
if (!!this.$refs.videoPlayer) {
@@ -238,7 +236,6 @@ export default {
this.hasaudio = hasAudio;
this.isLoging = false;
this.videoUrl = streamInfo.ws_flv;
this.ssrc = streamInfo.ssrc;
this.streamId = streamInfo.streamId;
this.playFromStreamInfo(false, streamInfo)
},
@@ -248,7 +245,7 @@ export default {
this.$refs.videoPlayer.pause()
that.$axios({
method: 'post',
url: '/api/play/' + that.ssrc + '/convert'
url: '/api/play/' + that.streamId + '/convert'
}).then(function (res) {
if (res.data.code == 0) {
that.convertKey = res.data.key;
@@ -368,9 +365,9 @@ export default {
},
playRecord: function (row) {
let that = this;
if (that.ssrc != "") {
if (that.streamId != "") {
that.stopPlayRecord(function () {
that.ssrc = "",
that.streamId = "",
that.playRecord(row);
})
} else {
@@ -380,7 +377,7 @@ export default {
row.endTime
}).then(function (res) {
var streamInfo = res.data;
that.ssrc = streamInfo.ssrc;
that.streamId = streamInfo.streamId;
that.videoUrl = streamInfo.ws_flv;
});
}
@@ -390,7 +387,7 @@ export default {
this.videoUrl = '';
this.$axios({
method: 'get',
url: '/api/playback/' + this.ssrc + '/stop'
url: '/api/playback/' + this.streamId + '/stop'
}).then(function (res) {
if (callback) callback()
});