LivePlayerContext.requestFullScreen
基础库 1.38.1 开始支持本方法,这是一个同步方法。
进入全屏。
语法
LivePlayerContext.requestFullScreen(options)
参数说明
options
类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
---|---|---|---|---|
Options | 否 | 进入全屏的请求参数 | 1.44.0 |
Options 类型说明
object 类型,属性如下:
属性名 | 类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
---|---|---|---|---|---|
direction | number | 0 | 否 | 用来控制进入全屏时画面朝向 | 1.44.0 |
direction 的合法值
值 | 说明 | 最低支持版本 |
---|---|---|
0 | 正常竖向 | 1.44.0 |
90 | 屏幕逆时针 90 度 | 1.44.0 |
-90 | 屏幕顺时针 90 度 | 1.44.0 |
返回值
无
扫码体验
请使用字节宿主APP扫码
代码示例
<live-player
src="https://pull-flv-l6.ixigua.com/game/stream-106078795436654621.flv"
id="livePlayer"
style="width: 240px; height: 180px;"
/>
<view
style="display: flex; justify-content: space-between; align-items: center;"
>
<button bindtap="requestFullScreen" size="mini">RequestFullScreen</button>
</view>
Page({
livePlayerContext: undefined,
onReady() {
this.livePlayerContext = tt.createLivePlayerContext("livePlayer");
},
requestFullScreen() {
this.livePlayerContext.requestFullScreen();
},
});
Bug & Tip
无
点击纠错
该文档是否对你的开发有所帮助?
有帮助
没帮助
该文档是否对你的开发有所帮助?
有帮助
没帮助