mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 02:57:30 +00:00
Allow users to customize the media class
This commit is contained in:
parent
c75214dcd7
commit
3b4a66f2fe
1 changed files with 3 additions and 1 deletions
|
|
@ -125,6 +125,7 @@ interface PrivateOptions {
|
|||
};
|
||||
};
|
||||
__butterchurnOptions: ButterchurnOptions;
|
||||
__customMediaClass: typeof Media; // This should have the same interface as Media
|
||||
}
|
||||
|
||||
// Return a promise that resolves when the store matches a predicate.
|
||||
|
|
@ -180,6 +181,7 @@ class Winamp {
|
|||
requireMusicMetadata,
|
||||
handleTrackDropEvent,
|
||||
__butterchurnOptions,
|
||||
__customMediaClass,
|
||||
} = this.options;
|
||||
|
||||
// TODO: Make this much cleaner
|
||||
|
|
@ -203,7 +205,7 @@ class Winamp {
|
|||
|
||||
// TODO: Validate required options
|
||||
|
||||
this.media = new Media();
|
||||
this.media = new (__customMediaClass || Media)();
|
||||
this.store = getStore(
|
||||
this.media,
|
||||
this._actionEmitter,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue