Added initial version of automatic rotation on client side