@twick/studio 0.15.26 → 0.15.27
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/dist/components/properties/generate-captions.d.ts +3 -2
- package/dist/helpers/generate-captions.service.d.ts +4 -4
- package/dist/hooks/use-generate-captions.d.ts +2 -2
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -13
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +15 -15
package/dist/index.mjs
CHANGED
|
@@ -6945,7 +6945,7 @@ function GenerateCaptionsPanel({
|
|
|
6945
6945
|
const [pollingStatus, setPollingStatus] = useState("idle");
|
|
6946
6946
|
const [errorMessage, setErrorMessage] = useState(null);
|
|
6947
6947
|
const [selectedLanguage, setSelectedLanguage] = useState("auto");
|
|
6948
|
-
const [
|
|
6948
|
+
const [phraseLength, setPhraseLength] = useState("medium");
|
|
6949
6949
|
const pollingIntervalRef = useRef(null);
|
|
6950
6950
|
const currentReqIdRef = useRef(null);
|
|
6951
6951
|
useEffect(() => {
|
|
@@ -7010,7 +7010,7 @@ function GenerateCaptionsPanel({
|
|
|
7010
7010
|
const reqId = await onGenerateCaptions(
|
|
7011
7011
|
videoElement,
|
|
7012
7012
|
language,
|
|
7013
|
-
|
|
7013
|
+
phraseLength
|
|
7014
7014
|
);
|
|
7015
7015
|
if (!reqId) {
|
|
7016
7016
|
setPollingStatus("error");
|
|
@@ -7095,18 +7095,19 @@ function GenerateCaptionsPanel({
|
|
|
7095
7095
|
)
|
|
7096
7096
|
] }),
|
|
7097
7097
|
!isLoading && containsAudio === true && /* @__PURE__ */ jsxs("div", { className: "panel-section", children: [
|
|
7098
|
-
/* @__PURE__ */ jsx("label", { className: "label-dark", htmlFor: "caption-
|
|
7099
|
-
/* @__PURE__ */
|
|
7098
|
+
/* @__PURE__ */ jsx("label", { className: "label-dark", htmlFor: "caption-phrase-length", children: "Caption length" }),
|
|
7099
|
+
/* @__PURE__ */ jsxs(
|
|
7100
7100
|
"select",
|
|
7101
7101
|
{
|
|
7102
|
-
id: "caption-
|
|
7102
|
+
id: "caption-phrase-length",
|
|
7103
7103
|
className: "select-dark",
|
|
7104
|
-
value:
|
|
7105
|
-
onChange: (e) =>
|
|
7106
|
-
children:
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7104
|
+
value: phraseLength,
|
|
7105
|
+
onChange: (e) => setPhraseLength(e.target.value),
|
|
7106
|
+
children: [
|
|
7107
|
+
/* @__PURE__ */ jsx("option", { value: "short", children: "Short" }),
|
|
7108
|
+
/* @__PURE__ */ jsx("option", { value: "medium", children: "Medium" }),
|
|
7109
|
+
/* @__PURE__ */ jsx("option", { value: "long", children: "Long" })
|
|
7110
|
+
]
|
|
7110
7111
|
}
|
|
7111
7112
|
)
|
|
7112
7113
|
] }),
|
|
@@ -7777,14 +7778,14 @@ function TwickStudio({ studioConfig }) {
|
|
|
7777
7778
|
const useGenerateCaptions = (studioConfig) => {
|
|
7778
7779
|
var _a;
|
|
7779
7780
|
const { editor, present } = useTimelineContext();
|
|
7780
|
-
const onGenerateCaptions = async (videoElement, language,
|
|
7781
|
+
const onGenerateCaptions = async (videoElement, language, phraseLength) => {
|
|
7781
7782
|
if (studioConfig == null ? void 0 : studioConfig.captionGenerationService) {
|
|
7782
7783
|
const service = studioConfig.captionGenerationService;
|
|
7783
7784
|
const reqId = await service.generateCaptions(
|
|
7784
7785
|
videoElement,
|
|
7785
7786
|
present,
|
|
7786
7787
|
language,
|
|
7787
|
-
|
|
7788
|
+
phraseLength
|
|
7788
7789
|
);
|
|
7789
7790
|
return reqId;
|
|
7790
7791
|
}
|