| | |
| | | <template> |
| | | <div id="devicePlayer" v-loading="isLoging"> |
| | | |
| | | |
| | | <el-dialog title="视频播放" top="0" :close-on-click-modal="false" :visible.sync="showVideoDialog" :destroy-on-close="true" @close="close()"> |
| | | <!-- <LivePlayer v-if="showVideoDialog" ref="videoPlayer" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></LivePlayer> --> |
| | | <player ref="videoPlayer" :visible.sync="showVideoDialog" :videoUrl="videoUrl" :error="videoError" :message="videoError" :hasaudio="hasaudio" fluent autoplay live></player> |
| | |
| | | <p>采样率: {{item.sample_rate}}</p> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | </el-tab-pane> |
| | |
| | | searchHistoryResult: [] //媒体流历史记录搜索结果 |
| | | }, |
| | | showVideoDialog: false, |
| | | ssrc: '', |
| | | streamId: '', |
| | | convertKey: '', |
| | | deviceId: '', |
| | |
| | | this.tabActiveName = tab; |
| | | this.channelId = channelId; |
| | | this.deviceId = deviceId; |
| | | this.ssrc = ""; |
| | | this.streamId = ""; |
| | | this.videoUrl = "" |
| | | if (!!this.$refs.videoPlayer) { |
| | |
| | | console.log(val) |
| | | }, |
| | | play: function (streamInfo, hasAudio) { |
| | | |
| | | |
| | | this.hasaudio = hasAudio; |
| | | this.isLoging = false; |
| | | this.videoUrl = streamInfo.ws_flv; |
| | | this.ssrc = streamInfo.ssrc; |
| | | this.streamId = streamInfo.streamId; |
| | | this.playFromStreamInfo(false, streamInfo) |
| | | }, |
| | |
| | | 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; |
| | |
| | | }).catch(function (e) {}); |
| | | that.coverPlaying = false; |
| | | that.convertKey = ""; |
| | | if (callback )callback(); |
| | | // if (callback )callback(); |
| | | }, |
| | | |
| | | playFromStreamInfo: function (realHasAudio, streamInfo) { |
| | |
| | | }, |
| | | close: function () { |
| | | console.log('关闭视频'); |
| | | if (!this.$refs.videoPlayer){ |
| | | if (!!this.$refs.videoPlayer){ |
| | | this.$refs.videoPlayer.pause(); |
| | | } |
| | | this.videoUrl = ''; |
| | |
| | | } |
| | | this.convertKey = '' |
| | | }, |
| | | |
| | | |
| | | copySharedInfo: function (data) { |
| | | console.log('复制内容:' + data); |
| | | this.coverPlaying = false; |
| | |
| | | }, |
| | | playRecord: function (row) { |
| | | let that = this; |
| | | if (that.ssrc != "") { |
| | | if (that.streamId != "") { |
| | | that.stopPlayRecord(function () { |
| | | that.ssrc = "", |
| | | that.streamId = "", |
| | | that.playRecord(row); |
| | | }) |
| | | } else { |
| | |
| | | row.endTime |
| | | }).then(function (res) { |
| | | var streamInfo = res.data; |
| | | that.ssrc = streamInfo.ssrc; |
| | | that.streamId = streamInfo.streamId; |
| | | that.videoUrl = streamInfo.ws_flv; |
| | | }); |
| | | } |
| | |
| | | this.videoUrl = ''; |
| | | this.$axios({ |
| | | method: 'get', |
| | | url: '/api/playback/' + this.ssrc + '/stop' |
| | | url: '/api/playback/' + this.streamId + '/stop' |
| | | }).then(function (res) { |
| | | if (callback) callback() |
| | | }); |