This is solved from iOS 13 onwards. With any website open, tap the "AA" icon in the top-left. Then tap "Website Settings" which will enable you to set camera permissions to "Allow" instead of "Ask".
Unfortunately this setting is not available before iOS 13.