Captions Panel API

Captions Panel API

Captions Panel Overview

Allows users to choose whether they want to see captions when playing videos. This component uses Yes/No Panel as a base grade so it has the same component structure as Yes/No Panel in aspect of the model, options, selectors and dependencies.

 

 

On This Page
Still need help?

Join the infusion-users mailing list and ask your questions there.


Adding a Captions Panel to a Component/Grade

Option 1: Typically the Captions Panel is integrated into the first discovery tool by supplying it as a type option in an Auxiliary Schema:

"captions": { "type": "gpii.firstDiscovery.captions", "panel": { "type": "gpii.firstDiscovery.panel.captions", "container": ".gpiic-fd-prefsEditor-panel-captions", "template": "%prefix/yesNo.html", "message": "%prefix/captions.json" } }

Working in conjunction with the Auxiliary Schema, the type and its default value of the captions preference are defined in the Primary Schema:

 

fluid.defaults("gpii.firstDiscovery.schemas.captions", { gradeNames: ["autoInit", "fluid.prefs.schemas"], schema: { "gpii.firstDiscovery.captions": { "type": "boolean", "default": true } } });

 

Option 2: Adding as a stand alone component:

var myPanel = gpii.firstDiscovery.panel.captions(container, options);

 

Grades

The base grades used by the Captions Panel: