HarmonyOS 鸿蒙Next web组件视频播放问题
HarmonyOS 鸿蒙Next web组件视频播放问题
通过url加载的链接,里面的视频可以播放,
加载的html内容有视频的话播放不了
.onControllerAttached(() => {
if (this.data.content.length > 0) {
// 有本地html内容
this.webController.loadData(this.htmlContent, “text/html”, ‘base64’)
}
})
html内容
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“UTF-8”>
<!-- <meta name=“viewport” content=“width=device-width, initial-scale=1.0”>–>
<meta name=“viewport” content=“width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no”>
<title>{{title}}</title>
<style>
img {
max-width: 100% !important;
}
p {
word-break: break-all !important
}
</style>
<script type=“text/javascript”>
function imgClick(tag) {
}
function getImages(){
var objs = document.getElementsByTagName(“img”);
var imgScr = ‘’;
for(var i=0;i<objs.length;i++){
imgScr = imgScr + objs[i].src + ‘+’;
};
return imgScr;
}
function addEvent() {
}
</script>
</head>
<body>
<video src=“https://vdept3.bdstatic.com/mda-qdqxvr04ju7kwxez/cae_h264/1714102071853507436/mda-qdqxvr04ju7kwxez.mp4?v_from_s=hkapp-haokan-nanjing&auth_key=1723700839-0-0-41b2d70613297586f2bb12f0a925dd0c&bcevod_channel=searchbox_feed&pd=1&cr=0&cd=0&pt=3&logid=2839682962&vid=2405378101862107884&klogid=2839682962&abtest=” type=“video/mp4” autostart=“false” loop=“true” controls=“controls” />
</body>
</html>
关于HarmonyOS 鸿蒙Next web组件视频播放问题的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。