@vinylproject/washtub-player 0.0.0-dev.897a044
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +157 -0
- package/dist/washtub-embed.js +1176 -0
- package/dist/washtub-embed.js.map +1 -0
- package/dist/washtub-embed.umd.cjs +317 -0
- package/dist/washtub-embed.umd.cjs.map +1 -0
- package/package.json +32 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { CSSResult } from 'lit';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import { nothing } from 'lit';
|
|
4
|
+
import { TemplateResult } from 'lit-html';
|
|
5
|
+
|
|
6
|
+
export declare interface AlbumMeta {
|
|
7
|
+
type: 'album';
|
|
8
|
+
title: string;
|
|
9
|
+
artist: string | null;
|
|
10
|
+
year: number | null;
|
|
11
|
+
cover_url: string | null;
|
|
12
|
+
allow_download: boolean;
|
|
13
|
+
tracks: EmbedTrack[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare type EmbedMeta = SongMeta | AlbumMeta;
|
|
17
|
+
|
|
18
|
+
export declare interface EmbedTrack {
|
|
19
|
+
id: number;
|
|
20
|
+
title: string;
|
|
21
|
+
artist: string;
|
|
22
|
+
track_number: number;
|
|
23
|
+
disc_number: number;
|
|
24
|
+
duration_ms: number;
|
|
25
|
+
format: string;
|
|
26
|
+
bit_rate: number;
|
|
27
|
+
genre: string;
|
|
28
|
+
stream_url: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface SongMeta {
|
|
32
|
+
type: 'song';
|
|
33
|
+
title: string;
|
|
34
|
+
artist: string | null;
|
|
35
|
+
album: string | null;
|
|
36
|
+
year: number | null;
|
|
37
|
+
genre: string;
|
|
38
|
+
format: string;
|
|
39
|
+
bit_rate: number;
|
|
40
|
+
sample_rate: number;
|
|
41
|
+
duration_ms: number;
|
|
42
|
+
cover_url: string | null;
|
|
43
|
+
allow_download: boolean;
|
|
44
|
+
stream_url: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare const WASHTUB_DISCONNECTED: "washtub-disconnected";
|
|
48
|
+
|
|
49
|
+
export declare const WASHTUB_ENDED: "washtub-ended";
|
|
50
|
+
|
|
51
|
+
export declare const WASHTUB_ERROR: "washtub-error";
|
|
52
|
+
|
|
53
|
+
export declare const WASHTUB_LOADEDMETADATA: "washtub-loadedmetadata";
|
|
54
|
+
|
|
55
|
+
export declare const WASHTUB_PAUSE: "washtub-pause";
|
|
56
|
+
|
|
57
|
+
export declare const WASHTUB_PLAY: "washtub-play";
|
|
58
|
+
|
|
59
|
+
export declare const WASHTUB_TIMEUPDATE: "washtub-timeupdate";
|
|
60
|
+
|
|
61
|
+
export declare const WASHTUB_VOLUMECHANGE: "washtub-volumechange";
|
|
62
|
+
|
|
63
|
+
export declare interface WashtubEndedDetail {
|
|
64
|
+
trackIndex: number;
|
|
65
|
+
trackCount: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare interface WashtubErrorDetail {
|
|
69
|
+
message: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare interface WashtubEventMap {
|
|
73
|
+
[WASHTUB_PLAY]: CustomEvent<WashtubPlayDetail>;
|
|
74
|
+
[WASHTUB_PAUSE]: CustomEvent<WashtubPauseDetail>;
|
|
75
|
+
[WASHTUB_TIMEUPDATE]: CustomEvent<WashtubTimeupdateDetail>;
|
|
76
|
+
[WASHTUB_LOADEDMETADATA]: CustomEvent<WashtubLoadedmetadataDetail>;
|
|
77
|
+
[WASHTUB_ENDED]: CustomEvent<WashtubEndedDetail>;
|
|
78
|
+
[WASHTUB_VOLUMECHANGE]: CustomEvent<WashtubVolumechangeDetail>;
|
|
79
|
+
[WASHTUB_ERROR]: CustomEvent<WashtubErrorDetail>;
|
|
80
|
+
[WASHTUB_DISCONNECTED]: CustomEvent<void>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare interface WashtubLoadedmetadataDetail {
|
|
84
|
+
duration: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare interface WashtubPauseDetail {
|
|
88
|
+
currentTime: number;
|
|
89
|
+
duration: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare interface WashtubPlayDetail {
|
|
93
|
+
title: string;
|
|
94
|
+
artist: string;
|
|
95
|
+
album: string;
|
|
96
|
+
year: string;
|
|
97
|
+
genre: string;
|
|
98
|
+
coverUrl: string;
|
|
99
|
+
trackIndex: number;
|
|
100
|
+
trackCount: number;
|
|
101
|
+
streamUrl: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare class WashtubPlayer extends LitElement {
|
|
105
|
+
static styles: CSSResult;
|
|
106
|
+
token: string;
|
|
107
|
+
apiBase: string;
|
|
108
|
+
private meta;
|
|
109
|
+
private loading;
|
|
110
|
+
private error;
|
|
111
|
+
private activeTrackIndex;
|
|
112
|
+
private playing;
|
|
113
|
+
private currentTime;
|
|
114
|
+
private duration;
|
|
115
|
+
private audio;
|
|
116
|
+
private _onSiblingPlay;
|
|
117
|
+
connectedCallback(): void;
|
|
118
|
+
disconnectedCallback(): void;
|
|
119
|
+
pausePlayback(): void;
|
|
120
|
+
resumePlayback(): void;
|
|
121
|
+
seekTo(time: number): void;
|
|
122
|
+
setVolume(v: number): void;
|
|
123
|
+
toggleMute(): void;
|
|
124
|
+
private buildPlayDetail;
|
|
125
|
+
private get resolvedApiBase();
|
|
126
|
+
private get isAlbum();
|
|
127
|
+
private get tracks();
|
|
128
|
+
private get activeTrack();
|
|
129
|
+
private get isActiveTrack();
|
|
130
|
+
private get progressPercent();
|
|
131
|
+
private resolve;
|
|
132
|
+
private handlePlay;
|
|
133
|
+
private handleTrackPlay;
|
|
134
|
+
private isTrackPlaying;
|
|
135
|
+
private isTrackActive;
|
|
136
|
+
private handleTrackEnded;
|
|
137
|
+
private handleSeek;
|
|
138
|
+
private get playButtonLabel();
|
|
139
|
+
private mimeType;
|
|
140
|
+
render(): TemplateResult<1> | typeof nothing;
|
|
141
|
+
private renderSong;
|
|
142
|
+
private renderAlbum;
|
|
143
|
+
private renderTags;
|
|
144
|
+
private renderControls;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export declare interface WashtubTimeupdateDetail {
|
|
148
|
+
currentTime: number;
|
|
149
|
+
duration: number;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export declare interface WashtubVolumechangeDetail {
|
|
153
|
+
volume: number;
|
|
154
|
+
muted: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { }
|