@christianriedl/media 1.0.303 → 1.0.305
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/iMedia.d.ts
CHANGED
|
@@ -364,10 +364,13 @@ export interface IPlaylistState {
|
|
|
364
364
|
export interface IPlaylistService {
|
|
365
365
|
log: ILogger;
|
|
366
366
|
soundbarOn: boolean;
|
|
367
|
+
soundbarVolume: number;
|
|
367
368
|
searchFeeds(query: Dictionary<any>, limit?: number): Promise<IRssFeed[]>;
|
|
368
369
|
getFeed(rssUrl: string): Promise<IRssFeed | null>;
|
|
370
|
+
getCategories(owner: string): Promise<string[]>;
|
|
369
371
|
play(url: string): Promise<boolean>;
|
|
370
372
|
playList(urls: string[], clear: boolean, index?: number): Promise<boolean>;
|
|
371
373
|
playCommand(cmd: EPlaylistCommand): Promise<boolean>;
|
|
374
|
+
setSoundbarVolume(value: number): Promise<boolean>;
|
|
372
375
|
getState(): Promise<IPlaylistState | null>;
|
|
373
376
|
}
|
|
@@ -6,14 +6,18 @@ export declare class PlaylistService implements IPlaylistService {
|
|
|
6
6
|
mediaUrl: string;
|
|
7
7
|
log: ILogger;
|
|
8
8
|
soundbarOn: boolean;
|
|
9
|
+
soundbarVolume: number;
|
|
9
10
|
setSoundbar: (name: string, value: string) => Promise<boolean>;
|
|
10
11
|
getSoundbarValue: (name: string) => any;
|
|
12
|
+
cachedCategories: Dictionary<string[]>;
|
|
11
13
|
constructor(rest: IRest, log: ILogger, getSoundbarValue: (name: string) => any, setSoundbar: (name: string, value: string) => Promise<boolean>);
|
|
12
14
|
searchFeeds(query: Dictionary<any>, limit?: number): Promise<IRssFeed[]>;
|
|
13
15
|
getFeed(rssUrl: string): Promise<IRssFeed | null>;
|
|
16
|
+
getCategories(owner: string): Promise<string[]>;
|
|
14
17
|
play(url: string): Promise<boolean>;
|
|
15
18
|
playList(urls: string[], clear: boolean, index?: number): Promise<boolean>;
|
|
16
19
|
playCommand(cmd: EPlaylistCommand): Promise<boolean>;
|
|
17
20
|
getState(): Promise<IPlaylistState | null>;
|
|
18
|
-
|
|
21
|
+
ensureSoundbarOn(): Promise<boolean>;
|
|
22
|
+
setSoundbarVolume(value: number): Promise<boolean>;
|
|
19
23
|
}
|
package/dist/playlistService.js
CHANGED
|
@@ -5,8 +5,10 @@ export class PlaylistService {
|
|
|
5
5
|
mediaUrl;
|
|
6
6
|
log;
|
|
7
7
|
soundbarOn;
|
|
8
|
+
soundbarVolume;
|
|
8
9
|
setSoundbar;
|
|
9
10
|
getSoundbarValue;
|
|
11
|
+
cachedCategories;
|
|
10
12
|
constructor(rest, log, getSoundbarValue, setSoundbar) {
|
|
11
13
|
this.log = log;
|
|
12
14
|
this.rest = rest;
|
|
@@ -14,6 +16,8 @@ export class PlaylistService {
|
|
|
14
16
|
this.getSoundbarValue = getSoundbarValue;
|
|
15
17
|
this.setSoundbar = setSoundbar;
|
|
16
18
|
this.soundbarOn = false;
|
|
19
|
+
this.cachedCategories = {};
|
|
20
|
+
;
|
|
17
21
|
}
|
|
18
22
|
async searchFeeds(query, limit) {
|
|
19
23
|
query['limit'] = limit ?? 50;
|
|
@@ -24,6 +28,20 @@ export class PlaylistService {
|
|
|
24
28
|
const res = await this.rest.getData('apiplaylist/feed', { rssUrl: rssUrl });
|
|
25
29
|
return res.ok ? res.result : null;
|
|
26
30
|
}
|
|
31
|
+
async getCategories(owner) {
|
|
32
|
+
let categories = this.cachedCategories[owner];
|
|
33
|
+
if (!categories) {
|
|
34
|
+
const res = await this.rest.getData('apiplaylist/feed/categories', { owner: owner });
|
|
35
|
+
if (!res.ok || !res.result) {
|
|
36
|
+
return [''];
|
|
37
|
+
}
|
|
38
|
+
categories = [''];
|
|
39
|
+
categories.push(...res.result);
|
|
40
|
+
this.cachedCategories[owner] = categories;
|
|
41
|
+
;
|
|
42
|
+
}
|
|
43
|
+
return categories;
|
|
44
|
+
}
|
|
27
45
|
/*
|
|
28
46
|
async getTitles(): Promise<string[]> {
|
|
29
47
|
const res = await this.rest.getData<string[]>('apiplaylist/title');
|
|
@@ -47,14 +65,14 @@ export class PlaylistService {
|
|
|
47
65
|
}
|
|
48
66
|
*/
|
|
49
67
|
async play(url) {
|
|
50
|
-
this.soundbarOn = await this.
|
|
68
|
+
this.soundbarOn = await this.ensureSoundbarOn();
|
|
51
69
|
if (!this.soundbarOn)
|
|
52
70
|
return false;
|
|
53
71
|
const res = await this.rest.postData(`apiplaylist/play?url=${encodeURIComponent(url)}`);
|
|
54
72
|
return res.ok ? res.result : false;
|
|
55
73
|
}
|
|
56
74
|
async playList(urls, clear, index) {
|
|
57
|
-
this.soundbarOn = await this.
|
|
75
|
+
this.soundbarOn = await this.ensureSoundbarOn();
|
|
58
76
|
if (!this.soundbarOn)
|
|
59
77
|
return false;
|
|
60
78
|
let url = `apiplaylist/play?clear=${clear}`;
|
|
@@ -64,7 +82,7 @@ export class PlaylistService {
|
|
|
64
82
|
return res.ok ? res.result : false;
|
|
65
83
|
}
|
|
66
84
|
async playCommand(cmd) {
|
|
67
|
-
this.soundbarOn = await this.
|
|
85
|
+
this.soundbarOn = await this.ensureSoundbarOn();
|
|
68
86
|
if (!this.soundbarOn)
|
|
69
87
|
return false;
|
|
70
88
|
let url = `apiplaylist/playcommand?cmd=${EPlaylistCommand[cmd]}`;
|
|
@@ -72,10 +90,11 @@ export class PlaylistService {
|
|
|
72
90
|
return res.ok ? res.result : false;
|
|
73
91
|
}
|
|
74
92
|
async getState() {
|
|
93
|
+
this.soundbarVolume = Number(this.getSoundbarValue('Volume'));
|
|
75
94
|
const res = await this.rest.getData('apiplaylist/state');
|
|
76
95
|
return res.ok ? res.result : null;
|
|
77
96
|
}
|
|
78
|
-
async
|
|
97
|
+
async ensureSoundbarOn() {
|
|
79
98
|
let i = 0;
|
|
80
99
|
for (i = 0; i < 5; i++) {
|
|
81
100
|
if (this.getSoundbarValue('On') === true)
|
|
@@ -93,5 +112,9 @@ export class PlaylistService {
|
|
|
93
112
|
}
|
|
94
113
|
return false;
|
|
95
114
|
}
|
|
115
|
+
async setSoundbarVolume(value) {
|
|
116
|
+
const result = await this.setSoundbar('VOLUME', value.toString());
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
96
119
|
}
|
|
97
120
|
//# sourceMappingURL=playlistService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playlistService.js","sourceRoot":"","sources":["../src/playlistService.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAc,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAY,gBAAgB,EAAoC,MAAM,UAAU,CAAC;AAExF,MAAM,OAAO,eAAe;IACxB,IAAI,CAAQ;IACZ,QAAQ,CAAS;IACjB,GAAG,CAAU;IACb,UAAU,CAAU;IACpB,WAAW,CAAoD;IAC/D,gBAAgB,CAAwB;IACxC,YAAY,IAAW,EAAE,GAAY,EAAE,gBAAuC,EAAE,WAA8D;QAC1I,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC;QAChC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"playlistService.js","sourceRoot":"","sources":["../src/playlistService.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAc,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAY,gBAAgB,EAAoC,MAAM,UAAU,CAAC;AAExF,MAAM,OAAO,eAAe;IACxB,IAAI,CAAQ;IACZ,QAAQ,CAAS;IACjB,GAAG,CAAU;IACb,UAAU,CAAU;IACpB,cAAc,CAAS;IACvB,WAAW,CAAoD;IAC/D,gBAAgB,CAAwB;IACxC,gBAAgB,CAAuB;IACvC,YAAY,IAAW,EAAE,GAAY,E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QACjB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACrB,IAAI,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,SAAS;gBAClD,OAAO,IAAI,CAAC;YACT,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAC3D,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,KAAK,CAAC;IACV,CAAC;IACD,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACxC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClE,OAAO,MAAM,CAAC;IACX,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
const listhead = ref<ComponentPublicInstance | null>(null);
|
|
22
22
|
const listHeight = ref(0);
|
|
23
23
|
const playerNames = ['Local', 'Soundbar'];
|
|
24
|
-
const backVisible = computed(() => !!route.query?.feed);
|
|
25
24
|
const currentPlayer = ref<string>(playerNames[0]);
|
|
25
|
+
const orf = ref(true);
|
|
26
26
|
const playLocal = computed(() => currentPlayer.value == 'Local');
|
|
27
27
|
const playIndex = ref(-1);
|
|
28
28
|
const itemIndex = ref(0);
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
const paused = ref(false);
|
|
34
34
|
const search = ref(true);
|
|
35
35
|
let statusTimer = 0;
|
|
36
|
+
let volumeTimer = 0;
|
|
37
|
+
let volumeCount = 0;
|
|
38
|
+
|
|
36
39
|
const positionText = computed(() => {
|
|
37
40
|
if (playingItem.value?.duration)
|
|
38
41
|
return toTime(position.value) + '/' + toTime(playingItem.value.duration);
|
|
@@ -41,21 +44,25 @@
|
|
|
41
44
|
});
|
|
42
45
|
|
|
43
46
|
const feedTypes = Helper.getEnumOptions(EFeedType);
|
|
44
|
-
const feedType = ref<EFeedType>(
|
|
47
|
+
const feedType = ref<EFeedType>(EFeedType.Podcast);
|
|
45
48
|
const countries = ["", "AT", "DE", "US"];
|
|
46
49
|
const country = ref("");
|
|
47
50
|
const query = ref("");
|
|
51
|
+
const categories = ref<string[]>([]);
|
|
52
|
+
const category = ref("");
|
|
53
|
+
|
|
48
54
|
const limit = ref(50);
|
|
49
55
|
|
|
50
56
|
onMounted(async () => {
|
|
57
|
+
statusTimer = 0;
|
|
51
58
|
playlistService.log.info('OnlinePodcastsPage created');
|
|
52
59
|
await start();
|
|
53
60
|
});
|
|
54
61
|
onUnmounted(() => {
|
|
55
62
|
if (statusTimer > 0) {
|
|
56
|
-
clearTimeout(statusTimer);
|
|
57
|
-
statusTimer = 0;
|
|
63
|
+
window.clearTimeout(statusTimer);
|
|
58
64
|
}
|
|
65
|
+
statusTimer = -1;
|
|
59
66
|
});
|
|
60
67
|
async function start() {
|
|
61
68
|
if (route.query?.rssUrl) {
|
|
@@ -68,6 +75,9 @@
|
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
77
|
else {
|
|
78
|
+
if (categories.value.length == 0) {
|
|
79
|
+
categories.value = await playlistService.getCategories('ORF');
|
|
80
|
+
}
|
|
71
81
|
search.value = true;
|
|
72
82
|
}
|
|
73
83
|
computeListHeight();
|
|
@@ -84,15 +94,21 @@
|
|
|
84
94
|
listHeight.value = height;
|
|
85
95
|
})
|
|
86
96
|
}
|
|
87
|
-
|
|
88
97
|
async function onSearch() {
|
|
89
98
|
const dict: Dictionary<any> = {};
|
|
90
|
-
if (
|
|
91
|
-
dict[
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
if (orf.value) {
|
|
100
|
+
dict['owner'] = 'ORF';
|
|
101
|
+
if (category.value)
|
|
102
|
+
dict['category'] = category.value;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
if (feedType.value != EFeedType.Unknown)
|
|
106
|
+
dict["media"] = EFeedType[feedType.value];
|
|
107
|
+
if (country.value != "")
|
|
108
|
+
dict["country"] = country.value;;
|
|
109
|
+
}
|
|
94
110
|
dict["query"] = query.value;
|
|
95
|
-
const fds = await playlistService.searchFeeds(dict, limit.value)
|
|
111
|
+
const fds = await playlistService.searchFeeds(dict, limit.value);
|
|
96
112
|
feeds.splice (0, feeds.length, ...fds);
|
|
97
113
|
}
|
|
98
114
|
async function play() {
|
|
@@ -110,11 +126,11 @@
|
|
|
110
126
|
return;
|
|
111
127
|
playingItem.value = selectedItem.value;
|
|
112
128
|
await getStatus();
|
|
113
|
-
playlistService.log.trace(`play remote ${selectedItem.value!.title}`)
|
|
129
|
+
playlistService.log.trace(`play remote ${selectedItem.value!.title}`);
|
|
114
130
|
}
|
|
115
|
-
itemIndex.value = playIndex.value =
|
|
131
|
+
itemIndex.value = playIndex.value = items.findIndex((f) => f.link == selectedItem.value!.link);
|
|
116
132
|
}
|
|
117
|
-
function listFeed(feed: IRssFeed) {
|
|
133
|
+
function listFeed(feed: IRssFeed) {
|
|
118
134
|
router.push ({path: 'onlinePodcasts', query: { rssUrl: feed.rssUrl }});
|
|
119
135
|
}
|
|
120
136
|
|
|
@@ -131,7 +147,12 @@
|
|
|
131
147
|
status.value = state;
|
|
132
148
|
if (state)
|
|
133
149
|
setPosition(Number(state.position));
|
|
134
|
-
|
|
150
|
+
if (volumeCount > 0)
|
|
151
|
+
volumeCount--;
|
|
152
|
+
else
|
|
153
|
+
volume.value = playlistService.soundbarVolume;
|
|
154
|
+
if (statusTimer >= 0)
|
|
155
|
+
statusTimer = window.setTimeout(async () => getStatus(), 1000);
|
|
135
156
|
}
|
|
136
157
|
|
|
137
158
|
function toSubTitle(f: IRssFeed): string {
|
|
@@ -140,7 +161,7 @@
|
|
|
140
161
|
return toTime(f.duration);
|
|
141
162
|
}
|
|
142
163
|
|
|
143
|
-
function toTime(s
|
|
164
|
+
function toTime(s?: number): string {
|
|
144
165
|
if (!s)
|
|
145
166
|
return "";
|
|
146
167
|
let r = "";
|
|
@@ -208,16 +229,32 @@
|
|
|
208
229
|
function previous() {
|
|
209
230
|
if (playIndex.value <= 0)
|
|
210
231
|
return;
|
|
211
|
-
selectedItem.value =
|
|
232
|
+
selectedItem.value = items[playIndex.value - 1];
|
|
212
233
|
play();
|
|
213
234
|
}
|
|
214
235
|
function next() {
|
|
215
|
-
if (playIndex.value >=
|
|
236
|
+
if (playIndex.value >= items.length - 1)
|
|
216
237
|
return;
|
|
217
|
-
selectedItem.value =
|
|
238
|
+
selectedItem.value = items[playIndex.value + 1];
|
|
218
239
|
play();
|
|
219
240
|
}
|
|
220
|
-
function
|
|
241
|
+
async function stop() {
|
|
242
|
+
if (playLocal.value) {
|
|
243
|
+
audio.value!.pause();
|
|
244
|
+
audio.value!.currentTime = 0;
|
|
245
|
+
}
|
|
246
|
+
else
|
|
247
|
+
await playlistService.playCommand(EPlaylistCommand.Stop);
|
|
248
|
+
}
|
|
249
|
+
async function changeVolume() {
|
|
250
|
+
if (volumeTimer)
|
|
251
|
+
window.clearTimeout(volumeTimer);
|
|
252
|
+
|
|
253
|
+
volumeCount = 3;
|
|
254
|
+
volumeTimer = window.setTimeout(async () => {
|
|
255
|
+
await playlistService.setSoundbarVolume(volume.value);
|
|
256
|
+
volumeTimer = 0;
|
|
257
|
+
}, 500);
|
|
221
258
|
}
|
|
222
259
|
|
|
223
260
|
</script>
|
|
@@ -227,30 +264,37 @@
|
|
|
227
264
|
<audio ref="audio" preload="none" @ended="onEnded" @timeupdate="onTimeUpdate">
|
|
228
265
|
</audio>
|
|
229
266
|
<v-container v-if="search" fluid>
|
|
230
|
-
<v-row class="align-center">
|
|
231
|
-
<v-col cols="1"
|
|
267
|
+
<v-row class="align-center" density="compact">
|
|
268
|
+
<v-col cols="1">ORF</v-col>
|
|
232
269
|
<v-col cols="2">Type</v-col>
|
|
233
270
|
<v-col cols="1">Country</v-col>
|
|
234
271
|
<v-col cols="6">Query</v-col>
|
|
235
272
|
<v-col cols="1">Limit</v-col>
|
|
236
273
|
</v-row>
|
|
237
|
-
<v-row class="align-center">
|
|
274
|
+
<v-row class="align-center" density="compact">
|
|
238
275
|
<v-col cols="1">
|
|
239
|
-
<v-
|
|
240
|
-
</v-btn>
|
|
276
|
+
<v-checkbox v-model="orf" hide-details density="compact"></v-checkbox>
|
|
241
277
|
</v-col>
|
|
242
|
-
<v-col cols="
|
|
243
|
-
<v-select density="compact" v-model="
|
|
244
|
-
:items="
|
|
278
|
+
<v-col v-if="orf" cols="3">
|
|
279
|
+
<v-select density="compact" v-model="category"
|
|
280
|
+
:items="categories"
|
|
245
281
|
persistent-hint hide-details single-line>
|
|
246
282
|
</v-select>
|
|
247
283
|
</v-col>
|
|
248
|
-
<v-
|
|
249
|
-
<v-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
284
|
+
<template v-else>
|
|
285
|
+
<v-col cols="2">
|
|
286
|
+
<v-select density="compact" v-model="feedType"
|
|
287
|
+
:items="feedTypes"
|
|
288
|
+
persistent-hint hide-details single-line>
|
|
289
|
+
</v-select>
|
|
290
|
+
</v-col>
|
|
291
|
+
<v-col cols="1">
|
|
292
|
+
<v-combobox density="compact" v-model="country"
|
|
293
|
+
:items="countries"
|
|
294
|
+
persistent-hint hide-details single-line>
|
|
295
|
+
</v-combobox>
|
|
296
|
+
</v-col>
|
|
297
|
+
</template>
|
|
254
298
|
<v-col cols="6">
|
|
255
299
|
<v-text-field v-model="query" hide-details density="compact"></v-text-field>
|
|
256
300
|
</v-col>
|
|
@@ -264,37 +308,39 @@
|
|
|
264
308
|
</v-row>
|
|
265
309
|
</v-container>
|
|
266
310
|
<v-container v-else fluid>
|
|
267
|
-
<v-row class="align-center">
|
|
311
|
+
<v-row class="align-center" density="compact">
|
|
268
312
|
<v-col cols="1">
|
|
269
|
-
<v-btn
|
|
313
|
+
<v-btn icon="$back" class="bg-media_head" variant="tonal" @click="listBack">
|
|
270
314
|
</v-btn>
|
|
271
315
|
</v-col>
|
|
272
316
|
<v-col cols="1">
|
|
273
|
-
<v-img :src="selectedFeed
|
|
317
|
+
<v-img :src="selectedFeed!.imageUrl"></v-img>
|
|
274
318
|
</v-col>
|
|
275
|
-
<v-col cols="1">{{selectedFeed
|
|
276
|
-
<v-col cols="2">{{selectedFeed
|
|
277
|
-
<v-col cols="2">{{selectedFeed
|
|
278
|
-
<v-col cols="
|
|
279
|
-
<v-col cols="
|
|
319
|
+
<v-col cols="1">{{selectedFeed!.country}}</v-col>
|
|
320
|
+
<v-col cols="2">{{selectedFeed!.genre}}</v-col>
|
|
321
|
+
<v-col cols="2">{{selectedFeed!.owner}}</v-col>
|
|
322
|
+
<v-col cols="4">{{selectedFeed!.title}}</v-col>
|
|
323
|
+
<v-col cols="1">
|
|
280
324
|
<v-select v-model="currentPlayer" density="compact" :items="playerNames" persistent-hint
|
|
281
325
|
@update:modelValue="onPlayerChange" hide-details single-line>
|
|
282
326
|
</v-select>
|
|
283
327
|
</v-col>
|
|
284
328
|
</v-row>
|
|
285
|
-
<v-row v-if="playingItem" class="align-center">
|
|
329
|
+
<v-row v-if="playingItem" class="align-center" density="compact">
|
|
286
330
|
<v-col cols="4">
|
|
287
|
-
<v-btn :icon="paused ? '$play' : '$pause'" @click="playpause">
|
|
288
|
-
<v-btn icon="$
|
|
289
|
-
<v-btn icon="$
|
|
331
|
+
<v-btn :icon="paused ? '$play' : '$pause'" class="bg-media_head" variant="tonal" @click="playpause"></v-btn>
|
|
332
|
+
<v-btn icon="$stop" class="bg-media_head" variant="tonal" @click="stop"></v-btn>
|
|
333
|
+
<v-btn icon="$prev" class="bg-media_head" variant="tonal" @click="previous"></v-btn>
|
|
334
|
+
<v-btn icon="$next" class="bg-media_head" variant="tonal" @click="next"></v-btn>
|
|
290
335
|
</v-col>
|
|
291
336
|
<v-col cols ="8">
|
|
292
337
|
<v-slider v-if="!playLocal" style="width:30%" color="red" track-color="blue" track-fill-color="red" v-model="volume" hide-details density="compact"
|
|
293
338
|
min="0" max="100" step="5" @update:modelValue="changeVolume">
|
|
294
339
|
</v-slider>
|
|
340
|
+
<v-div v-else>{{playingItem.title}}</v-div>
|
|
295
341
|
</v-col>
|
|
296
342
|
</v-row>
|
|
297
|
-
<v-row v-if="playingItem">
|
|
343
|
+
<v-row v-if="playingItem" density="compact">
|
|
298
344
|
<v-col cols="12">
|
|
299
345
|
<v-progress-linear v-model="positionLength" color="blue" height="25"><strong>{{positionText}}</strong></v-progress-linear>
|
|
300
346
|
</v-col>
|
|
@@ -303,7 +349,7 @@
|
|
|
303
349
|
</v-card>
|
|
304
350
|
<v-card :height="listHeight" density="compact" class="overflow-y-auto bg-media">
|
|
305
351
|
<v-container v-if="search" fluid>
|
|
306
|
-
<v-row v-for="(feed,index) in feeds" :key="feed.rssUrl" @click="listFeed(feed)">
|
|
352
|
+
<v-row v-for="(feed,index) in feeds" :key="feed.rssUrl" density="compact" @click="listFeed(feed)">
|
|
307
353
|
<v-col cols="1">{{feed.country}}</v-col>
|
|
308
354
|
<v-col cols="2">{{feed.genre}}</v-col>
|
|
309
355
|
<v-col cols="2">{{feed.owner}}</v-col>
|
|
@@ -311,11 +357,9 @@
|
|
|
311
357
|
</v-row>
|
|
312
358
|
</v-container>
|
|
313
359
|
<v-container v-else>
|
|
314
|
-
<v-row v-for="(item,index) in items" :key="item.
|
|
315
|
-
<v-col cols="
|
|
316
|
-
<v-col cols="
|
|
317
|
-
<v-col cols="2">{{feed.owner}}</v-col>
|
|
318
|
-
<v-col cols="5">{{item.title}}</v-col>
|
|
360
|
+
<v-row v-for="(item,index) in items" :key="item.title" density="compact" :class="{ active: index == playIndex }" @click="listItem(item)">
|
|
361
|
+
<v-col cols="6">{{item.title}}</v-col>
|
|
362
|
+
<v-col cols="6">{{toTime(item.duration)}}</v-col>
|
|
319
363
|
</v-row>
|
|
320
364
|
</v-container>
|
|
321
365
|
</v-card>
|
|
@@ -370,3 +414,9 @@
|
|
|
370
414
|
-->
|
|
371
415
|
</template>
|
|
372
416
|
|
|
417
|
+
<style scoped>
|
|
418
|
+
.active {
|
|
419
|
+
background-color: aliceblue;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
</style>
|