neomjs / neo

The application worker driven frontend framework
https://neomjs.com
MIT License
2.89k stars 162 forks source link

component.Video: errorMsg config #5675

Closed tobiu closed 2 months ago

tobiu commented 3 months ago

Defined as a boolean instead of a string.

    afterSetUrl(value, oldValue) {
        if (!value) return;

        let {vdom} = this,
            media = VDomUtil.getFlags(vdom, 'media')[0];

        media.cn = [{
            tag: 'source',
            src: value,
            type: this.type
        }, {
            tag: 'span',
            html: this.errorMsg,
        }];

        this.update()
    }

Why would you always drop in an error message for all browsers?

Except for Opera Mini, all browsers can handle it: https://caniuse.com/video

So we should not add not needed DOM nodes for others.

Dinkh commented 2 months ago

updated