miru-project / miru-app

🎉 A versatile application that is free, open-source, and supports extension sources for videos, comics, and novels, available on Android, Windows, and Web platforms.
https://miru.js.org
GNU Affero General Public License v3.0
4.03k stars 163 forks source link

屏幕旋转问题Screen rotation problem #281

Open iris1598 opened 2 months ago

iris1598 commented 2 months ago

Brief summary

安卓端的软件横屏和竖屏都适配了,但是看完视频就锁定成横屏(平板)/竖屏(手机)了,我觉得这样做不值得,因为平板端竖屏阅读小说和漫画明显是一个更好的选择。 The software on the Android end has been adapted for both landscape and portrait modes, but after watching a video, it locks into landscape mode (for tablets) / portrait mode (for phones). I don't think this approach is worthwhile, because reading novels and comics in portrait mode on tablets is obviously a better choice.

Steps to reproduce

1、观看视频 2、退出视频

1、Watch video 2、Exit video

Miru version

1.8.1

Device

No response

Acknowledgements

iris1598 commented 2 months ago

好吧,我还没有看dev分支的新播放器有没有这个问题,旧的播放器确实是有这个问题。

iris1598 commented 2 months ago

新版应该还是有这个问题,问题出在lib\controllers\watch\video_controller.dart上的

@override void onClose() { if (Platform.isAndroid) { SystemChrome.setEnabledSystemUIMode( SystemUiMode.edgeToEdge, ); // 如果是平板则不改变 if (LayoutUtils.isTablet) { return; } // 切换回竖屏 SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]); } 事实上限制了屏幕的选择方向,鉴于手机上横屏体验并不怎么样,推荐直接在整个软件除了播放页的地方限制竖屏使用,或者在横屏时使用平板模式,回到竖屏时使用手机模式。(事实上,如果你在安卓手机中横着打开软件,就会变成平板模式,因为现在判断的逻辑是如果宽度大于800就是平板,但是横着打开时,读取到的宽度是长边,所以很有可能大于800。实际使用体验我觉得比纯粹的手机横屏使用好很多),而平板则取消这个限制。