Commit 07c9f6a
1213 - Ability to add captions to video nodes (#1215)
- Adds captions to the UrlVideoMedia player.
- When a video is uploaded to Kaltura, its captions will also be
uploaded to Kaltura and associated with the uploaded video. The captions
will be deleted locally after successful upload.
- Changes how users create Kaltura videos: to change the Kaltura ID, the
user must submit it in the NodeModal, which loads data from Kaltura into
the NodeModal to be edited.
- Depends on the package
[iso-639-1](https://www.npmjs.com/package/iso-639-1) to get ISO 639-1
language names and language codes and convert between the two.
**Changes to the video authoring form:**
- For mp4 and Kaltura videos, show a toggle for captions (on/off) that
is off by default
- If the toggle is on, displays one caption row by default, with the
option to add more.
- Each caption contains:
- A file upload field for the caption source. Must be VTT for regular
videos, and VTT or SRT for Kaltura videos.
- A language field. English by default.
- An optional field for the caption label, only visible if the user
turns on "Customize label". Otherwise, the name of the language is used
as the caption label (e.g. "English", "French").
- A "Display in player" toggle (true by default). The caption should
only be displayed in the video player if this is checked.
- A button to download the caption.
- A video can have a default caption. The “Set as default” button next
to each caption sets the default caption.
When a Kaltura video node is submitted, the new list of captions
replaces the existing list of captions on Kaltura.
**Pending captions:**
- If an error occurs when uploading a caption to Kaltura (either an
error with the .vtt file or the caption metadata), the caption will be
saved as a "pending caption" and the user will receive the number of
captions that failed to upload. The user can edit pending captions in
the NodeModal and add them back to the list. Pending captions are
identified by ID, so that adding a pending caption back to the list
overwrites the caption with the same ID, if any.
### Details
- The set of languages supported by Kaltura is different from the set of
languages in ISO 639-1 (see here
https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). We offer a union
of Kaltura's language names and the ISO 639-1 language names to users.
If the video is a URL video but the caption language does not exist in
ISO 639-1, the caption's `srclang` attribute will be "". If the video is
a Kaltura video but the caption language does not exist in Kaltura, the
label will be set to the language name (unless the user gave a custom
label) while the language will be "Undefined".
- Since captions do not change often, and to make captions accessible
when Kaltura is not available in the backend, captions uploaded to
Kaltura are also saved under the node's `typeData.captions`. To keep
this information up to date, the captions are fetched from Kaltura every
time the node is opened for editing.
## Screenshot
New editing workflow for Kaltura videos, and editing captions:
https://user-images.githubusercontent.com/44929104/187580872-643b3996-7b1d-4870-b749-f165174fb940.mp4
Caption upload feedback on Kaltura upload dashboard:

Pending captions:

---------
Co-authored-by: Legendword <[email protected]>
Co-authored-by: Aidin Niavarani <[email protected]>
Co-authored-by: langara2020sz <[email protected]>1 parent aefbb8b commit 07c9f6a
File tree
22 files changed
+1607
-293
lines changed- classes
- endpoints
- templates/vue
- cypress
- fixtures
- integration
- lightbox
- support
- src
- components
- Lightbox/media/VideoMedia
- modals
- NodeModal
- forms/ContentForm
- VideoForm
- common
- services
- utils
- utilities
22 files changed
+1607
-293
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
131 | 152 | | |
132 | 153 | | |
133 | 154 | | |
| |||
291 | 312 | | |
292 | 313 | | |
293 | 314 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | 315 | | |
308 | 316 | | |
309 | 317 | | |
| |||
473 | 481 | | |
474 | 482 | | |
475 | 483 | | |
476 | | - | |
| 484 | + | |
477 | 485 | | |
478 | 486 | | |
479 | 487 | | |
| |||
570 | 578 | | |
571 | 579 | | |
572 | 580 | | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
573 | 638 | | |
574 | 639 | | |
575 | 640 | | |
576 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
577 | 655 | | |
578 | 656 | | |
579 | 657 | | |
| |||
653 | 731 | | |
654 | 732 | | |
655 | 733 | | |
656 | | - | |
| 734 | + | |
657 | 735 | | |
658 | 736 | | |
659 | 737 | | |
| |||
705 | 783 | | |
706 | 784 | | |
707 | 785 | | |
708 | | - | |
| 786 | + | |
709 | 787 | | |
710 | 788 | | |
711 | 789 | | |
| |||
716 | 794 | | |
717 | 795 | | |
718 | 796 | | |
719 | | - | |
| 797 | + | |
720 | 798 | | |
721 | 799 | | |
722 | 800 | | |
723 | 801 | | |
724 | 802 | | |
725 | | - | |
| 803 | + | |
726 | 804 | | |
727 | 805 | | |
728 | 806 | | |
| |||
743 | 821 | | |
744 | 822 | | |
745 | 823 | | |
746 | | - | |
| 824 | + | |
747 | 825 | | |
748 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
749 | 834 | | |
750 | 835 | | |
751 | | - | |
| 836 | + | |
752 | 837 | | |
753 | 838 | | |
754 | 839 | | |
755 | | - | |
| 840 | + | |
756 | 841 | | |
757 | 842 | | |
758 | 843 | | |
| |||
773 | 858 | | |
774 | 859 | | |
775 | 860 | | |
776 | | - | |
| 861 | + | |
777 | 862 | | |
778 | 863 | | |
779 | 864 | | |
| |||
794 | 879 | | |
795 | 880 | | |
796 | 881 | | |
797 | | - | |
| 882 | + | |
798 | 883 | | |
799 | 884 | | |
800 | 885 | | |
801 | 886 | | |
802 | 887 | | |
803 | | - | |
| 888 | + | |
804 | 889 | | |
805 | 890 | | |
806 | 891 | | |
| |||
852 | 937 | | |
853 | 938 | | |
854 | 939 | | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
855 | 963 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
372 | 385 | | |
373 | 386 | | |
374 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments