Documentation

What is Meuuhdia?

Meuuhdia is an inclusive video player with the standard control options. You can provide translation, caption, text transcription and audio description files.
The player lets users enable and configure the display of these files themselves. They can change the colors and size of the captions to suit their needs.
This player was designed with a commitment to creating an inclusive tool. However, it has only been tested by me, so there are certainly things to improve. All feedback is welcome.

To create your caption, translation, transcription and audio description files in the Meuuhdia format, use Meuuhdia Studio: an online editor that runs entirely in your browser, without sending your files to a server.

Installation

  1. Install the player with NPM: npm install @meuuhdia/video-player
  2. Enable the player by adding the following code to your main JavaScript file (or exactly where you need it):
        
        import "@meuuhdia/video-player";
        
    

Customization

You can update the Meuuhdia CSS variables to adapt the colors to your design.

Player colors and font

    
    :root {
        --meuuhdia-color-main: #000000;
        --meuuhdia-color-secondary: #FFFFFF;
        --meuuhdia-font-family: "Luciole", consolas;
    }
    

Default caption colors and font

    
    :root {
        --meuuhdia-cue-color: #ffff00;
        --meuuhdia-cue-bgcolor: #000000;
        --meuuhdia-cue-fontsize: 2rem;
        --meuuhdia-cue-fontweight: normal;
    }
    

Usage

Copy the following code where you want to display the video player. This is the minimum code required for the player to work.

  • The "controls" attribute ensures control options are available if the native player is displayed (JavaScript disabled).
  • The [preload='metadata'] attribute is recommended: it shows the video's duration and size as soon as the page loads, without downloading the video
  • At least one <source> tag must be provided
    
    <div class="meuuhdia">
        <div class="meuuhdia_wrapper">
            <video preload="metadata" controls>
                <source src="path/to/your/video.mp4" type="video/mp4">
            </video>
        </div>
    </div>
    

Captions and translations

Meuuhdia Studio helps you create these files with the markup described below, check the quality rules and generate the text transcription.

The VTT files you provide must not contain CSS styles: Meuuhdia already applies suitable styles so that everyone can read them comfortably and adapt them to their needs.

Translation

To provide a translation of the video, the kind attribute must have the value "subtitles".

Example:

    
    <track kind="subtitles" src="path/to/your/subtitles.en.vtt" srclang="en" lang="en" label="English" />
    

Captions

To provide captions for the video, the kind attribute must have the value "captions".
Proper captions must make it possible to understand everything happening in the video with the sound off: for example, if a person reacts to a noise, that noise must be transcribed in the captions.

Example:

    
    <track kind="captions" src="path/to/your/captions.fr.vtt" srclang="fr" label="Français" />
    

For quality captions, 3 basic rules:

  • Maximum 2 lines of 40 characters per frame
  • Display for at least 600ms
  • At least 160ms between 2 captions

To benefit from all the player's features, here are the markup options and properties available for your VTT files:

  • <v John>: on-screen speaker (white)
  • <v.whisp John>: whisper or aside (parentheses)
  • <v.group>: sentence spoken by several speakers (uppercase)
  • <v.off>: off-screen speaker or voice-over (yellow, italic)
  • <c.sound>: sound effect not induced by the image (red)
  • <c.numeric>: sound effect from a phone, TV... (asterisk)
  • <v.think Narrator>: character's thought or narration (cyan)
  • <c.music>: musical indication, song lyrics (magenta)
  • <lang da>: foreign language indication, with its language code (here Danish) (green)
  • 00:10.360 --> 00:13.900 align:start: start/end (display the caption on the left/right)
  • 00:10.360 --> 00:13.900 line:1: display the caption at the top

Text transcription

To provide a text transcription of the video, the kind attribute must have the value "descriptions".
The file must be a JSON file containing a list of key/value pairs, displayed as an ordered list (e.g. {"00:10 Clara": "Hi Toto!", "00:13 Toto": "Hey Clara, how are you?"})
A proper transcription must make it possible to understand everything happening in the video from reading the text alone.

If the video has an audio description, include it in the transcription too: Meuuhdia Studio can do it automatically.

Users can display the transcription below the video or on its right. On the right, the video shrinks to leave it room. Without enough room, the transcription stays below and the position buttons are hidden. A displayed transcription stays visible in fullscreen.

Example:

    
    <track kind="descriptions" src="path/to/your/transcript.it.json" srclang="it" label="italiano" />
    

Audio description

Audio description describes what can be seen on screen for blind and visually impaired people. Meuuhdia offers two ways to provide it, which can be used together.

Recorded audio described version

If you have a version of the video with built-in audio description, add it with a <source> element carrying the data-audiodescription attribute, placed after the regular sources.
Users can switch between both versions while keeping the playback position and state.
Both versions must have the same duration and timing so captions stay in sync.

Example:

    
    <source src="path/to/your/video.mp4" type="video/mp4">
    <source src="path/to/your/video-ad.mp4" type="video/mp4" data-audiodescription>
    

Spoken descriptions

Without a recorded version, provide the descriptions in a VTT file, with the kind attribute "descriptions": the .vtt extension tells it apart from the JSON transcription.

Each cue holds, as plain text, what can be seen, placed in a silence of the video. The player reads the descriptions with the browser's speech synthesis, or sends them to the user's screen reader. If a description is longer than its cue, the video pauses until it is finished (extended audio description).

In the "Audio description" menu, users choose the language, the output (synthesized voice or screen reader), the speech rate and the automatic pause. Their settings are remembered. If the video also has a recorded version, it is offered first.

When writing your descriptions, count about 15 characters per second of reading. Meuuhdia Studio checks this duration and flags descriptions that cover a dialogue.

Example:

    
    <track kind="descriptions" src="path/to/your/descriptions.fr.vtt" srclang="fr" label="Français" />
    

Complete code example

    
    <div class="meuuhdia">
        <div class="meuuhdia_wrapper">
            <video poster="assets/poster.png" preload="metadata" controls disablePictureInPicture>
                <source src="assets/extrait.mp4" type="video/mp4">
                <source src="assets/extrait-ad.mp4" type="video/mp4" data-audiodescription>

                <track kind="subtitles" src="assets/subtitles.en.vtt" srclang="en" lang="en" label="English" />

                <track kind="captions" src="assets/captions.fr.vtt" srclang="fr" label="Français" />
                <track kind="captions" src="assets/captions.it.vtt" srclang="it" label="Italiano" />

                <track kind="descriptions" src="assets/descriptions.fr.vtt" srclang="fr" label="Français" />

                <track kind="descriptions" src="assets/transcript.fr.json" srclang="fr" label="français" />
                <track kind="descriptions" src="assets/transcript.it.json" srclang="it" label="italiano" />
            </video>
        </div>
    </div>