@christianriedl/media 1.0.23 → 1.0.25

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.23",
3
+ "version": "1.0.25",
4
4
  "description": "RIC media interfaces",
5
5
 
6
6
  "main": "dist/index.js",
@@ -18,8 +18,8 @@
18
18
  "author": "Christian Riedl",
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
- "@christianriedl/utils": "^1.0.57",
22
- "@christianriedl/rest": "^1.0.31"
21
+ "@christianriedl/utils": "^1.0.65",
22
+ "@christianriedl/rest": "^1.0.33"
23
23
  },
24
24
  "devDependencies": {
25
25
  "typescript": "^4.6.3",
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { inject, ref, reactive, computed, onMounted, onUnmounted, nextTick, watch } from 'vue';
3
- import { IAppState, Helper, EDevice } from '@christianriedl/utils';
4
- import { Authorize, EScope } from '@christianriedl/rest';
3
+ import { IAppState, Helper, EDevice, EScope } from '@christianriedl/utils';
4
+ import { Authorize } from '@christianriedl/rest';
5
5
  import { EItemType, EMediaType, IMediaFolder, IMediaItem, IAudioFile, MediaService, EPlayState, PlayerService } from '@christianriedl/media';
6
6
  import FileUpload from '../components/FileUpload.vue';
7
7
 
@@ -22,6 +22,9 @@
22
22
  const metadata = reactive<Dictionary<any>>({});
23
23
  const cycle = ref(false);
24
24
  const interval = ref(8000);
25
+ const hasCoordinates = ref(false);
26
+ let gpsLng: number[];
27
+ let gpsLat: number[];
25
28
 
26
29
  watch([appState.bodyHeight, appState.pageWidth], () => {
27
30
  width.value = appState.pageWidth.value;
@@ -83,6 +86,14 @@
83
86
  else
84
87
  return mediaService.getPhotoUrl(url.value, item.Url, `${width.value}x${0}x${item.Orientation}`);
85
88
  }
89
+ function showMap(ev: Event) {
90
+ router.push({
91
+ path: 'gps', query: {
92
+ lat: `${gpsLat[0]} ${gpsLat[1]}`,
93
+ lng: `${gpsLng[0]} ${gpsLng[1]}`
94
+ }
95
+ });
96
+ }
86
97
  function onInput(idx: number) {
87
98
  idx++;
88
99
  if (idx < items.length) {
@@ -184,6 +195,11 @@
184
195
  metadata['Zeit'] = exif.DateTimeOriginal;
185
196
  else
186
197
  metadata['Zeit'] = file.Date.toLocaleString();
198
+ if (exif.GPSLatitude && exif.GPSLongitude) {
199
+ gpsLat = exif.GPSLatitude as number[];
200
+ gpsLng = exif.GPSLongitude as number[];
201
+ hasCoordinates.value = true;
202
+ }
187
203
  }
188
204
  else {
189
205
  delete metadata['Kamera'];
@@ -240,6 +256,9 @@
240
256
  <v-btn @click="dialog = false">
241
257
  <v-icon large icon="$stop" />
242
258
  </v-btn>
259
+ <v-btn v-if="hasCoordinates" @click="showMap">
260
+ <v-icon large icon="$gps" />
261
+ </v-btn>
243
262
  </v-card-actions>
244
263
  </v-card>
245
264
  </v-dialog>
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { inject, ref, reactive, computed, onMounted, onUnmounted, nextTick, watch } from 'vue';
3
3
  import { useRouter } from 'vue-router';
4
- import { IAppState, EDevice } from '@christianriedl/utils';
5
- import { Authorize, EScope } from '@christianriedl/rest';
4
+ import { IAppState, EDevice, EScope } from '@christianriedl/utils';
5
+ import { Authorize } from '@christianriedl/rest';
6
6
  import { EItemType, EMediaType, IMediaFolder, IMediaItem, IVideoFile, MediaService, PlayerService } from '@christianriedl/media';
7
7
  import { ISensorsState } from '@christianriedl/smarthome';
8
8
  import FileUpload from '../components/FileUpload.vue';