<template>
<view class="main">
<video class="video" id="video" ref="video" src="https://res.yixueyice.com/stg/slowmotionadmin/1778/f7029916d5134fc5a4d7281c8439435f">
</video>
</view>
</template>
<script setup>
import { onReady } from '@dcloudio/uni-app';
import { ref } from 'vue';
const videoContext = ref(null); //视频上下文
onReady(() => {
videoContext.value = uni.createVideoContext('video');
videoContext.value.requestFullScreen({ direction: 0 });
videoContext.value.play();
});
</script>
<style lang="scss" scoped>
</style>



- 发布:2024-12-11 17:30
- 更新:2024-12-11 17:30
- 阅读:94
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: windows11家庭中文版 23H2
HBuilderX类型: 正式
HBuilderX版本号: 4.36
手机系统: iOS
手机系统版本号: iOS 18
手机厂商: 苹果
手机机型: iPhone Xs
页面类型: nvue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
新建nvue页面,运行自定义基座
新建nvue页面,运行自定义基座
预期结果:
视频全屏播放
视频全屏播放
实际结果:
代码无效,没有任何反应
代码无效,没有任何反应
bug描述:
以下代码,在vue页面中可全屏播放,在nvue页面中无效。
0 个回复