feat: localize videos (#42869)

* refactor: separate out VideoPlayer component

* feat: support bilibili videos

* feat(client): allow localized videos to be shown

* fix: remove add subtitles CTA

* feat: add locale ids for Why Program?
This commit is contained in:
Oliver Eyton-Williams
2021-09-27 11:26:38 +02:00
committed by GitHub
parent 48f2c02c5d
commit 2b6bef08ae
5 changed files with 135 additions and 17 deletions

View File

@ -58,6 +58,22 @@ const schema = Joi.object()
is: challengeTypes.video,
then: Joi.string().required()
}),
videoLocaleIds: Joi.when('challengeType', {
is: challengeTypes.video,
then: Joi.object().keys({
espanol: Joi.string(),
italian: Joi.string(),
portuguese: Joi.string()
})
}),
bilibiliIds: Joi.when('challengeType', {
is: challengeTypes.video,
then: Joi.object().keys({
aid: Joi.number().required(),
bvid: Joi.string().required(),
cid: Joi.number().required()
})
}),
question: Joi.object().keys({
text: Joi.string().required(),
answers: Joi.array().items(Joi.string()).required(),