Libs
Object containing the external libraries' url lazy loaded only when needed by DIVA Web SDK.
The following block of code is an example of value pointing to public CDNs.
{
// video libraries
hlsJs: 'https://cdn.jsdelivr.net/npm/hls.js@1.5.7',
shaka: 'https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.8.5/shaka-player.compiled.js',
mux: 'https://cdnjs.cloudflare.com/ajax/libs/mux.js/6.2.0/mux.min.js',
// Advertisement
googleIMA: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js',
googleDAI: 'https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js',
// Chromecast
googleCast: 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1',
// Used for 360 videos
threeJs: 'https://cdnjs.cloudflare.com/ajax/libs/three.js/0.148.0/three.min.js',
}
Disable Lazy Loading​
DIVA allows skipping the lazy loading of a third-party library by inserting the value 'false' (boolean)
instead of the string containing the library's URL.
By doing so, the player assumes that the library has already been loaded and avoids loading it again.
This can improve startup performances.
Note: It is the integrator's responsibility to ensure the preloading of the necessary libraries.
Example disabling lazy loading for shaka and mux
{
// video libraries
hlsJs: 'https://cdn.jsdelivr.net/npm/hls.js@1.5.7',
shaka: false,
mux: false,
// Advertisement
googleIMA: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js',
googleDAI: 'https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js',
// Chromecast
googleCast: 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1',
// Used for 360 videos
threeJs: 'https://cdnjs.cloudflare.com/ajax/libs/three.js/0.148.0/three.min.js',
}