For Android web you can try some of these. I remember some of them working. It doesn’t work on iOS though I think.
There is also a CSS method you can do, which I have not tested before but I know about. You detect mobile and then set some CSS to rotate the document. So if the orientation is landscape you would apply transform: rotate(90 deg) on search engines try searching for like “css rotate canvas portrait html5 ios” to find useful articles to give an idea on how to do that.