-
Notifications
You must be signed in to change notification settings - Fork 843
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
视频视口显示异常,video无法随id="mse"的宽高自动变化 #1490
Comments
@getongoing js import的方式也不生效吗? |
demo就是官方demo,没做任何变动,环境为uniapp H5,开启link就对了··· UNIAPP-H5 代码 codes<template>
<!-- <link rel="stylesheet" href="https://unpkg.byted-static.com/xgplayer/3.0.10/dist/index.min.css"> -->
<view class="player">
<view id="mse"></view>
</view>
</template>
<script setup>
import Player from 'xgplayer';
import 'xgplayer/dist/index.min.css';
import {
onMounted,
onUnmounted,
ref
} from "vue";
const xgplayer = ref(null)
onMounted(() => {
xgplayer.value = new Player({
id: 'mse',
url: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',
width: '100%'
})
})
onUnmounted(() => {
xgplayer.value.destroy()
xgplayer.value = null
})
</script> |
@getongoing UNiApp应该不支持JS中引入CSS,以官方的方式导入为准, UniApp应该是有自己的打包规则。xgplayer官网中的引入方式,支持rollup以及webpack |
uni的bug,改成这样就行了
|
您使用的西瓜播放器版本是多少? What version of xgplayer are you using?
3.0.17
您使用的操作系统和浏览器分别是? What OS and browser are you using?
win10+edge,F12模拟移动端
您期望的播放器正常行为是? What did you expect to happen?
同官网examples,在video上面应该有一个h100%、w100%才对,但是实际video上面没有任何css属性(已经确定应用并生效index.min.css)。
导致:
video的尺寸永远都是视频的真实尺寸,无法适配父元素宽度
尝试把“import 'xgplayer/dist/index.min.css';”改为 正常···
尝试把“import 'xgplayer/dist/index.min.css';”改为<style>@import url("xgplayer/dist/index.min.css");</style> 结果同js import 不正常···
The text was updated successfully, but these errors were encountered: