当前在web里暂时不支持使用js或css来实现横屏,需要ArkUI的媒体查询接口实现横屏,可以在web的onFullScreenEnter和onFullScreenExit回调中监听是否点击全屏的按键,在这两个回调里使用媒体查询接口实现视频横向和竖向。参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-mediaquery-V5https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-web-V5\#onfullscreenenter9https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-web-V5\#onfullscreenexit9
当前在web里暂时不支持使用js或css来实现横屏,需要ArkUI的媒体查询接口实现横屏,可以在web的onFullScreenEnter和onFullScreenExit回调中监听是否点击全屏的按键,在这两个回调里使用媒体查询接口实现视频横向和竖向。
参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-mediaquery-V5
https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-web-V5\#onfullscreenenter9
https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-web-V5\#onfullscreenexit9