The changes in this PR are supposed to ensure that the render loop in the native part of the code is not called if the window of the Native Player is not ready (e.g. not there anymore or not yet) as well as the Native Player does not ask for the rendering if it shouldn't.
While this might not solve the problem entirely, it's an easy step in the right direction and code that we need in any case.
[x] Self-review: I am confident this is the simplest and clearest way to achieve the expected behaviour
[x] There are no dependencies on other PRs or I have linked dependencies through Zenhub
[x] The commit messages are clean and understandable
[ ] Tests for the changes have been added (for bug fixes / features)
[x] Code runs on all relevant platforms (if major change: screenshots attached)
Fixes # https://github.com/flowkey/smartphone-app/issues/977 (possibly only partly)
Type of change: Bug fix / improving code stability
Motivation
The problem relates to https://github.com/flowkey/smartphone-app/issues/977 (sometimes app crashes on player start from portrait) and also to https://app.zenhub.com/workspace/o/flowkey/smartphone-app/issues/979 (render loop called even after user exits Player).
The changes in this PR are supposed to ensure that the render loop in the native part of the code is not called if the window of the Native Player is not ready (e.g. not there anymore or not yet) as well as the Native Player does not ask for the rendering if it shouldn't.
While this might not solve the problem entirely, it's an easy step in the right direction and code that we need in any case.