@byteplus/rtc 4.60.7 → 4.60.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1616,7 +1616,13 @@ export declare enum SubtitleEventType {
1616
1616
  /**
1617
1617
  * @brief Errors occurred concerning the subtitling task.
1618
1618
  */
1619
- ERROR = 2
1619
+ ERROR = 2,
1620
+
1621
+ /**
1622
+ * @hidden
1623
+ * @brief Subtitles are updated.
1624
+ */
1625
+ UPDATED = 3
1620
1626
  }
1621
1627
 
1622
1628
  /**
@@ -2966,7 +2972,7 @@ export interface IEngineEvents {
2966
2972
  * @hidden currently not available
2967
2973
  * @brief Callback on subtitle messages.
2968
2974
  * After calling [startSubtitle](104478#startsubtitle) successfully, you will receive this callback which informs you of the related information on subtitles.
2969
- * @param e Subtitle message.
2975
+ * @param e Subtitle message. The subtitle messages will include multiple languages as the task specified. You can collect the `text` by `userId` and `language`.
2970
2976
  * @group Live Caption and Translation
2971
2977
  * @order 11
2972
2978
  */
@@ -4160,6 +4166,18 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4160
4166
  */
4161
4167
  startSubtitle: (config: RTCSubtitleConfig) => Promise<void>;
4162
4168
 
4169
+ /**
4170
+ * @hidden currently not available
4171
+ * @brief Update the source language after turning on subtitles.
4172
+ * @param config Subtitle configurations.
4173
+ * @return After updating the configurations, you will receive the [onSubtitleStateChanged](104479#onsubtitlestatechanged) to inform you.
4174
+ * @notes + You must call this method after turning on the subtitles via [startSubtitle]({{api}}#RTCEngine.startSubtitle).
4175
+ * + You can set your source language to Chinese by calling `joinRoom` and importing a JSON formatted string `"source_language": "zh"` through the parameter of extraInfo, to English by importing `"source_language": "en"`, to Korean by importing `"source_language": "ko"`, and to Japanese by importing `"source_language": "ja"`. The language of your browser will be automatically set as the source language if you don't set it. If the language of your browser is not Chinese, English, or Japanese, SDK will set Chinese as the source language.
4176
+ * @group Live Caption and Translation
4177
+ * @order 2
4178
+ */
4179
+ updateSubtitleConfig: (config: UpdateSubtitleConfig) => Promise<void>;
4180
+
4163
4181
  /**
4164
4182
  * @hidden currently not available
4165
4183
  * @brief Turns off subtitles.
@@ -5090,7 +5108,7 @@ export interface RTCSubtitleConfig {
5090
5108
  /**
5091
5109
  * @brief Target language.
5092
5110
  */
5093
- targetLanguage?: string;
5111
+ targetLanguage?: string | string[];
5094
5112
 
5095
5113
  /**
5096
5114
  * @brief Subtitle mode.
@@ -5673,6 +5691,22 @@ export interface SubtitleMessage {
5673
5691
  mode: SUBTITLE_MODE;
5674
5692
  }
5675
5693
 
5694
+ /**
5695
+ * @hidden
5696
+ * @brief Subtitle configurations to be updated to.
5697
+ */
5698
+ export interface UpdateSubtitleConfig {
5699
+
5700
+ /**
5701
+ * @brief The source language code.
5702
+ * + zh: Chinese
5703
+ * + ja: Japanese
5704
+ * + en: English
5705
+ * + ko: Korean
5706
+ */
5707
+ sourceLanguage: string;
5708
+ }
5709
+
5676
5710
  /**
5677
5711
  * @brief Point-to-point binary message
5678
5712
  */