strapi-plugin-mux-video-uploader icon indicating copy to clipboard operation
strapi-plugin-mux-video-uploader copied to clipboard

Feature Request: Enable/Disable Auto-Generated Captions

Open sracela opened this issue 1 year ago • 4 comments

Feature Request

Description: Are there any plans to make it possible to enable/disable the new Mux auto-generated captions feature?

Mux Auto-Generated Captions Feature Documentation

I was thinking on something like the screenshot below maybe.

Screenshot:

Screenshot 2023-11-14 at 5 38 00 PM

Maybe a even better option would be a "Enable Auto-generated captions" checkbox field in the Settings page, so it gets enabled or disabled for all videos.

Taking a look at the code adding the generated_subtitles object here may do the trick:

//server/services/mux.js

return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, getMuxClient()];
                        case 1:
                            Video = (_a.sent()).Video;
                            return [2 /*return*/, Video.Uploads.create({
                                cors_origin: corsOrigin,
                                new_asset_settings: {
                                    playback_policy: ['public'],
                                    input: [
                                        {
                                            "generated_subtitles": [
                                                {
                                                    "language_code": "en",
                                                    "name": "English CC"
                                                }
                                            ]
                                        }
                                    ]
                                },
                            })];
                    }
                });

sracela avatar Nov 15 '23 01:11 sracela