@christianriedl/media 1.0.279 → 1.0.280

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianriedl/media",
3
- "version": "1.0.279",
3
+ "version": "1.0.280",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "author": "Christian Riedl",
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
- "@christianriedl/utils": "^1.0.167",
21
+ "@christianriedl/utils": "^1.0.168",
22
22
  "@christianriedl/rest": "^1.0.89",
23
23
  "@christianriedl/epg": "^1.0.43"
24
24
  },
@@ -348,6 +348,16 @@
348
348
  else {
349
349
  item.blob = getUrl(item);
350
350
  }
351
+ if (playerService.currentPlayer) {
352
+ const request = {
353
+ playerName: playerService.currentPlayer.playerName,
354
+ folderId: item.dlnaParentId,
355
+ mediaId: item.dlnaid,
356
+ trackNo: -1,
357
+ withStreamTitle: false
358
+ };
359
+ const rc = playerService!.play(request).then(() => { });
360
+ }
351
361
  nameTimer = window.setTimeout(() => { onLoad(item); }, 200);
352
362
  }
353
363
  function onLoad(item: IPictureFile) { // img loaded or cached
@@ -368,16 +378,6 @@
368
378
  itemName.value = item.title;
369
379
  nameTimer = window.setTimeout(() => { clearName(); }, mediaAppConfig.nameDurationMS);
370
380
  }
371
- if (playerService.currentPlayer) {
372
- const request = {
373
- playerName: playerService.currentPlayer.playerName,
374
- folderId: item.dlnaParentId,
375
- mediaId: item.dlnaid,
376
- trackNo: -1,
377
- withStreamTitle: false
378
- };
379
- const rc = playerService!.play(request).then(() => {});
380
- }
381
381
  }
382
382
  function createBlob(item: IPictureFile) {
383
383
  item.blob = appConfig.urlPrefix + "img/Wait.png";
@@ -56,7 +56,7 @@
56
56
  async function start() {
57
57
  let root: IMediaFolder;
58
58
  if (supportsLocalMedia) {
59
- playerService.getPlayersOnline(true);
59
+ playerService.getPlayersOnline(false);
60
60
  }
61
61
  if (route.query && route.query.id) {
62
62
  const id = decodeURIComponent(route.query.id.toString());
@@ -181,8 +181,10 @@
181
181
  async function onSearch() {
182
182
  router.push({ path: 'photothumbnails' });
183
183
  }
184
- function playTV(config: IPlayerConfiguration) {
185
- playerService.currentPlayer = config;
184
+ async function playTV(config: IPlayerConfiguration) {
185
+ const playerState = await playerService.getPlayerState(config.playerName);
186
+ if (config.online)
187
+ playerService.currentPlayer = config;
186
188
  }
187
189
  async function initialize(selectedName?: string) {
188
190
  let root = await mediaService.getPhotosByCriteria(stars(), selected.criteria);
@@ -101,15 +101,17 @@
101
101
  router.push({ path: 'video', query: { url: url, media: parSet ? selected.value.url : "" } });
102
102
  }
103
103
  async function playTV(config: IPlayerConfiguration) {
104
- playerService.currentPlayer = config;
105
- const request = {
106
- playerName: config.playerName,
107
- folderId: selected.value.dlnaParentId,
108
- mediaId: selected.value.dlnaid,
109
- trackNo: 0,
110
- withStreamTitle: false
111
- };
112
- const rc = await playerService!.play(request);
104
+ const playerState = await playerService.getPlayerState(config.playerName);
105
+ if (config.online) {
106
+ const request = {
107
+ playerName: config.playerName,
108
+ folderId: selected.value.dlnaParentId,
109
+ mediaId: selected.value.dlnaid,
110
+ trackNo: 0,
111
+ withStreamTitle: false
112
+ };
113
+ const rc = await playerService!.play(request);
114
+ }
113
115
  }
114
116
  function recorded() {
115
117
  router.push({ path: 'recordedvideos' });
@@ -185,7 +187,7 @@
185
187
  }
186
188
  async function getPlayer() {
187
189
  if (supportsLocalMedia) {
188
- playerService.getPlayersOnline(true);
190
+ playerService.getPlayersOnline(false);
189
191
  }
190
192
  }
191
193
  async function onShare(item: IMediaItem) {