bbc/react-transcript-editor

Alert user if html5 player is unable to play file

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.
We allow users to upload their own files, which - from time to time - results in audio or video files uploaded which are not compatible with the html5 video element. At the moment, this results in the play button not working, but no other response is given to the user. We would like to have an addtional indicator for the user that the uploaded file is not playable due to incompatibility with the html5 video element and not due to other problems.

Describe the solution you'd like
I've provided a PR which checks if a video is playing after hitting the play button. If the video is still paused, an alert with the Text 'The video player is not able to play the file. Please ensure the video format and codec is compatible with HTML5.' is shown. This would give the user some hints what is wrong. A detailed explanation could then be given in a FAQ or similar.

Describe alternatives you've considered
The solution provided could be improved by the following points:

  • There might be other cases where the video is not playing after hitting the play button. There might be a better way to check for non-compatible formats.
  • The alert is pretty barebone. A better indicator, e.g. a css pop-up, might be visually less confusing to the user and be able to explain the problem better.
  • The provided message is probably to technical to the average user, a better explanation would be good.

👋 Thanks @murezzda !
Let me think about this and discuss it with @jamesdools .

We have tackled this problem by converting the media into HTML5 compatible audio or video after the user uploads the original media.

Out of curiosity, do you do any pre-processing before sending it to the STT service?

Hi @pietrop

The option of converting the file would be the better choice, but due to resource constraints we did not implement this yet, as the speech2text service can handle the formats for itself (i.e. it does a conversion, but we can't access the converted file).

This would be a workaround for us for the moment in order to inform users that the reason the file is not playing is because the video element is unable to handle the file.