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
base: develop
Are you sure you want to change the base?
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
<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
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.