);
}
function Task({ task }) {
const [seconds, setSeconds] = React.useState(0);
function getTaskState(task) {
switch (task.state) {
case 0:
return "Скачиваем ..."
case 1:
return "Распознаём ..."
case 2:
return "Пытаемся понять что распознали ..."
case 3:
return "Разобрались, резюмируем ..."
case 6:
if (task.result == "error downloading video: nonretriable\nwrong video type") {
return "Пока что мы не умеем обрабатывать трансляции 😿"
}
if (task.result == "error downloading video: nonretriable\nvideo is too long") {
return "Пока что мы не умеем работать с видео длиннее 4 часов 😿"
}
return "Что-то пошло не так 😿"
default:
return "Готово!"
}
}
function setVideoSeconds(seconds) {
setSeconds(seconds)
document.getElementById("youtube-player").scrollIntoView({ behavior: 'smooth' })
}
return (
)
}
function YoutubeEmbed({ embedId, seconds }) {
let link = "https://www.youtube.com/embed/" + embedId
if (seconds > 0) {
link = link + "?version=3&loop=1&enablejsapi=1&autoplay=1&start=" + seconds
}
return (