【前端】智能库房综合管理系统前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <el-dialog :close-on-click-modal="false" :visible="openVideoVisible" :before-close="handleClose" :title="videoTitle">
  3. <span class="dialog-right-top" />
  4. <span class="dialog-left-bottom" />
  5. <div class="setting-dialog">
  6. <!-- :src="videoSrc" controls-->
  7. <canvas id="canvas" width="100%" />
  8. </div>
  9. </el-dialog>
  10. </template>
  11. <script>
  12. import JSMpeg from '@/views/components/jsmpeg'
  13. export default {
  14. data() {
  15. return {
  16. openVideoVisible: false,
  17. videoTitle: '',
  18. camConfig: null,
  19. myVideo: null
  20. }
  21. },
  22. methods: {
  23. handleClose(done) {
  24. this.openVideoVisible = false
  25. // this.myVideo = document.getElementById('canvas')
  26. // this.myVideo.pause()
  27. done()
  28. },
  29. play() {
  30. // const rtspUrl = 'rtsp://' + this.camConfig.deviceInfo.deviceAccount + ':' + this.camConfig.deviceInfo.devicePassword + '@' + this.camConfig.deviceInfo.deviceIp + ':' + this.camConfig.deviceInfo.devicePort + '/' + this.camConfig.deviceInfo.videoRoute + '/1'
  31. // const data = { rtspUrl: rtspUrl, size: '1024*768' }
  32. const url = 'ws://127.0.0.1:3539'
  33. var canvas = document.getElementById('canvas')
  34. const opt = {
  35. canvas: canvas,
  36. poster: '0.jpg'
  37. }
  38. const player = new JSMpeg.Player(url, opt)
  39. console.log(player)
  40. }
  41. }
  42. }
  43. </script>
  44. <style rel="stylesheet/scss" lang="scss" scoped>
  45. </style>