-
Notifications
You must be signed in to change notification settings - Fork 165
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
Process Video Locally, Accept Multiple video Resolutions and Canvas Recording #439
Conversation
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.
Looking great, just some small changes!
src/io/camera.js
Outdated
if (webRtcOptions.context === "webrtc") { | ||
video = webRtcOptions.videoEl; | ||
video = document.getElementById("webCamVideoEl"); |
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.
Hi Forcha, this is looking really good. I wanted to note that these lines where we access an options parameter instead of directly using a string are intended to make it easy to point the entire system at a different HTML setup without having to change multiple spots within the code. So if it's possible to preserve these in all the changes you made that would be great. I'm happy to help explain how this gets set and how it works if that's helpful!
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.
Thank you @jywarren. I have made the requested changes on line 91
+ video = webRtcOptions.videoEl;
- video = document.getElementById("webCamVideoEl");
reader.readAsDataURL(this.files[0]); | ||
$('#preset-modal').modal('show'); | ||
reader.readAsDataURL(this.files[0]); | ||
}else{ |
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.
There's a little bit of formatting cleanup we could do here maybe?
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.
Yes alot has to be done here. Thank you, I keep on forgetting
- Show image if is selected after Webrtc has been initialized.
- Hide Video controls when image is selected.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
Moved this thread to #441!
webRtcOptions.videoEl.setAttribute('autoplay', 'autoplay'); | ||
webRtcOptions.videoEl.setAttribute('playsinline', 'playsinline'); | ||
webRtcOptions.videoEl.setAttribute('id', 'webCamVideoEl'); | ||
var webCamVideoEl = document.getElementById('webCamVideoEl') |
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.
Here also we could set this from the constructor options! See my next comment below.
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.
Please help me with the follow up
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.
Please help me with the follow up comment.
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.
var webCamVideoEl = document.getElementById('webCamVideoEl') | |
options.webcamVideoSelector = options.webcamVideoSelector || 'webcamVideoEl'; | |
options.webcamVideoEl = document.getElementById(options.webcamVideoSelector); | |
webRtcOptions.videoEl.setAttribute('id', options.webcamVideoSelector); |
How about this? So we can set it explicitly in the constructor, but it defaults to webcamVideoEl
?
Also, in another PR, we add to the README to show exactly what can be set in the constructor. We can add a section to https://github.com/publiclab/infragram/#contributing -- following the general format of this example: https://github.com/publiclab/inline-markdown-editor/#usage
Does that make sense? What do you think?
Also watch out, the substitution feature of GitHub can only do one line so here I also missed modifying the line above, webRtcOptions.videoEl.setAttribute('id', 'webCamVideoEl');
.
module.exports = function Interface(options) { | ||
module.exports = function Interface(options) { | ||
|
||
var isVideo = false, isCamera=false; var isOnCam; |
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.
var isVideo = false, isCamera=false; var isOnCam; | |
var isVideo = false, | |
isCamera = false, | |
isOnCam; |
img = new Image(); | ||
img.onload = function onImageLoad() { | ||
options.processor.updateImage(this); | ||
if ((this.files[0].type == 'image/jpeg')||(this.files[0].type == 'image/png')) { |
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.
if ((this.files[0].type == 'image/jpeg')||(this.files[0].type == 'image/png')) { | |
if ((this.files[0].type == 'image/jpeg') || (this.files[0].type == 'image/png')) { |
I will address these issues separately. |
Fixes #418
Combines Process Video Locally , Accept Multiple video Resolutions and Canvas Recording
Related pending milestones
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
@publiclab/reviewers
for help, in a comment below