Implementation with React

  • 🚨 RsiInterpretationPlayer must be imported before rsiSubtitles.

    • RsiSubtitles cannot work without the widget RsinterpretationPlayer
  • 🚨 In order to use the widget subtitles you must add as parameter of RsiInterpretationPlayer hasSubtitles to be true.

import React from 'react';
import { RsiInterpretationPlayer, RsiSubtitles } from '@akkadu/rsi-react'

 export default class ComponentInterpretationPlayer{
  const handleOnSubtitlesReady = (e) => {
    console.info('receive onReady event for the subtitles widget: ',e );
  }

  render(){ 
    return(  
      <div>
          <RsiInterpretationPlayer
            sdkKey="sdk_key_XXXX"
            hasSubtitle={true}
            onReady = {handleOnReady}
            onLanguageSelected = {handleOnLanguageSelected}
            onConnectionStatusUpdated = {handleOnConnectionStatusUpdated}
          />
          <RsiSubtitles
            sdkKey="sdk_key_XXXX"
            roomName="abcd"
            onReady = {handleOnSubtitlesReady}
          />
      </div>
    }
  );
 }