<template>
<view class="content">
<uv-button type="primary" size="small" text="录像开始" @click="takePhoto"></uv-button>
</view>
</template>
<script setup>
import {
onMounted,
nextTick,
ref
} from 'vue';
let cameraContext;
onMounted(() => {
/* 注意 */
console.log(uni);
cameraContext = uni.createCameraContext();
uni.authorize({
scope: 'scope.camera',
success() {
console.log('授权了摄像头')
}
})
})
const takePhoto = () => {
cameraContext.takePhoto();
}
const stopPhoto = () => {
cameraContext.stop();
}
</script>
<style>
.popup-content {
width: 100%;
min-height: 50vh;
padding: 30rpx;
}
</style>
w***@126.com (作者)
那app如何实现拍照录像呢?
2024-11-29 14:50
靐齉齾麤龖龗
回复 w***@126.com: uniapp可以使用plus.camera,uniappx不知道,应该要写uts来实现
2024-11-29 15:02
靐齉齾麤龖龗
回复 靐齉齾麤龖龗: 或者插件市场下个插件
2024-11-29 15:04