mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
Update Properties.md
This commit is contained in:
1 parent
565a4c3216
commit
a6fe955fe8
1 file changed
+26
-1
@@ -487,4 +487,29 @@ art.on('ready', () => {
|
|||||||
art.autoSize = true;
|
art.autoSize = true;
|
||||||
console.info(art.autoSize);
|
console.info(art.autoSize);
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## rect
|
||||||
|
|
||||||
|
- 类型: `Getter`
|
||||||
|
|
||||||
|
获取播放器的尺寸和坐标信息
|
||||||
|
|
||||||
|
<div className="run-code">▶ Run Code</div>
|
||||||
|
|
||||||
|
```js
|
||||||
|
var art = new Artplayer({
|
||||||
|
container: '.artplayer-app',
|
||||||
|
url: '/assets/sample/video.mp4',
|
||||||
|
});
|
||||||
|
|
||||||
|
art.on('ready', () => {
|
||||||
|
console.info(JSON.stringify(art.rect));
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
:::tip 提示
|
||||||
|
|
||||||
|
尺寸和坐标信息是通过 `getBoundingClientRect` 获取的
|
||||||
|
|
||||||
|
:::
|
||||||
Reference in new issue
Block a user