I captured a short video on my Android phone in portrait mode (i.e. to be viewed vertically). When I played it on Windows 7 using WMP (or VLC), it displayed incorrectly in landscape orientation.
Thinking that I had to rotate it, I transferred the video to a Windows 10 laptop to process in After Effects. To my surprise, I found out that it plays in the correct portrait mode on Windows 10 (using whatever is the default player that comes with Windows 10), and also plays correctly when imported into After Effects, requiring no rotation.
What determines how a video is oriented during playback?