0

我正在使用 Videogular。我想动态设置高度和宽度。我如何设置值

videojs.options.width = sizeWidth;
videojs.options.height = sizeHeight;

这是为视频设置宽度和高度的正确方法吗?

4

1 回答 1

0

如果您想Videogular在响应式网站中自动调整大小,您可以设置vg-responsive="true"并将Videogular其放入其容器中。

但是,如果您想手动更改大小,则必须更改已绑定到的属性vg-widthvg-height,就像您在代码中所做的那样。也许你的 HTML 是错误的,所以它应该是这样的:

<videogular vg-width="videojs.options.width" vg-height="videojs.options.height" vg-responsive="false" vg-theme="config.theme.url">
    <video vg-src="videojs.options.sources" preload='metadata'>
        <!-- You can also have sources here and remove vg-src="videojs.options.sources" -->
    </video>
</videogular>
于 2014-03-23T09:21:59.720 回答