diff --git a/app/Http/Controllers/Api/VideoAnnotationController.php b/app/Http/Controllers/Api/VideoAnnotationController.php
index 619bd8aaa..f1ab24bcd 100644
--- a/app/Http/Controllers/Api/VideoAnnotationController.php
+++ b/app/Http/Controllers/Api/VideoAnnotationController.php
@@ -211,13 +211,8 @@ public function store(StoreVideoAnnotation $request)
}
}
- // from a JSON request, the array may already be decoded
$points = $request->input('points', []);
- if (is_string($points)) {
- $points = json_decode($points);
- }
-
$annotation = new VideoAnnotation([
'video_id' => $request->video->id,
'shape_id' => $request->input('shape_id'),
diff --git a/app/Http/Controllers/Views/Videos/VideoAnnotationController.php b/app/Http/Controllers/Views/Videos/VideoAnnotationController.php
index bd82a7c01..d5140a88f 100644
--- a/app/Http/Controllers/Views/Videos/VideoAnnotationController.php
+++ b/app/Http/Controllers/Views/Videos/VideoAnnotationController.php
@@ -18,7 +18,7 @@ public function show($id)
$annotation = VideoAnnotation::findOrFail($id);
$this->authorize('access', $annotation);
- return redirect()->route('video', [
+ return redirect()->route('video-annotate', [
'id' => $annotation->video_id,
'annotation' => $annotation->id,
]);
diff --git a/app/Http/Controllers/Views/Volumes/VideoController.php b/app/Http/Controllers/Views/Volumes/VideoController.php
new file mode 100644
index 000000000..67dc46bc5
--- /dev/null
+++ b/app/Http/Controllers/Views/Volumes/VideoController.php
@@ -0,0 +1,36 @@
+findOrFail($id);
+
+ $this->authorize('access', $video);
+
+ $metadataMap = [
+ 'gps_altitude' => 'GPS Altitude',
+ 'distance_to_ground' => 'Distance to ground',
+ 'yaw' => 'Yaw/Heading',
+ 'area' => 'Area',
+ ];
+
+ return view('volumes.videos.index', [
+ 'video' => $video,
+ 'volume' => $video->volume,
+ 'metadata' => Arr::only($video->metadata, array_keys($metadataMap)),
+ 'metadataMap' => $metadataMap,
+ ]);
+ }
+}
diff --git a/app/Http/Requests/StoreVideoAnnotation.php b/app/Http/Requests/StoreVideoAnnotation.php
index 1a9d18ff1..b42d2dd33 100644
--- a/app/Http/Requests/StoreVideoAnnotation.php
+++ b/app/Http/Requests/StoreVideoAnnotation.php
@@ -41,6 +41,8 @@ public function rules()
'required_unless:shape_id,'.Shape::wholeFrameId(),
'array',
],
+ 'points.*' => 'array',
+ 'points.*.*' => 'numeric',
'frames' => 'required|array',
'frames.*' => 'required|numeric|min:0|max:'.$this->video->duration,
'track' => 'filled|boolean',
@@ -67,18 +69,13 @@ public function withValidator($validator)
$validator->errors()->add('frames', 'A new whole frame annotation must not have more than two frames.');
}
- $points = $this->input('points', []);
- $allArrays = array_reduce($points, fn ($c, $i) => $c && is_array($i), true);
-
- if (!$allArrays) {
- $validator->errors()->add('points', 'The points must be an array of arrays.');
- }
if ($this->shouldTrack()) {
if ($frameCount !== 1) {
$validator->errors()->add('id', 'Only single frame annotations can be tracked.');
}
+ $points = $this->input('points', []);
if (count($points) !== 1) {
$validator->errors()->add('id', 'Only single frame annotations can be tracked.');
}
diff --git a/resources/assets/js/volumes/components/metadataModal.vue b/resources/assets/js/volumes/components/metadataModal.vue
new file mode 100644
index 000000000..3367f43a2
--- /dev/null
+++ b/resources/assets/js/volumes/components/metadataModal.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+ {{ "Time" }}
+ {{ name }}
+
+
+
+
+ {{ time }}
+
+
+
+ {{ times[index] }}
+ {{ item }}
+
Dimensions | +{{ $video->width }} × {{ $video->height }} px | +||
---|---|---|---|
Size | +{{ round($video->size / 1E+6, 2) }} MBytes | +||
MIME | +{{ $video->mimetype }} |
+ ||
+ Created + | ++ | ||
+ {{ $metadataMap[$field] }} + | ++ @else + | {{ $metadataMap[$field] }} | +{{ $value }} | + @endif +
Created | +{{ $video->taken_at }} | +||
{{ $metadataMap[$field] }} | +{{ $value }} | +