Skip to content

Commit 8524c38

Browse files
authored
feat: move to advanced plugin and add reset API (#224)
1 parent 2369b3e commit 8524c38

8 files changed

+1753
-3026
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,31 @@ const overlayToRemove = overlay.get()[0];
9595
overlay.remove(overlayToRemove);
9696
```
9797

98+
#### `overlay.reset(Object)`
99+
100+
Once the plugin is initialized, the plugin options can be reset by passing this function an object of options. This will remove the previous configuration and overlays, and update the plugin with the new values. It takes [an options object as input](#plugin-options).
101+
102+
```js
103+
// First initialization
104+
const overlay = player.overlay({
105+
debug: true,
106+
overlays: [{
107+
content: 'The video is playing!',
108+
start: 'play',
109+
end: 'pause'
110+
}]
111+
});
112+
113+
// Update configuration with different overlays
114+
const overlayToRemove = overlay.reset({
115+
debug: false,
116+
overlays: [{
117+
content: 'Some new overlay content!',
118+
start: 'play',
119+
end: 'pause'
120+
}]
121+
});
122+
```
98123

99124
### Plugin Options
100125

0 commit comments

Comments
 (0)