-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature 1322-v2 #6346
Feature 1322-v2 #6346
Conversation
@Chocobozzz Hi. I tried using the my-embed component instead of making my own iframe but I'm having some challenges getting the embed api to work with it. I added a parameter allowing the API to be enabled, but it seems that the dynamically inserted iframe isn't accessible. I've tried what I can find online including ngAfterViewInit to setup the embed-api, but no luck. Any suggestions? |
@Chocobozzz Hello. Please lmk if there is anything else I can do on this one. |
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.
Thanks a lot and sorry for the late review!
|
||
</div> | ||
|
||
<div id="embedContainer" class="" style="position: relative;"></div> |
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.
You can use and improve our embed component instead of injecting your embed code? https://github.com/Chocobozzz/PeerTube/blob/develop/client/src/app/shared/shared-main/video/embed.component.ts
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 made a comment above about this. I made an honest effort to make the my-embed component work, however, I couldn't get the Embed API to work with it. I did search the code for other places it was used but couldn't find anything that would help me. If there is something I have missed or if you have some thoughts on how to approach, I can try again.
<div id="embedContainer" class="" style="position: relative;"></div> | ||
|
||
<div class="inputs"> | ||
<my-reactive-file *ngIf="!selectingFromVideo" inputName="uploadNewThumbnail" inputLabel="Upload image" |
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.
Can you try to use @if
/@else
to it's clearer to read? https://blog.angular-university.io/angular-if/
|
||
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height) | ||
|
||
return canvas.toDataURL('image/jpeg') |
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.
Do you think we can generate a blob directly so we don't have to change server code? https://stackoverflow.com/questions/6850276/how-to-convert-dataurl-to-file-object-in-javascript
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 can create as a blob, but I'm unable to figure out how to attach it such that the server code will detect it as an attached file.
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 was able to get this one figured out. Just had to create a File object with the proper MIME type to set as the form value.
@kntndrsn Do you need help to update the PR? |
I actually didn't mean to close. I had to rebase my repo to get back to the current position and it must have decided to close it. I did initially try the two points you mentioned
Neither worked for me, but was going to give it another go when I found some time. |
Please create another PR I can try so I can update your code to include my suggestions :) |
|
Description
Second iteration of #1322 using the embedded player and creating the image from the player.
Related issues
#1322
Has this been tested?
Screenshots
Advanced Settings section has been updated with a "Select from video" option.
When the user selects "Select from frame", the embedded player is loaded.
The user can play through the video to select an image.
When the user selects "Use frame" the preview is updated.
When the user clicks the normal "Update" button, the update is applied.