+
95
-

uniapp如何对播放的视频进行截图分享?

uniapp如何对播放的视频进行截图分享?


网友回复

+
15
-
<template>
	<view>
		<!--VIDEO标签父元素-->
		<video id="myVideo" autoplay style="height:750rpx;width:750rpx;"
			src="https://repo.bfw.wiki/bfwrepo/video/modushanghai.mp4"></video>
		<image :src="shot" style="width: 100%;height: 200px;"></image>

		<button @click="doshot">截图</button>
	</view>
</template>


<script>
	export default {
		data() {
			return {
				shot: "",
			}
		},
		methods: {
			doshot() {


				this.videoContext = uni.createVideoContext('myVideo'); //创建视频实例指向video
				this.videoContext.pause();
				this.$nextTick(() => {


					this.getCapture()
				})
			},
			getCapture() {


				let pages = getCurrentPages();
				let page = pages[pages.length - 1];
				let current...

点击查看剩余70%

我知道答案,我要回答