Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uniapp h5页面视频无法铺满屏幕,全屏时视频只在左上角区域部分显示 #1615

Open
feng4108 opened this issue Sep 23, 2024 · 0 comments

Comments

@feng4108
Copy link

image
image
依赖版本: "xgplayer": "^3.0.20", "xgplayer-flv": "^3.0.20"
代码:




{{ title }}



<script setup lang="ts"> import { ref, nextTick } from 'vue'; import { onLaunch, onLoad, onShow, onHide, onUnload, onReady } from "@dcloudio/uni-app"; import 'xgplayer/dist/index.min.css'; // 引入西瓜播放器样式 import Player from 'xgplayer'; // 引入西瓜播放器 import FlvPlugin from 'xgplayer-flv'; let player = ref(null); const title = ref('Hello') onShow(()=>{ nextTick(()=>{ if(FlvPlugin.isSupported()){ let player = new Player({ id: 'mse', url: '//sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv', isLive: true, playsinline: true, autoplay:true, height: 360, width: "100%", plugins: [FlvPlugin], }); }else{ console.log('不支持flv播放'); } }); }); </script> <style> .content { display: flex; flex-direction: column; align-items: center; justify-content: center; } .mse {flex:auto;} .logo { height: 50rpx; width: 50rpx; margin-top: 200rpx; margin-left: auto; margin-right: auto; margin-bottom: 50rpx; } .text-area { display: flex; justify-content: center; } .title { font-size: 36rpx; color: #8f8f94; } </style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant