startVideoOrientationService static method

Future<bool?> startVideoOrientationService()

Starts listening for device rotation direction. After it is turned on, if the device's auto-rotation is turned on, the player will automatically rotate the video direction based on the current device orientation.

This interface is currently only applicable to the Android side, and the iOS side will automatically enable this feature

Before calling this interface, please be sure to inform the user of the privacy risks. If necessary, confirm whether you have permission to access the rotation sensor. @return true: success false: failure, due to premature enabling, waiting for context initialization, failure to obtain sensor, etc.

开始监听设备旋转方向,开启之后,如果设备自动旋转打开,播放器会自动根据当前设备方向来旋转视频方向。

该接口目前只适用安卓端,IOS端会自动开启该能力

在调用该接口前,请务必向用户告知隐私风险。 如有需要,请确认是否有获取旋转sensor的权限。 @return true : 开启成功 false : 开启失败,如开启过早,还未等到上下文初始化、获取sensor失败等原因

Implementation

static Future<bool?> startVideoOrientationService() async {
  BoolMsg boolMsg = await _playerPluginApi.startVideoOrientationService();
  return boolMsg.value;
}