title: VideoContext.showStatusBar header: develop nav: api
sidebar: videocontext_VideoContext-showStatusBar
解释:显示状态栏,仅在iOS全屏下有效。
方法参数
无
示例
扫码体验
请使用百度APP扫码
代码示例
- 在 swan 文件中
<view class="wrap"><video id="myVideo" enable-danmu="true" src="https://b.bdstatic.com/swan-temp/940fe716b0eaad38f47b209d61657490.mp4"></video><button bindtap="showStatusBar">点击显示状态栏</button></view>
- 在 js 文件中
Page({data: { },onLoad() {const videoContext = swan.createVideoContext('myVideo');this.videoContext = videoContext;this.videoContext.play();},showStatusBar() {this.videoContext.requestFullScreen({direction: 90});let that = this;setTimeout(function () {this.videoContext.showStatusBar();})}});
Bug & Tip
- bug:ios13 系统问题暂不支持本 API
