mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 18:25:30 +00:00
parent
b4a88d2cc4
commit
29b4e0db71
4 changed files with 16 additions and 0 deletions
|
|
@ -1,3 +1,9 @@
|
|||
## Next
|
||||
|
||||
### Features
|
||||
|
||||
- New Webamp instance method: `.setSkinFromUrl(url)`. See [usage.md](./docs/usage.md) for more details.
|
||||
|
||||
## 1.4.0
|
||||
|
||||
### Features
|
||||
|
|
|
|||
|
|
@ -375,6 +375,10 @@ const unsubscribe = webamp.onMinimize(() => {
|
|||
unsubscribe();
|
||||
```
|
||||
|
||||
### `setSkinFromUrl(url: string): void`
|
||||
|
||||
Updates the skin used by the webamp instance. Note that this does not happen immediately. If you want to be notified when the skin load is complete, use `.skinIsLoaded()`, which returns a promise which you can await.
|
||||
|
||||
### `skinIsLoaded(): Promise<void>`
|
||||
|
||||
Returns a promise that resolves when the skin is done loading.
|
||||
|
|
|
|||
2
index.d.ts
vendored
2
index.d.ts
vendored
|
|
@ -250,6 +250,8 @@ export default class Webamp {
|
|||
*/
|
||||
public onMinimize(callback: () => any): () => void;
|
||||
|
||||
public setSkinFromUrl(url: string): void;
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the skin is done loading.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -387,6 +387,10 @@ class Winamp {
|
|||
return this._actionEmitter.on(MINIMIZE_WINAMP, cb);
|
||||
}
|
||||
|
||||
setSkinFromUrl(url: string): void {
|
||||
this.store.dispatch(Actions.setSkinFromUrl(url));
|
||||
}
|
||||
|
||||
async skinIsLoaded(): Promise<void> {
|
||||
// Wait for the skin to load.
|
||||
// TODO #leak
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue