h5p / h5p-audio

10 stars 45 forks source link

Fix full player height for Chromium based browsers if fitToWrapper is set #48

Open otacke opened 3 years ago

otacke commented 3 years ago

Problem: When using the full player mode with the fitToWrapper option, Chromium based browsers like Chrome, Edge or Opera will set a height of 0 unless the audio content's wrapper has an explicit size set. That problem occurs in Column, for example - audio content in full player mode with fitToWrapper set will not show on Chrome.

Fix: Apply Chromium's default height for audio elements (54 px) if a Chromium based browser is used in full player mode with the fitToWrapper option set.

Please note: Yes, it's kind of counter-intuitive to set an absolute height when the option is called fitToWrapper, but other browsers like Safari or Firefox have a fixed height anyway and will never scale the audio player to the full height of the wrapper. On the plus side, adding the height to this very audio library instead of setting it in every content type makes developing for H5P easier.