bytedance / xgplayer

A HTML5 video player with a parser that saves traffic
https://h5player.bytedance.com/
MIT License
8.06k stars 845 forks source link

color属性值为false时还是使用style属性 #1376

Open startjava opened 3 months ago

startjava commented 3 months ago

https://github.com/bytedance/xgplayer/issues/864 根据上面的提示,发现color和style是结合使用的,但color是false时还是使用style样式,文字还是绿色的,示例代码如下:

import {createApp, onMounted} from 'vue'
import Player from 'xgplayer';
import 'xgplayer/dist/index.min.css';
import Danmu from 'xgplayer/es/plugins/danmu'
import 'xgplayer/es/plugins/danmu/index.css'

createApp({
    setup() {
        onMounted(() => {
            const comments = [{
                duration: 10000,
                id: 1,
                start: 1000,
                color: true,
                txt: "我是弹幕1",
                style: {
                    color: 'red',
                    fontSize: '20px',
                    padding: '0px 0px'
                },
                mode: "scroll"
            }, {
                duration: 10000,
                id: 2,
                start: 1000,
                color: false,
                txt: "我是弹幕2",
                style: {
                    color: 'green',
                    fontSize: '20px',
                    padding: '0px 0px'
                },
                mode: "scroll"
            }
            ];

            let player = new Player({
                id: 'xgplayerDiv',
                url: '../xgplayer-demo-720p.mp4',
                height: '100%',
                width: '100%',
                plugins: [Danmu],
                danmu: {
                    comments: comments
                }
            });
        });
    }
}).mount("#mydiv1");

运行效果如下: image

color都false了,文字不应该是彩色的啊。

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.