- JS API 列表
- 基础
- 网络
- 媒体
- 地图
- 文件
- 开放接口
- 数据缓存
- 地理位置
- 设备
- 画布
- 界面
- 页面导航
- 侧边栏能力
- 行业开放
- AI/AR能力
- 第三方平台
- TTML
- 转发和挂载
- 其它
- 直播能力
VideoContext.requestFullScreen收藏我的收藏
收藏
我的收藏基础库 1.18.0 开始支持本方法,这是一个同步方法。
进入全屏。
前提条件 | 无 |
业务背景 | 无 |
使用限制 | 无 |
注意事项 | 无 |
支持沙盒 | 否 |
相关教程 | 无 |
语法
VideoContext.requestFullScreen(options)
参数说明
options 类型说明
object 类型,属性如下:
属性名 | 类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
---|---|---|---|---|---|
direction | enum | 否 | 用来控制进入全屏时画面朝向 | 1.18.0 |
direction 的合法值
值 | 说明 | 最低支持版本 |
---|---|---|
0 | 正常竖向 | 1.18.0 |
90 | 屏幕逆时针 90 度 | 1.18.0 |
-90 | 屏幕顺时针 90 度 | 1.18.0 |
返回值
无
扫码体验
请使用字节宿主APP扫码
代码示例
<video style="width: 240px; height: 180px;" />
<view style="display: flex; justify-co <button bindtap=" requestFullScreen" size="mini">RequestFullScreen</button>
</view>
Page({
videoContext: undefined,
onReady() {
this.videoContext = tt.createVideoContext("myVideo");
},
// 进入全屏
requestFullScreen() {
this.videoContext.requestFullScreen({ direction: -90 });
},
});
该文档是否有帮助?
点击纠错