After updating Typescript to a newer version, all "private" variables are now truly not accessible at runtime. For more information, check the Javascript section.
In order to achieve a smooth upgrading between version 1.x.x
and 2.x.x
, there is a couple of things to keep in mind:
- The player will only accept now 2 parameters instead of 4: the player ID and the player options.
controls
andshowLiveProgress
properties are now complex object structures, where we can indicate visibility and a new set of extra layers/visibility.
To simplify this even more:
const player = new OpenPlayerJS('player', 'https://ads.example.url/xml', true, {
controls: {
left: ['play', 'time', 'volume'],
middle: ['progress'],
right: ['captions', 'settings', 'fullscreen'],
},
showLiveProgress: false,
// ...other player options
});
player.init();
const player = new OpenPlayerJS('player', {
ads: {
src: 'https://ads.example.url/xml', // equivalent to the second argument in v1.x.x
// ...other ads options
},
mode: 'fullscreen', // equivalent to `true` in third argument in v1.x.x
controls: {
alwaysVisible: false,
// Also available: `top-left`, `top-middle`,
// `top-right`, `bottom-left`, `bottom-middle` and `bottom-right` or `main`
layers: {
left: ['play', 'time', 'volume'],
middle: ['progress'],
right: ['captions', 'settings', 'fullscreen'],
},
},
live: {
showLabel: true,
showProgress: false, // equivalent of `showLiveProgress` in v1.x.x
},
// ...other player options
});
player.init();