视频详情评论
This commit is contained in:
@@ -14,16 +14,17 @@ export class PLVOrientationManager {
|
||||
}
|
||||
|
||||
readonly isPortrait: MutableState<boolean> = new MutableState(isPortrait())
|
||||
|
||||
requestOrientation(orientation: 'port' | 'land') {
|
||||
const context = PLVAbilityContexts.getInstance().lastContext()
|
||||
console.info('requestOrientation', orientation, context)
|
||||
const windowOrientation = orientation === 'port' ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE
|
||||
if (!context) {
|
||||
console.info('No context found')
|
||||
return
|
||||
}
|
||||
window.getLastWindow(context).then((lastWindow) => {
|
||||
console.info('Got lastWindow', lastWindow)
|
||||
lastWindow.setPreferredOrientation(windowOrientation)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user