An officer seen in a viral video throwing a bikini-clad girl to the ground and pulling a gun on other youths has resigned, says police chief.