Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • We are using the video js plugin for enabling the transcripts selection in the player and its link.

  • sample example link for this is https://tombyrer.github.io/videojs-transcript-click/demo/index.html.

  • The video js version we are using is "7.4.1"

  • Reference document of the transcripts and relation between the content and transcripts Enable transcripts for video content

  • In the config, the content metadata we need to get transcripts-related details, and the sample data is

    Code Block
    playerConfig: {
       ....
       metadata: {
         ....
         transcripts: [
          {
              language: 'English',
              languageCode: 'en',
              identifier: 'do_11355096882872320012900',
              artifactUrl: 'https://dockstorage.blob.core.windows.net/sunbird-content-dock/content/assets/do_11355096882872320012900/caption.english.vtt'
          },
          {
              language: 'Urdu',
              languageCode: 'ur',
              identifier: 'do_11355155567137587212904',
              // tslint:disable-next-line:max-line-length
              artifactUrl: 'https://dockstorage.blob.core.windows.net/sunbird-content-dock/content/assets/do_11355155567137587212904/caption.urdu.vtt'
          },
          {
              language: 'Bengali',
              languageCode: 'bn',
              identifier: 'do_11355160347001651212907',
              // tslint:disable-next-line:max-line-length
              artifactUrl: 'https://dockstorage.blob.core.windows.net/sunbird-content-dock/content/assets/do_11355160347001651212907/caption.bengali.vtt'
          }
        ],
        ...
      }
    }
  • Each object in transcripts data should have minimum values of language, languageCode, identifier, artifactUrl. and sample config link is https://github.com/project-sunbird/sunbird-video-player/blob/release-5.0.0/src/app/data.ts

  • When transcripts are not an available or empty array in content metadata the transcripts selection will be disabled(cc icon will be hidden)

  • Default config(not handling transcripts state)
    the state restorations data has to read from local storage ,

    • Case 1
      In this case in configuration, there is no need to pass the transcripts-related data and the player will not select any default transcripts by itself.

      Code Block
      playerConfig: {
           ....
           config: {
           ...
        }
      }
    • Case 2
      This case in the configuration can pass transcripts as an empty array, so in this case also the player will not select any default transcripts by itself.

      Code Block
      playerConfig: {
           ....
           config: {
           ...
          transcripts: []
        }
      }
  • Custom Config(handling transcripts state/default selection)
    the state restorations data has to read from local storage ,

    • Case 1:
      For default selection or state restoration can be retained by the player for transcripts only when we pass transcripts data in the config. if parent application passes transcripts data in the config like below , the default or state restoration will be achieved for given language code.

      Code Block
      playerConfig: {
           ....
           config: {
           ...
          transcripts: ['en'],
          currentDuration: 1.019399
        }
      }
    • Case 2:
      For default selection or state restoration can be retained by the player for transcripts only when we pass transcripts data in the config and also at the specific duration of the play. if parent application passes transcripts data in the config like below , the default or state restoration will be achieved for given language code form the given duration.

      Code Block
      playerConfig: {
           ....
           config: {
           ...
          transcripts: ['en'],
          currentDuration: 2.119399
        }
      }
    • Case 3:
      For default selection or state, restoration can also be retained by the player for transcripts when transcripts data is having multiple language code, the last element in the array will be retained.

      Code Block
      playerConfig: {
           ....
           config: {
           ...
          transcripts: ['en', 'hi'],
          currentDuration: 3.019399
        }
      }
    • Case 4:
      For default selection or state restoration can not be handled by the player , when array with a last element value is off for the transcripts data in the config, so the player will not select any default/restore transcript.

      Code Block
      playerConfig: {
           ....
           config: {
           ...
          transcripts: ['en', 'off'],
          currentDuration: 10.9399
        }
      }
  • The following list of languages tested from our side and on video content player and for more details for languages supported by video js library is link.

...

  • When the user selects transcripts the CP-VIDEO15 telemetry event will be triggered. and for event details follow given link.

  • When the user unselect transcripts the CP-VIDEO16 telemetry event will be triggered. and for event details follow given link.

  • When required fields missing in metadata.transcripts the CP-VIDEO17 telemetry event will be triggered. and for event details follow given link.