# DAI

Play midroll ads (Dynamic Ad Insertion, two-player).

By default `TOP` will automatically enable DAI when the proper experience is configured. To traffic midroll ads via DAI, see DAI Requirements for more on what is needed

## How To

DAI configuration can be simple or detailed:

### Simple

DAI can be turned on/off by simply setting a `Boolean`:

    var player = TOP.createAndInitPlayer({
        config : {
            features : {
                dai : false // Prevent DAI midrolls from trafficing
            }
        }
    });

### Detailed

To specify more configuration information, set a DAIFeatureData object (see example):

    var player = TOP.createAndInitPlayer({
        config : {
            features : {
                dai : {
                    useStreamAssetId: false // use the assetId configured in the ads config in place of the one defined on the stream
                }
            }
        }
    });