uniapp-app视频层级过高问题

使用v-html动态渲染

参考:uniapp video app端层级过高的问题,滑动渲染问题。_video在app端层级过高-CSDN博客

有想过使用原生,但是太麻烦了,然后换成了弹窗播放,但是动态的src播放失败,错误提示:

chunk-vendors.js:14882 Uncaught (in promise) DOMException: The element has no supported sources.

Failed to set the 'currentTime' property on 'HTMLMediaElement': The provided double value is non-finite."

最终代码:

javascript 复制代码
//视图 循环lists列表
<view class="swiper-container" v-html="item.html" > </view>


//方法 循环添加html属性
this.lists.forEach(item=>{
					let html=`<video muted controlslist="nodownload"	controls="controls"   src="${item.images[1].image}"  poster="${item.image}"  style="height: 500rpx;width: 100%"></video>`
						item.html=html
					})

最终实现效果

相关推荐
叱咤少帅(少帅)18 小时前
Uniapp开发pc端,小程序和APK
小程序·uni-app
2501_915918411 天前
iOS性能测试工具 Instruments、Keymob的使用方法 不局限 FPS
android·ios·小程序·https·uni-app·iphone·webview
2501_915918412 天前
iOS 混淆流程 提升 IPA 分析难度 实现 IPA 深度加固
android·ios·小程序·https·uni-app·iphone·webview
前端 贾公子2 天前
解决uni-app 输入框,键盘弹起时页面整体上移问题
前端·vue.js·uni-app
Muchen灬2 天前
【uniapp】(5) 创建gitee仓库并推送源码
gitee·uni-app
Muchen灬2 天前
【uniapp】(6) uniapp中使用vuex
uni-app
2501_915909062 天前
React Native 上架 App Store:项目运行与审核构建的流程
android·ios·小程序·https·uni-app·iphone·webview
李庆政3702 天前
uniapp+unicloud打包部署微信小程序
微信小程序·小程序·uni-app
2501_915909062 天前
苹果 Safari 浏览器抓包 页面刷新后的请求分析
android·前端·ios·小程序·uni-app·iphone·safari