-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add screenshot button to video annotator #1004
base: master
Are you sure you want to change the base?
Conversation
Use proivde inject to acess data
@mzur |
On your local instance you could use the BIIGLE landing page video. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I prefer not to use provide/inject here as it hides where the data is coming from. Maybe this is a chance to refactor the screenshot button a bit so it gets all data it needs through props. E.g. if it gets the image/video ID as a prop, it does not even need the image/video changed event any more.
The map.init
event must stay, though, as the map object must not be passed as a prop. It should never be made reactive.
This reverts commit 7715e5e.
I also thought about it, but then I would need to refactor the video and image |
If it's not too much, I think it is fine to pass the props through the settings tab. Alternatively you could |
Events.$emit('annotations.map.init', this.$refs.canvas.map); | ||
this.map = this.$refs.canvas.map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The map must not become a reactive property (see previous review). While you can replace the other use of Event
with props, the map.init
event listener must stay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mzur
Just out of curiosity, why should the map not be made a reactive property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vue will recursively walk through the whole object (which is very large) and make everything reactive that it can find. It will hook up the reactivity watchers/getters/setters to everything. This will make the whole OpenLayers system slow. With performance-critical paths/objects like this, you have to be very careful with Vue.
filesObj: { | ||
type: Object, | ||
default: () => {} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous name filenames
was more descriptive.
@@ -13,6 +13,7 @@ | |||
biigle.$declare('annotations.shapes', {!! $shapes !!}); | |||
biigle.$declare('annotations.imagesIds', {!! $images->keys() !!}); | |||
biigle.$declare('annotations.imagesFilenames', {!! $images->values() !!}); | |||
biigle.$declare('annotations.imagesObj', {!! $images !!}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you only need the filenames, you can use imagesFilenames
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mzur
I need the object, because it maps the file ids to the file names. This ensures that the screenshots get the right file name. Earlier, I had some screenshots with incorrect file names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find it redundant with imagesIds
and imagesFilenames
just above this line. This will inflate the generated HTML of this template with duplicate information. The image annotation tool produced a screenshot with the correct filename before, too, so there should be a way to do it with the existing information (correct me if I'm wrong).
@@ -67,6 +67,7 @@ class="sidebar-container__content" | |||
biigle.$declare('videos.isEditor', @can('add-annotation', $video) true @else false @endcan); | |||
biigle.$declare('videos.videoIds', {!! $videos->keys() !!}); | |||
biigle.$declare('videos.videoFilenames', {!! $videos->values() !!}); | |||
biigle.$declare('videos.videosObj', {!! $videos !!}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you only need the filenames, you can use videoFilenames
instead.
let videoPromise = new Vue.Promise((resolve) => { | ||
this.video.addEventListener('canplay', resolve); | ||
this.video.addEventListener('canplay', () => { | ||
this.checkCORSProperty(); | ||
resolve(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be more "promise-y":
let videoPromise = new Vue.Promise((resolve) => {
this.video.addEventListener('canplay', resolve);
});
videoPromise.then(this.checkCORSProperty);
Map must not be made reactive.
Deflate html by using arrays.
eb2a522
to
b4c6bbf
Compare
Closes #956.