This is an old thread, but if you're still having trouble with audio playing automatically, maybe this post will help...
Instead of...
webConfiguration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone
Try using...
webConfiguration.mediaTypesRequiringUserActionForPlayback = []