Hydrogen absorption by metallic thin films detected by optical transmittance measurements