Taken from https://github.com/element-hq/element-call/pull/2467/commits/d25cf28d0085b3c686001193d74351e09ad6b301