vue2 XixunPlayer 获取截屏

vue yekong

使用vue开发实现XixunPlayer的功能.

XixunPlayer 获取截屏

/**
* @Author: 858834013@qq.com
* @Name: screenshot
* @Date: 2022-04-26
* @Desc: XixunPlayer 获取截屏
*/
<template>
  <div>
    <el-button class="mb20" @click="getdata" size="mini" type="primary">获取截图</el-button>
    <el-dialog
      title="获取截图"
      :visible.sync="dialogVisible"
      width="30%">
      <div class="screenshots">
        <img v-if="img" :src="img" alt="">
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { getdata } from '@/api/led/led'

export default {
  name: 'pop',
  components: {},
  data () {
    return {
      dialogVisible: false,
      img: ''
    }
  },
  props: {
    id: {
      type: String,
      default () {
        return ''
      }
    }
  },
  methods: {
    getdata () {
      var that = this
      getdata(that.id, {
        type: 'callCardService',
        fn: 'screenshot',
        arg1: 100,
        arg2: 100
      }).then(function (res) {
        console.log(res)
        that.img = 'data:image/png;base64,' + res.result
        that.dialogVisible = true
      })
    },
  }
}
</script>

喜欢