@christianriedl/media 1.0.276 → 1.0.277
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/playerService.d.ts +13 -3
- package/dist/playerService.js +28 -3
- package/dist/playerService.js.map +1 -1
- package/package.json +1 -1
- package/src/views/PhotoAlbumPage.vue +13 -1
- package/src/views/PhotosGridPage.vue +43 -21
- package/src/views/VideosPage.vue +17 -25
package/dist/playerService.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRest } from '@christianriedl/rest';
|
|
2
|
-
import { ILogger,
|
|
2
|
+
import { ILogger, InjectionKey, Ref } from '@christianriedl/utils';
|
|
3
3
|
import { EMediaType } from "./iMedia";
|
|
4
4
|
export declare enum EPlayState {
|
|
5
5
|
PowerOff = 0,
|
|
@@ -32,14 +32,23 @@ export interface IPlayerCommand {
|
|
|
32
32
|
cmd: string;
|
|
33
33
|
value: string;
|
|
34
34
|
}
|
|
35
|
+
export interface IPlayerConfiguration {
|
|
36
|
+
playerName: string;
|
|
37
|
+
shortName: string;
|
|
38
|
+
sensorName: string;
|
|
39
|
+
online: Ref<boolean>;
|
|
40
|
+
playerState: Ref<IPlayerState | null>;
|
|
41
|
+
}
|
|
35
42
|
export declare const getPlayerSymbol: InjectionKey<() => PlayerService>;
|
|
36
43
|
export declare class PlayerService {
|
|
37
44
|
rest: IRest;
|
|
38
45
|
mediaUrl: string;
|
|
39
46
|
log: ILogger;
|
|
40
47
|
playerNames: string[];
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
playerConfigurations: IPlayerConfiguration[];
|
|
49
|
+
currentPlayer?: IPlayerConfiguration;
|
|
50
|
+
getSensorOnline?: (sensorName: string) => boolean | null;
|
|
51
|
+
constructor(rest: IRest, log: ILogger, configs: IPlayerConfiguration[], getSensorOnline?: (sensorName: string) => boolean | null);
|
|
43
52
|
getPlayers(mediaType?: EMediaType, isReady?: boolean): Promise<string[]>;
|
|
44
53
|
getPlayerState(playerName: string): Promise<IPlayerState | null>;
|
|
45
54
|
play(playerRequest: IPlayerRequest): Promise<boolean>;
|
|
@@ -48,4 +57,5 @@ export declare class PlayerService {
|
|
|
48
57
|
next(playerName: string): Promise<boolean>;
|
|
49
58
|
previous(playerName: string): Promise<boolean>;
|
|
50
59
|
command(playerCommand: IPlayerCommand): Promise<boolean>;
|
|
60
|
+
getPlayersOnline(): number;
|
|
51
61
|
}
|
package/dist/playerService.js
CHANGED
|
@@ -14,11 +14,15 @@ export class PlayerService {
|
|
|
14
14
|
mediaUrl;
|
|
15
15
|
log;
|
|
16
16
|
playerNames = [];
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
playerConfigurations;
|
|
18
|
+
currentPlayer;
|
|
19
|
+
getSensorOnline;
|
|
20
|
+
constructor(rest, log, configs, getSensorOnline) {
|
|
19
21
|
this.log = log;
|
|
20
22
|
this.rest = rest;
|
|
21
23
|
this.mediaUrl = rest.serviceUrl;
|
|
24
|
+
this.playerConfigurations = configs;
|
|
25
|
+
this.getSensorOnline = getSensorOnline;
|
|
22
26
|
}
|
|
23
27
|
async getPlayers(mediaType, isReady) {
|
|
24
28
|
const query = {};
|
|
@@ -28,15 +32,23 @@ export class PlayerService {
|
|
|
28
32
|
query.isReady = isReady;
|
|
29
33
|
const players = await this.rest.getData('apiplayer/players', query);
|
|
30
34
|
this.playerNames = players.result;
|
|
35
|
+
for (let i = 0; i < this.playerConfigurations.length; i++) {
|
|
36
|
+
const config = this.playerConfigurations[i];
|
|
37
|
+
config.online.value = this.playerNames.includes(config.playerName);
|
|
38
|
+
}
|
|
31
39
|
return this.playerNames;
|
|
32
40
|
}
|
|
33
41
|
async getPlayerState(playerName) {
|
|
34
42
|
const result = await this.rest.getData('apiplayer/playstate', { playerName: playerName });
|
|
43
|
+
const config = this.playerConfigurations.find(c => c.playerName === playerName);
|
|
35
44
|
if (result.ok) {
|
|
36
45
|
const playerState = result.result;
|
|
37
|
-
|
|
46
|
+
config.playerState.value = playerState;
|
|
47
|
+
config.online.value = !!playerState.state;
|
|
38
48
|
return playerState;
|
|
39
49
|
}
|
|
50
|
+
config.online.value = false;
|
|
51
|
+
config.playerState.value = null;
|
|
40
52
|
return null;
|
|
41
53
|
}
|
|
42
54
|
async play(playerRequest) {
|
|
@@ -63,5 +75,18 @@ export class PlayerService {
|
|
|
63
75
|
const result = await this.rest.postData('apiplayer/playcommand', playerCommand);
|
|
64
76
|
return result.ok;
|
|
65
77
|
}
|
|
78
|
+
getPlayersOnline() {
|
|
79
|
+
let count = 0;
|
|
80
|
+
for (let i = 0; i < this.playerConfigurations.length; i++) {
|
|
81
|
+
const config = this.playerConfigurations[i];
|
|
82
|
+
if (config.sensorName && this.getSensorOnline)
|
|
83
|
+
config.online.value = this.getSensorOnline(config.sensorName);
|
|
84
|
+
else
|
|
85
|
+
config.online.value = null;
|
|
86
|
+
if (config.online.value)
|
|
87
|
+
count++;
|
|
88
|
+
}
|
|
89
|
+
return count;
|
|
90
|
+
}
|
|
66
91
|
}
|
|
67
92
|
//# sourceMappingURL=playerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerService.js","sourceRoot":"","sources":["../src/playerService.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IAClB,mDAAY,CAAA;IACZ,iDAAO,CAAA;IACP,+CAAM,CAAA;IACN,iDAAO,CAAA;IACP,2CAAI,CAAA;IACJ,iDAAO,CAAA;IACP,mDAAQ,CAAA;AACZ,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB;
|
|
1
|
+
{"version":3,"file":"playerService.js","sourceRoot":"","sources":["../src/playerService.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IAClB,mDAAY,CAAA;IACZ,iDAAO,CAAA;IACP,+CAAM,CAAA;IACN,iDAAO,CAAA;IACP,2CAAI,CAAA;IACJ,iDAAO,CAAA;IACP,mDAAQ,CAA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+5,7 @@
|
|
|
5
5
|
import { IAppState, IAppConfig, EDevice, EDirection, Dictionary, appStateSymbol, appConfigSymbol } from '@christianriedl/utils';
|
|
6
6
|
import {
|
|
7
7
|
EMediaType, EPictureFlags, IPictureFile, IMediaFolder, IMediaService, IMediaAppConfig, EPictureQuality,
|
|
8
|
-
MediaHelper, getMediaBinSymbol
|
|
8
|
+
MediaHelper, getMediaBinSymbol, getPlayerSymbol
|
|
9
9
|
} from '@christianriedl/media';
|
|
10
10
|
|
|
11
11
|
import PhotoMetaData from '../components/PhotoMetaData.vue';
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
const mediaAppConfig = appConfig as unknown as IMediaAppConfig;
|
|
20
20
|
const getMediaService = inject(getMediaBinSymbol)!;
|
|
21
21
|
const mediaService = getMediaService();
|
|
22
|
+
const getPlayerService = inject(getPlayerSymbol)!;
|
|
23
|
+
const playerService = getPlayerService();
|
|
22
24
|
const heightStyle = computed<StyleValue>(() => { return { height: appState.bodyHeight.value + 'px', overflowY: 'hidden' } });
|
|
23
25
|
const isMobile = appState.isMobile;
|
|
24
26
|
const headerText = ref("");
|
|
@@ -366,6 +368,16 @@
|
|
|
366
368
|
itemName.value = item.title;
|
|
367
369
|
nameTimer = window.setTimeout(() => { clearName(); }, mediaAppConfig.nameDurationMS);
|
|
368
370
|
}
|
|
371
|
+
if (playerService.currentConfig) {
|
|
372
|
+
const request = {
|
|
373
|
+
playerName: playerService.currentConfig.playerName,
|
|
374
|
+
folderId: item.dlnaParentId,
|
|
375
|
+
mediaId: item.dlnaid,
|
|
376
|
+
trackNo: -1,
|
|
377
|
+
withStreamTitle: false
|
|
378
|
+
};
|
|
379
|
+
const rc = playerService!.play(request).then(() => );
|
|
380
|
+
}
|
|
369
381
|
}
|
|
370
382
|
function createBlob(item: IPictureFile) {
|
|
371
383
|
item.blob = appConfig.urlPrefix + "img/Wait.png";
|
|
@@ -2,19 +2,24 @@
|
|
|
2
2
|
import { inject, ref, reactive, computed, onMounted, onUnmounted, nextTick, watch, StyleValue } from 'vue';
|
|
3
3
|
import type { ComponentPublicInstance } from 'vue';
|
|
4
4
|
import { useRouter, useRoute } from 'vue-router';
|
|
5
|
-
import { IAppState, IAppConfig, EDevice, EBrowser, appStateSymbol, appConfigSymbol, Helper } from '@christianriedl/utils';
|
|
5
|
+
import { IAppState, IAppConfig, EDevice, EBrowser, appStateSymbol, appConfigSymbol, authorizeSymbol, Helper, EScope } from '@christianriedl/utils';
|
|
6
6
|
import { IRestResult, IValueResult } from '@christianriedl/rest';
|
|
7
|
-
import { EItemType, EMediaType, IMediaFolder, IMediaItem, IPhotoSelection, IMediaService,
|
|
8
|
-
|
|
7
|
+
import { EItemType, EMediaType, IMediaFolder, IMediaItem, IPhotoSelection, IMediaService, getMediaBinSymbol,
|
|
8
|
+
IPlayerConfiguration, getPlayerSymbol, IMediaAppConfig, MediaHelper, LocationHelper
|
|
9
9
|
} from '@christianriedl/media';
|
|
10
10
|
import FileUpload from '../components/FileUpload.vue';
|
|
11
11
|
import PhotoDownload from '../components/PhotoDownload.vue';
|
|
12
12
|
|
|
13
13
|
const appState = inject(appStateSymbol)!;
|
|
14
14
|
const appConfig = inject(appConfigSymbol)!;
|
|
15
|
+
const authorize = inject(authorizeSymbol)!;
|
|
15
16
|
const mediaAppConfig = appConfig as unknown as IMediaAppConfig;
|
|
16
17
|
const getMediaService = inject(getMediaBinSymbol)!;
|
|
17
|
-
const mediaService = getMediaService()
|
|
18
|
+
const mediaService = getMediaService();
|
|
19
|
+
const getPlayerService = inject(getPlayerSymbol)!;
|
|
20
|
+
const playerService = getPlayerService();
|
|
21
|
+
const supportsLocalMedia = authorize.checkScope(EScope.Media);
|
|
22
|
+
|
|
18
23
|
//const heightStyle = computed<StyleValue>(() => { return { height: appState.bodyHeight.value + 'px', overflowY: 'auto' } });
|
|
19
24
|
const isMobile = appState.isMobile && (appState.device != EDevice.iPad);
|
|
20
25
|
const router = useRouter();
|
|
@@ -51,6 +56,15 @@
|
|
|
51
56
|
})
|
|
52
57
|
async function start() {
|
|
53
58
|
let root: IMediaFolder;
|
|
59
|
+
if (supportsLocalMedia) {
|
|
60
|
+
playerService.getPlayersOnline();
|
|
61
|
+
for (let i = 0; i < playerService.playerConfigurations.length; i++) {
|
|
62
|
+
const config = playerService.playerConfigurations.length;
|
|
63
|
+
if (!config.playerState) {
|
|
64
|
+
playerService.getPlayerState(config.playerName);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
54
68
|
if (route.query && route.query.id) {
|
|
55
69
|
const id = decodeURIComponent(route.query.id.toString());
|
|
56
70
|
root = mediaService.getFolder(id);
|
|
@@ -174,6 +188,9 @@
|
|
|
174
188
|
async function onSearch() {
|
|
175
189
|
router.push({ path: 'photothumbnails' });
|
|
176
190
|
}
|
|
191
|
+
function playTV(config: IPlayerConfiguration) {
|
|
192
|
+
playerService.currentPlayer = config;
|
|
193
|
+
}
|
|
177
194
|
async function initialize(selectedName?: string) {
|
|
178
195
|
let root = await mediaService.getPhotosByCriteria(stars(), selected.criteria);
|
|
179
196
|
if (selected.criteria != 'ye' && selectedName) {
|
|
@@ -218,23 +235,28 @@
|
|
|
218
235
|
<template>
|
|
219
236
|
<v-card ref="listhead" class="bg-media_head" density="compact">
|
|
220
237
|
<v-card-title>{{selectedFolder.name}}</v-card-title>
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
+
<v-card-actions>
|
|
239
|
+
<v-btn v-if="backVisible" @click="goBack">
|
|
240
|
+
<v-icon icon="$back" />
|
|
241
|
+
</v-btn>
|
|
242
|
+
<v-rating clearable length="2" v-model="selected.rating" @update:modelValue="onRating" />
|
|
243
|
+
<v-select v-model="root" :items="roots" density="compact" persistent-hint
|
|
244
|
+
@update:modelValue="onRootChange" hide-details single-line>
|
|
245
|
+
</v-select>
|
|
246
|
+
<template v-for="player in playerService.playerConfigurations" :key="player.shortName">
|
|
247
|
+
<v-btn v-if="player.online" @click.stop="playTV(player)" :active="!!player.playerState">
|
|
248
|
+
{{player.shortName}}
|
|
249
|
+
</v-btn>
|
|
250
|
+
</template>
|
|
251
|
+
<v-btn v-if="!backVisible" @click="onSearch">
|
|
252
|
+
{{ isMobile ? "" : "SEARCH" }}
|
|
253
|
+
<v-icon icon="$search" />
|
|
254
|
+
</v-btn>
|
|
255
|
+
<v-btn v-if="!isMobile" @click="uploadVisible = !uploadVisible">
|
|
256
|
+
UPLOAD
|
|
257
|
+
<v-icon icon="$upload" />
|
|
258
|
+
</v-btn>
|
|
259
|
+
</v-card-actions>
|
|
238
260
|
</v-card>
|
|
239
261
|
<file-upload v-if="uploadVisible" accept="image/jpeg"></file-upload>
|
|
240
262
|
<v-card :height="listHeight" class="overflow-y-auto bg-media" >
|
package/src/views/VideosPage.vue
CHANGED
|
@@ -5,21 +5,17 @@
|
|
|
5
5
|
import { IAppState, EDevice, EScope, appStateSymbol, appConfigSymbol, IValueText } from '@christianriedl/utils';
|
|
6
6
|
import { Authorize, authorizeSymbol } from '@christianriedl/rest';
|
|
7
7
|
import { EItemType, EMediaType, IMediaFolder, IMediaItem, IVideoFile, IMediaService, MediaHelper,
|
|
8
|
-
getMediaBinSymbol, getPlayerSymbol, IMediaAppConfig, ITranscodeParams
|
|
8
|
+
getMediaBinSymbol, getPlayerSymbol, IMediaAppConfig, ITranscodeParams, IPlayerConfiguration
|
|
9
9
|
} from '@christianriedl/media';
|
|
10
|
-
import { ISensorsState, sensorsStateSymbol } from '@christianriedl/smarthome';
|
|
11
10
|
import FileUpload from '../components/FileUpload.vue';
|
|
12
11
|
|
|
13
12
|
const appState = inject(appStateSymbol)!;
|
|
14
|
-
const sensors = inject(sensorsStateSymbol)!;
|
|
15
13
|
const authorize = inject(authorizeSymbol)!;
|
|
16
14
|
const mediaAppConfig = inject(appConfigSymbol)! as unknown as IMediaAppConfig;
|
|
17
15
|
const getMediaService = inject(getMediaBinSymbol)!;
|
|
18
16
|
const mediaService = getMediaService() ;
|
|
19
17
|
const getPlayerService = inject(getPlayerSymbol)!;
|
|
20
18
|
const playerService = getPlayerService();
|
|
21
|
-
const rendererName = "[TV] Samsung Q9 Series (75)";
|
|
22
|
-
const showRenderer = ref(false);
|
|
23
19
|
const supportsLocalMedia = authorize.checkScope(EScope.Media);
|
|
24
20
|
|
|
25
21
|
const heightStyle = computed<StyleValue>(() => { return { height: appState.bodyHeight.value + 'px', overflowY: 'auto' } });
|
|
@@ -105,9 +101,10 @@
|
|
|
105
101
|
}
|
|
106
102
|
router.push({ path: 'video', query: { url: url, media: parSet ? selected.value.url : "" } });
|
|
107
103
|
}
|
|
108
|
-
async function playTV() {
|
|
104
|
+
async function playTV(config: IPlayerConfiguration) {
|
|
105
|
+
playerService.currentPlayer = config;
|
|
109
106
|
const request = {
|
|
110
|
-
playerName:
|
|
107
|
+
playerName: config.playerName,
|
|
111
108
|
folderId: selected.value.dlnaParentId,
|
|
112
109
|
mediaId: selected.value.dlnaid,
|
|
113
110
|
trackNo: 0,
|
|
@@ -187,21 +184,15 @@
|
|
|
187
184
|
}
|
|
188
185
|
return "";
|
|
189
186
|
}
|
|
190
|
-
function getPlayer() {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
showRenderer.value = false;
|
|
204
|
-
}
|
|
187
|
+
async function getPlayer() {
|
|
188
|
+
if (supportsLocalMedia) {
|
|
189
|
+
playerService.getPlayersOnline();
|
|
190
|
+
for (let i = 0; i < playerService.playerConfigurations.length; i++) {
|
|
191
|
+
const config = playerService.playerConfigurations.length;
|
|
192
|
+
if (!config.playerState) {
|
|
193
|
+
await playerService.getPlayerState(config.playerName);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
205
196
|
}
|
|
206
197
|
}
|
|
207
198
|
async function onShare(item: IMediaItem) {
|
|
@@ -304,9 +295,10 @@
|
|
|
304
295
|
<v-btn v-if="playVisible" @click.stop="play">
|
|
305
296
|
<v-icon size="x-large" icon="$play" />
|
|
306
297
|
</v-btn>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
298
|
+
<template v-if="playVisible" v-for="player in playerService.playerConfigurations" :key="player.shortName">
|
|
299
|
+
<v-btn v-if="player.online" @click.stop="playTV(player)" :active="!!player.playerState" >{{player.shortName}}
|
|
300
|
+
</v-btn>
|
|
301
|
+
</template>
|
|
310
302
|
<v-btn v-if="recordedVisible" @click.stop="recorded">
|
|
311
303
|
<v-icon size="x-large" icon="$recorded" />
|
|
312
304
|
</v-btn>
|