Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Feature 1322-v2 #6346

wants to merge 1 commit into from

Conversation

kntndrsn
Copy link

Description

Second iteration of #1322 using the embedded player and creating the image from the player.

Related issues

#1322

Has this been tested?

  • 馃憤 yes, I added tests to the test suite
  • 馃挱 no, because this PR is a draft and still needs work
  • 馃檯 no, because this PR does not update server code
  • 馃檵 no, because I need help

Screenshots

Advanced Settings section has been updated with a "Select from video" option.

image

When the user selects "Select from frame", the embedded player is loaded.

image

The user can play through the video to select an image.

image

When the user selects "Use frame" the preview is updated.

image

When the user clicks the normal "Update" button, the update is applied.

image

@kntndrsn
Copy link
Author

@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?

@kntndrsn
Copy link
Author

@Chocobozzz Hello. Please lmk if there is anything else I can do on this one.

@kntndrsn kntndrsn changed the title feat-1322-v2-initial-commit Feature 1322-v2 May 13, 2024
Copy link
Owner

@Chocobozzz Chocobozzz left a 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>
Copy link
Owner

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"
Copy link
Owner

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')
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants