US comedian Bill Cosby has been convicted of drugging and sexually assaulting a woman in the first big celebrity trial of the #MeToo era.